• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP uid函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中uid函数的典型用法代码示例。如果您正苦于以下问题:PHP uid函数的具体用法?PHP uid怎么用?PHP uid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了uid函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: updateChargeStatus

 public function updateChargeStatus($cid, $status)
 {
     $data = array('status' => $status, 'optuid' => uid(), 'donedate' => time());
     $this->db->where('cid', $cid);
     $this->db->update($this->table, $data);
     return $this->db->affected_rows();
 }
开发者ID:hetykai,项目名称:domain_auction,代码行数:7,代码来源:user_charge_model.php


示例2: robot

 public function robot()
 {
     if (!he_is('agency')) {
         abort(403);
     }
     $data = DB::table('i_robot')->select('i_robot.*', 'i_robot_lease_log.*', 'i_hospital.name as hospital_name', 'i_employee.name as employee_name')->leftJoin('i_robot_lease_log', 'i_robot.id', '=', 'i_robot_lease_log.robot_id')->leftJoin('i_hospital', 'i_hospital.id', '=', 'i_robot_lease_log.hospital_id')->leftJoin('i_employee', 'i_employee.id', '=', 'i_robot.employee_id')->where('i_robot_lease_log.recent', 1)->where('i_robot_lease_log.agency_id', uid())->orderBy('i_robot.id', 'i_robot_lease_log.lease_ended_at desc')->get();
     return ss($data);
 }
开发者ID:Aaronqcd,项目名称:robot,代码行数:8,代码来源:VRobotHome.php


示例3: api_mycss

function api_mycss()
{
    $sql = "SELECT `css` FROM `css` WHERE `uid` = '" . intval(uid()) . "' LIMIT 1";
    $data = get_var($sql);
    if (db_errno() != 0) {
        apiController::send_error(LR_API_DB_ERROR, 'DATABASE ERROR ' . db_error());
    }
    return apiController::send_result($data);
}
开发者ID:ramo01,项目名称:1kapp,代码行数:9,代码来源:app.php


示例4: requestRecommendation

function requestRecommendation($user_id, $author, $email, $message)
{
    if (!checkLock("peer")) {
        return 6;
    }
    $config = $GLOBALS['config'];
    $user_id = escape($user_id);
    $author = escape($author);
    $email = escape($email);
    if (!validEmail($email)) {
        return 1;
    }
    if (strlen($author) <= 3) {
        return 2;
    }
    //make sure there aren't too many recommendations already
    $result = mysql_query("SELECT COUNT(*) FROM recommendations WHERE user_id = '{$user_id}'");
    $row = mysql_fetch_row($result);
    if ($row[0] >= $config['max_recommend']) {
        return 4;
        //too many recommendations
    }
    //ensure this email hasn't been asked with this user already
    $result = mysql_query("SELECT COUNT(*) FROM recommendations WHERE user_id = '{$user_id}' AND email = '{$email}'");
    $row = mysql_fetch_row($result);
    if ($row[0] > 0) {
        return 5;
        //email address already asked
    }
    lockAction("peer");
    //first create an instance
    $instance_id = customCreate(customGetCategory('recommend', true), $user_id);
    //insert into recommendations table
    $auth = escape(uid(64));
    mysql_query("INSERT INTO recommendations (user_id, instance_id, author, email, auth, status, filename) VALUES ('{$user_id}', '{$instance_id}', '{$author}', '{$email}', '{$auth}', '0', '')");
    $recommend_id = mysql_insert_id();
    $userinfo = getUserInformation($user_id);
    //array (username, email address, name)
    //send email now
    $content = page_db("request_recommendation");
    $content = str_replace('$USERNAME$', $userinfo[0], $content);
    $content = str_replace('$USEREMAIL$', $userinfo[1], $content);
    $content = str_replace('$NAME$', $userinfo[2], $content);
    $content = str_replace('$AUTHOR$', $author, $content);
    $content = str_replace('$EMAIL$', $email, $content);
    $content = str_replace('$MESSAGE$', page_convert($message), $content);
    $content = str_replace('$AUTH$', $auth, $content);
    $content = str_replace('$SUBMIT_ADDRESS$', $config['site_address'] . "/recommend.php?id={$recommend_id}&user_id={$user_id}&auth={$auth}", $content);
    $result = one_mail("Recommendation request", $content, $email);
    if ($result) {
        return 0;
    } else {
        return 3;
    }
}
开发者ID:uakfdotb,项目名称:oneapp,代码行数:55,代码来源:recommend.php


示例5: usb_url

 function usb_url($type)
 {
     if (!he_is('employee')) {
         return;
     }
     $base = 'http://www.remebot.cn/isapi/remeisapi.dll/?';
     $user = DB::table('i_employee')->select(DB::raw('right(password, 4) as pass'))->where('id', uid())->first();
     $time = time();
     $params = ['a' => $type, 'b' => $time, 'c' => uid() * 3 * substr($time, -4), 'd' => $user->pass];
     return $base . http_build_query($params);
 }
开发者ID:newset,项目名称:gd,代码行数:11,代码来源:path.php


示例6: read

 public function read()
 {
     $id = rq('id');
     $data = $this->find($id);
     $res = 0;
     if ($data->recipientid == uid()) {
         $data->read = 1;
         $res = $data->save();
     }
     return ss($res);
 }
开发者ID:newset,项目名称:robot,代码行数:11,代码来源:IMessage.php


示例7: accessRules

 public function accessRules()
 {
     Yii::app()->user->loginUrl = param('adminUrl') . 'user/login';
     $assumed = false;
     if (isset(Yii::app()->session['assumed']) && Yii::app()->session['assumed'] != '') {
         $assumed = true;
     }
     if (uid() != 'admin' && uid() != '' && !$assumed) {
         $this->redirect(array('/video/admin'));
     }
     return array(array('allow', 'actions' => array('login', 'logout'), 'users' => array('*')), array('allow', 'users' => array('admin')), array('deny', 'users' => array('*')));
 }
开发者ID:rajveer4155,项目名称:vidmgr,代码行数:12,代码来源:Controller.php


示例8: client

 function client()
 {
     if (v('type') == 'android') {
         $type = 'android';
     } else {
         $type = 'ios';
     }
     $data['type'] = $type;
     $token = $_SESSION['token'];
     $api = parse_url(c('api_server'), PHP_URL_HOST);
     $data['url'] = $token . '|' . $api . '|' . $_SESSION['uname'] . '|' . uid() . '|' . $_SESSION['level'];
     render($data, 'ajax', 'raw');
 }
开发者ID:ramo01,项目名称:1kapp,代码行数:13,代码来源:inbox.class.php


示例9: rl

 public function rl()
 {
     $user = uid();
     $time = time();
     $row = $this->select(DB::raw('right(password, 4) as pass, name'))->where('id', $user)->first();
     $params = ['a' => 'department', 'b' => $time, 'd' => $row->pass, 'c' => substr($time, -4) * 3 * $user];
     $baseUrl = env('ISAPI_URL');
     $url = $baseUrl . http_build_query($params);
     $res = Requests::get($url);
     $data = json_decode($res->body);
     $data->name = $row->name;
     return response()->json($data);
 }
开发者ID:newset,项目名称:robot,代码行数:13,代码来源:IDepartment.php


示例10: progress_area

function progress_area($data)
{
    $all = count(get_data("SELECT * FROM todo_user WHERE `uid` = 0 OR `uid` = '" . intval(uid()) . "'"));
    $finished = count(get_data("SELECT * FROM todo_user WHERE (`uid` = 0 OR `uid` = '" . intval(uid()) . "') AND `status`='3' "));
    $data['all'] = $all;
    $data['finished'] = $finished;
    $data['margin-left'] = 25;
    $private_all = count(get_data("SELECT * FROM todo_user WHERE (`uid` = 0 OR `uid` = '" . intval(uid()) . "') AND `is_public` ='0'"));
    $private_finished = count(get_data("SELECT * FROM todo_user WHERE (`uid` = 0 OR `uid` = '" . intval(uid()) . "') AND `is_public` = '0' AND `status`='3' "));
    $data['private_all'] = $private_all;
    $data['private_finished'] = $private_finished;
    $data['private_margin-left'] = 200;
    echo render_html($data, dirname(__FILE__) . DS . 'view' . DS . 'progress.tpl.html');
}
开发者ID:xianliflc,项目名称:teamirr,代码行数:14,代码来源:app.php


示例11: verifyPGPKey

function verifyPGPKey($content, $email)
{
    global $config;
    //allow blank "keys" if this is set
    //this means that encryption for $email will be disabled by the cron if it
    // was enabled originally
    if ($config['pgpverify_allowblank'] && trim($content) == '') {
        return true;
    }
    require_once "Crypt/GPG.php";
    //try to create a random subdirectory of $config['pgpverify_tmpdir']
    do {
        $path = $config['pgpverify_tmpdir'] . '/' . uid(16);
    } while (file_exists($path));
    $result = @mkdir($path);
    if ($result === false) {
        if ($config['debug']) {
            die("Failed to create directory [" . $path . "] for PGP verification.");
        } else {
            return false;
        }
    }
    $gpg = new Crypt_GPG(array('homedir' => $path));
    //import the key to our GPG temp directory
    try {
        $gpg->importKey($content);
    } catch (Crypt_GPG_NoDataException $e) {
        //user supplied an invalid key!
        recursiveDelete($path);
        return false;
    }
    //verify the email address matches
    $keys = $gpg->getKeys();
    if (count($keys) != 1) {
        if ($config['debug']) {
            die("Error in PGP verification: key count is " . count($keys) . "!");
        } else {
            recursiveDelete($path);
            return false;
        }
    }
    $userIds = $keys[0]->getUserIds();
    if (count($userIds) != 1 || strtolower($userIds[0]->getEmail()) != strtolower($email)) {
        recursiveDelete($path);
        return false;
    }
    recursiveDelete($path);
    return true;
}
开发者ID:17Halbe,项目名称:gpg-mailgate,代码行数:49,代码来源:gpg.php


示例12: header

 function header($view)
 {
     //view同级下是否存在对应的header
     $header = $view . '_header';
     $viewPath = APPPATH . 'views/';
     $data['controller'] = $this->CI->router->fetch_class();
     if (uli()) {
         //获取用户信息
         lm('user_model');
         $data['userprofile'] = $this->CI->user_model->getUserProfileByIdArray(uid());
     }
     if (file_exists($viewPath . $header . '.php')) {
         lv($header, $data);
     } else {
         lv('header', $data);
     }
 }
开发者ID:hetykai,项目名称:domain_auction,代码行数:17,代码来源:frontview.php


示例13: actionDelete

 public function actionDelete($id)
 {
     if ($_POST['action'] == 1) {
         if ($id == 1) {
             echo json_encode(array('id' => array(0), 'class' => 'alert-error', 'message' => __('supper user can not delete')));
             exit;
         }
         if ($id === uid()) {
             echo json_encode(array('id' => array(0), 'class' => 'alert-error', 'message' => __('you can not remove yourself')));
             exit;
         }
         $model = \app\modules\auth\models\User::find($id);
         $model->delete();
         echo json_encode(array('id' => array($id), 'class' => 'alert-success', 'message' => __('delete user success')));
         exit;
     }
 }
开发者ID:rocketyang,项目名称:mincms,代码行数:17,代码来源:UserController.php


示例14: requestPGP

function requestPGP($email, $key)
{
    require_once includePath() . "/lock.php";
    global $config, $lang;
    if (!checkLock('requestpgp')) {
        return $lang['submit_error_trylater'];
    }
    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
        return $lang['submit_error_bademail'];
    }
    if (strlen($email) > 256 || strlen($key) > 1024 * 32) {
        return $lang['submit_error_toolong'];
    }
    if (!isAscii($key)) {
        return $lang['submit_error_nonascii'];
    }
    //housekeeping
    databaseQuery("DELETE FROM gpgmw_keys WHERE time < DATE_SUB(NOW(), INTERVAL 48 HOUR) AND confirm != '' AND status = 0");
    //if we already have an unaccepted key for this user, only replace if one day has elapsed since the last request
    // this may prevent spam
    $result = databaseQuery("SELECT HOUR(TIMEDIFF(time, NOW())), id FROM gpgmw_keys WHERE email = ? AND status = 0", array($email));
    if ($row = $result->fetch()) {
        if ($row[0] < 24) {
            return $lang['submit_error_alreadyqueue'];
        } else {
            databaseQuery('DELETE FROM gpgmw_keys WHERE id = ?', array($row[1]));
        }
    }
    //if PGP key verification is enabled, do it
    if ($config['pgpverify_enable']) {
        require_once includePath() . "/gpg.php";
        if (!verifyPGPKey($key, $email)) {
            return $lang['submit_error_badkey'];
        }
    }
    //well, it looks good, let's submit it
    lockAction('requestpgp');
    $confirm = uid(32);
    $confirm_link = "{$config['site_url']}/confirm.php?email=" . urlencode($email) . "&confirm={$confirm}";
    $result = gpgmw_mail($config['email_subject_requestpgp'], sprintf($lang['mail_confirm'], $confirm_link), $email);
    if (!$result) {
        return $lang['submit_error_emailfail'];
    }
    databaseQuery("INSERT INTO gpgmw_keys (email, publickey, confirm) VALUES (?, ?, ?)", array($email, $key, $confirm));
    return true;
}
开发者ID:17Halbe,项目名称:gpg-mailgate,代码行数:46,代码来源:pgp.php


示例15: uploaded

 function uploaded()
 {
     if (!is_admin()) {
         return info_page(__('ADMIN_ONLY_LOGIN'));
     }
     if ($_FILES['pfile']['error'] != 0) {
         return info_page(__('PLUGIN_UPLOAD_FILE_ERROR_RETRY'));
     }
     $tmp_name = $_FILES['pfile']['tmp_name'];
     $tname = uid() . '-' . time();
     $plug_path = c('plugin_path') . DS . $tname;
     if (@mkdir($plug_path)) {
         include_once AROOT . 'lib' . DS . 'dUnzip2.inc.php';
         $zip = new dUnzip2($tmp_name);
         $zip->debug = false;
         $zip->unzipAll($plug_path);
         @chmod($plug_path, 0755);
         $info_file = $plug_path . DS . 'app.php';
         if (file_exists($info_file)) {
             if ($info = get_plugin_info(file_get_contents($info_file))) {
                 if (isset($info['folder_name'])) {
                     $folder_name = $info['folder_name'];
                 }
                 if (strlen($folder_name) < 1) {
                     $folder_name = reset(explode('.', basename($_FILES['pfile']['name'])));
                 }
                 if (strlen($folder_name) > 0) {
                     if (file_exists(c('plugin_path') . DS . $folder_name)) {
                         @rename(c('plugin_path') . DS . $folder_name . DS . 'app.php', c('plugin_path') . DS . $folder_name . DS . 'app.bak.php');
                         @rename(c('plugin_path') . DS . $folder_name, c('plugin_path') . DS . $folder_name . '_' . uid() . '_' . time());
                     }
                     rename($plug_path, c('plugin_path') . DS . $folder_name);
                     header("Location: ?c=pluglist");
                     return true;
                 } else {
                     return info_page(__('PLUGIN_GET_NAME_ERROR_RETRY', $tname));
                 }
             }
         } else {
             // clear dir
         }
         return info_page(__('PLUGIN_PACKAGE_FORMAT_ERROR'));
     } else {
         return info_page(__('PLUGIN_CREATE_FOLDER_ERROR'));
     }
 }
开发者ID:xianliflc,项目名称:teamirr,代码行数:46,代码来源:pluglist.class.php


示例16: uploaded

 function uploaded()
 {
     if (!is_admin()) {
         return info_page('只有管理员才能进入此页面,<a href="?c=guest&a=logout">请先用管理员账户登入</a>');
     }
     if ($_FILES['pfile']['error'] != 0) {
         return info_page('文件上传错误,请重新上传');
     }
     $tmp_name = $_FILES['pfile']['tmp_name'];
     $tname = uid() . '-' . time();
     $plug_path = c('plugin_path') . DS . $tname;
     if (@mkdir($plug_path)) {
         include_once AROOT . 'lib' . DS . 'dUnzip2.inc.php';
         $zip = new dUnzip2($tmp_name);
         $zip->debug = false;
         $zip->unzipAll($plug_path);
         @chmod($plug_path, 0755);
         $info_file = $plug_path . DS . 'app.php';
         if (file_exists($info_file)) {
             if ($info = get_plugin_info(file_get_contents($info_file))) {
                 if (isset($info['folder_name'])) {
                     $folder_name = $info['folder_name'];
                 }
                 if (strlen($folder_name) < 1) {
                     $folder_name = reset(explode('.', basename($_FILES['pfile']['name'])));
                 }
                 if (strlen($folder_name) > 0) {
                     if (file_exists(c('plugin_path') . DS . $folder_name)) {
                         @rename(c('plugin_path') . DS . $folder_name . DS . 'app.php', c('plugin_path') . DS . $folder_name . DS . 'app.bak.php');
                         @rename(c('plugin_path') . DS . $folder_name, c('plugin_path') . DS . $folder_name . '_' . uid() . '_' . time());
                     }
                     rename($plug_path, c('plugin_path') . DS . $folder_name);
                     header("Location: ?c=pluglist");
                     return true;
                 } else {
                     return info_page('尝试获取插件名称失败,启用' . $tname . '作为临时名称,<a href="?c=pluglist">请点击继续</a>');
                 }
             }
         } else {
             // clear dir
         }
         return info_page('找不到插件执行脚本-app.php文件,<a href="?c=pluglist">请重新上传格式正确的插件包</a>');
     } else {
         return info_page('创建插件目录失败,请将plugin目录设置为可写后<a href="?c=pluglist">重试</a>');
     }
 }
开发者ID:ramo01,项目名称:1kapp,代码行数:46,代码来源:pluglist.class.php


示例17: actionUpload

 /**
  * 管理员上传
  */
 function actionUpload()
 {
     $name = $_REQUEST['field'];
     if (!$name) {
         exit;
     }
     $file = new File();
     $file->uid = uid();
     $file->admin = 1;
     $rt = $file->upload();
     if (!$rt) {
         return;
     }
     $new[] = $rt;
     $out = File::input($new, $name);
     $rt->tag = $out;
     die(json_encode($rt));
 }
开发者ID:rocketyang,项目名称:mincms,代码行数:21,代码来源:SiteController.php


示例18: render

 /**
  * Render an exception into an HTTP response.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Exception  $e
  * @return \Illuminate\Http\Response
  */
 public function render($request, Exception $e)
 {
     if ($e instanceof TokenMismatchException) {
         $data = ['msg' => 'CSRF Token 错误, 请刷新页面', 'code' => '00003', 'token' => $request->session()->token()];
         // todo 检查当前用户 token 错误原因
         //
         return response($data, 403)->withCookie(cookie('XSRF-TOKEN', $request->session()->token()));
     }
     if ($e->getMessage() == 'insufficient_permission') {
         if (!uid()) {
             $data = ['msg' => '登录过期', 'code' => '00001'];
         } else {
             $data = ['msg' => '无权限访问', 'code' => '00002'];
         }
         return response($data, 403);
     }
     return parent::render($request, $e);
 }
开发者ID:newset,项目名称:robot,代码行数:25,代码来源:Handler.php


示例19: postview

function postview()
{
    global $conn;
    $page = $_SERVER['HTTP_REFERER'];
    $ip = $_SERVER['REMOTE_ADDR'];
    $dbTable = "analytics";
    $id = uid();
    $now = date("Y-m-d H:i:s");
    $domain = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
    if (!$conn) {
        die("Connection failed: " . mysqli_connect_error());
    }
    $sql = "INSERT INTO {$dbTable} (id, page, ip, domain) VALUES('{$id}', '{$page}', '{$ip}', '{$domain}');";
    if (mysqli_query($conn, $sql)) {
        echo 'Successfull';
    } else {
        echo "Error: " . $sql . "<br />" . mysqli_error($conn);
    }
    mysqli_close($conn);
}
开发者ID:JaredKat,项目名称:analytics,代码行数:20,代码来源:api.php


示例20: plugin_simple_token

function plugin_simple_token()
{
    $do = z(t(v('do')));
    switch ($do) {
        case 'create':
        case 'refresh':
            $new_token = substr(md5(uid() . time("Y h j G") . rand(1, 9999)), 0, rand(9, 20));
            $new_token = uid() . substr(md5($new_token), 0, 10);
            $sql = "REPLACE INTO `stoken` ( `uid` , `token` , `on` ) VALUES ( '" . intval(uid()) . "' , '" . s($new_token) . "' , '1' )";
            run_sql($sql);
            if (db_errno() == 0) {
                return ajax_echo('done');
            } else {
                return ajax_echo('error');
            }
            break;
        case 'close':
            $sql = "UPDATE `stoken` SET `on` = '0' WHERE `uid` = '" . intval(uid()) . "' LIMIT 1";
            run_sql($sql);
            if (db_errno() == 0) {
                return ajax_echo('done');
            } else {
                return ajax_echo('error');
            }
            break;
        case 'reopen':
            $sql = "UPDATE `stoken` SET `on` = '1' WHERE `uid` = '" . intval(uid()) . "' LIMIT 1";
            run_sql($sql);
            if (db_errno() == 0) {
                return ajax_echo('done');
            } else {
                return ajax_echo('error');
            }
            break;
        default:
            $data['tinfo'] = get_line("SELECT * FROM `stoken` WHERE `uid` = '" . intval(uid()) . "' LIMIT 1");
            render($data, 'ajax', 'plugin', 'simple_token');
    }
}
开发者ID:ramo01,项目名称:1kapp,代码行数:39,代码来源:app.php



注:本文中的uid函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP uid2username函数代码示例发布时间:2022-05-23
下一篇:
PHP ui_top函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap