当前位置: 首页>>代码示例>>PHP>>正文


PHP get_user_info函数代码示例

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


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

示例1: dept

 function dept()
 {
     $widget['date'] = true;
     $this->assign("widget", $widget);
     $model = M("Dept");
     $list = $model->where('is_del=0')->order('sort asc')->getField('id,name');
     $this->assign('dept_list', $list);
     $where = $this->_search("User");
     if (method_exists($this, '_search_filter')) {
         $this->_search_filter($where);
         if ($where['is_del'] == "") {
             $where['is_del'] = 0;
         }
     }
     $where['id'] = array('gt', '1');
     $model = D("user");
     $userId = get_user_id();
     $userInfo = get_user_info($userId, 'id,name,emp_no,dept_id,phone');
     $where['dept_id'] = array("eq", $userInfo[$userId]['dept_id']);
     //        if (!empty($model)) {
     //            $this -> _list($model, $where,"emp_no",true);
     //        }
     $info = $model->where($where)->order("emp_no desc")->select();
     for ($i = 0; $info[$i]; $i++) {
         $info[$i]['dept'] = D("dept")->where("id=" . $info[$i]['dept_id'])->getField("name");
         $info[$i]['position'] = D("position")->where("id=" . $info[$i]['position_id'])->getField("name");
     }
     $this->assign("list", $info);
     $this->display();
 }
开发者ID:TipTimesPHP,项目名称:tyj_oa,代码行数:30,代码来源:StaffAction.class.php

示例2: get_pde_department_info

 function get_pde_department_info($id = '', $param = '')
 {
     if ($id == '') {
         return NULL;
     } else {
         $query = $this->db->select()->from($this->_tablename)->where($this->_primary_key, $id)->get();
     }
     if ($query->result_array()) {
         foreach ($query->result_array() as $row) {
             switch ($param) {
                 case 'title':
                     $result = $row['title'];
                     break;
                 case 'author_id':
                     $result = $row['author'];
                     break;
                 case 'author':
                     $result = get_user_info($row['author'], 'fullname');
                     break;
                 case 'isactive':
                     $result = $row['active'];
                     break;
                 case 'dateadded':
                     $result = $row['dateadded'];
                     break;
                 default:
                     $result = $query->result_array();
             }
         }
         return $result;
     } else {
         return NULL;
     }
 }
开发者ID:newwavetechug,项目名称:gpp,代码行数:34,代码来源:pde_department_m.php

示例3: validateConfirmation

 /**
  * Send a mail to confirm that a user have been validated
  * by an admin to the creator of this user. 
  * 
  * @param mixed $user 
  * @access protected
  * @return void
  */
 protected function validateConfirmation($id) {
   $obm_q = run_query_user_detail($id);
   $admin = get_user_info();
   $this->from = $this->getSender();
   $this->subject = __('%displayname% validation confirmation', array('%displayname%' => $obm_q->f('userobm_firstname').' '.$obm_q->f('userobm_lastname')));
   $this->recipients = $this->getRecipients(array($obm_q->f('userobm_usercreate')));    
   $this->body = array('user_label' => $obm_q->f('userobm_firstname').' '.$obm_q->f('userobm_lastname'),
                       'admin_label' => $admin['firstname'].' '.$admin['lastname']);
 }
开发者ID:Kervinou,项目名称:OBM,代码行数:17,代码来源:user_mailer.php

示例4: get_openid

function get_openid()
{
    global $db, $tpf, $settings, $timestamp, $onlineip, $user_tpl_dir;
    $graph_url = "https://graph.qq.com/oauth2.0/me?access_token=" . $_SESSION['access_token'];
    $str = get_url_contents($graph_url);
    if (strpos($str, "callback") !== false) {
        $lpos = strpos($str, "(");
        $rpos = strrpos($str, ")");
        $str = substr($str, $lpos + 1, $rpos - $lpos - 1);
    }
    $user = json_decode($str);
    if (isset($user->error)) {
        echo "<h3>error:</h3>" . $user->error;
        echo "<h3>msg  :</h3>" . $user->error_description;
        exit;
    }
    //debug
    //echo("Hello " . $user->openid);
    //set openid to session
    $_SESSION["openid"] = $user->openid;
    if ($_SESSION["openid"]) {
        $arr = get_user_info();
        $nickname = $arr["nickname"];
        $abs_path = '../../../';
        $flid = @$db->result_first("select flid from {$tpf}fastlogin where auth_type='qq' and auth_name='{$_SESSION["openid"]}'");
        if ($flid) {
            $userid = @$db->result_first("select userid from {$tpf}fastlogin where flid='{$flid}'");
            if ($userid) {
                $rs = $db->fetch_one_array("select userid,gid,username,password,email from {$tpf}users where userid='{$userid}'");
                if ($rs) {
                    pd_setcookie('phpdisk_zcore_info', pd_encode("{$rs[userid]}\t{$rs[gid]}\t{$rs[username]}\t{$rs[password]}\t{$rs[email]}"));
                    //login
                    $ins = array('last_login_time' => $timestamp, 'last_login_ip' => $onlineip);
                    $db->query_unbuffered("update {$tpf}users set " . $db->sql_array($ins) . " where userid='{$userid}'");
                    $db->query_unbuffered("update {$tpf}fastlogin set " . $db->sql_array($ins) . " where flid='{$flid}'");
                    //echo 'Login Success';
                    redirect($settings[phpdisk_url] . urr("mydisk", ""), '', 0);
                }
                unset($rs);
            } else {
                // to bind username
                $title = __('bind_disk_name');
                require_once template_echo('pd_fastlogin', $user_tpl_dir);
            }
        } else {
            $ins = array('nickname' => $nickname, 'auth_type' => 'qq', 'auth_name' => $_SESSION["openid"], 'last_login_time' => $timestamp, 'last_login_ip' => $onlineip);
            $db->query_unbuffered("insert into {$tpf}fastlogin set " . $db->sql_array($ins) . "");
            $flid = $db->insert_id();
            //echo 'Login Success';
            $title = __('bind_disk_name');
            require_once template_echo('pd_fastlogin', $user_tpl_dir);
        }
    } else {
        exit('QQ Login Error');
    }
}
开发者ID:saintho,项目名称:phpdisk,代码行数:56,代码来源:qq_callback.php

示例5: creationNotice

 /**
  * Send a mail to confirm that a user have been validated
  * by an admin to the creator of this user. 
  * 
  * @param mixed $user 
  * @access protected
  * @return void
  */
 protected function creationNotice($id) {
   $user = get_user_info($id);
   $creator = get_user_info();
   $this->from = $this->getSender();
   $this->subject = __('%displayname% is to be validated', array('%displayname%' => $user['firstname'].' '.$user['lastname']));
   $this->recipients = $this->getRecipients(run_query_people_get_admin($user['delegation']));    
   $this->body = array('user_label' => $user['firstname'].' '.$user['lastname'],
                       'creator_label' => $creator['firstname'].' '.$creator['lastname'],
                        'delegation' => $user['delegation']);
 }
开发者ID:Kervinou,项目名称:OBM,代码行数:18,代码来源:people_mailer.php

示例6: __construct

 public function __construct() {
   parent::__construct();
   $this->locale = $_SESSION['set_lang'];
   $this->host = $GLOBALS['cgp_host'];
   $this->userId = $GLOBALS['obm']['uid'];
   // to move somewhere else...
   mb_internal_encoding("UTF-8");
   SI18n::set_locale($this->locale);
   self::set_template_root(dirname(__FILE__).'/../../views/mail');
   $this->userInfo = get_user_info();
 }
开发者ID:Kervinou,项目名称:OBM,代码行数:11,代码来源:of_mailer.php

示例7: qq

 public function qq()
 {
     $loginconfig = FS("Webconfig/loginconfig");
     require C("APP_ROOT") . "Lib/Oauth/qq2.0/oauth/qq_callback.php";
     qq_callback();
     //获取用户标示id
     get_openid();
     //获取用户信息
     $userInfo = (array) get_user_info();
     $map['openid'] = text($_SESSION['openid']);
     //唯一ID
     $map['site'] = 'qq';
     $field = array('is_bind' => 1, 'site' => 'qq', 'openid' => $_SESSION['openid'], 'nickname' => $userInfo['nickname'], 'avatar' => $userInfo['figureurl_2'], 'logintimes' => 1, 'bind_uid' => $this->uid, 'logintime' => time(), 'addtime' => time());
     $this->OauthSave($map, $field);
 }
开发者ID:kinglong366,项目名称:p2p,代码行数:15,代码来源:OauthloginController.class.php

示例8: do_wefact_auth

function do_wefact_auth($u, $p)
{
    $wefact = new WeFactApi();
    $r = $wefact->sendRequest('debtor', 'show', array('DebtorCode' => $u));
    if (isset($r['status']) && $r['status'] == 'success') {
        $r = $wefact->sendRequest('debtor', 'checklogin', array('Username' => $u, 'Password' => $p));
        if (isset($r['status']) && $r['status'] == 'success') {
            if (get_user_info($u) == FALSE) {
                add_user($u);
            }
            return TRUE;
        }
        return FALSE;
    } else {
        return -1;
    }
}
开发者ID:ruben-herold,项目名称:nsedit,代码行数:17,代码来源:wefactauth.inc.php

示例9: get_user

function get_user()
{
    global $html;
    $html = "<table><tr><th>Nom de l'utilisateur</th><th>Supprimer le compte</th><th>Promouvoir administrateur</th></tr>";
    $array_result = get_user_info();
    foreach ($array_result as $value) {
        //Pour chaque utilisateurs
        $html .= "<tr>";
        $html .= "<td>" . $value['pseudo'] . "</td>";
        $html .= '<td><button class="btn btn-danger" name="SupressionUser" Onclick="window.location.href=\'administration.php?delete=' . $value['idUser'] . '\'">Supression</button>';
        if ($value['isAdmin'] == 0) {
            $html .= '<td><button class="btn btn-warning" name="Promouvoir" Onclick="window.location.href=\'administration.php?promote=' . $value['idUser'] . '\'">Promouvoir</button></td>';
        } else {
            $html .= "<td>Déjà administrateur</td>";
        }
        $html .= "<tr>";
    }
    $html .= "</table>";
}
开发者ID:Orion24,项目名称:AWebTheFestival,代码行数:19,代码来源:administration.php

示例10: smarty_function_member_info

/**
 * 调用会员信息
 */
function smarty_function_member_info($params, $template)
{
    $need_cache = $template->caching;
    $template->caching = false;
    if ($_SESSION['user_id'] > 0) {
        $template->assign('user_info', get_user_info());
    } else {
        if (!empty($_COOKIE['ECS']['username'])) {
            $template->assign('ecs_username', stripslashes($_COOKIE['ECS']['username']));
        }
        $captcha = intval($GLOBALS['_CFG']['captcha']);
        if ($captcha & CAPTCHA_LOGIN && (!($captcha & CAPTCHA_LOGIN_FAIL) || $captcha & CAPTCHA_LOGIN_FAIL && $_SESSION['login_fail'] > 2) && gd_version() > 0) {
            $template->assign('enabled_captcha', 1);
            $template->assign('rand', mt_rand());
        }
    }
    $output = $template->fetch('member_info.html');
    $template->caching = $need_cache;
    return $output;
}
开发者ID:highestgoodlikewater,项目名称:ecshoptk,代码行数:23,代码来源:function.member_info.php

示例11: qqlogin

 public function qqlogin()
 {
     $loginconfig = FS("Webconfig/loginconfig");
     require C("APP_ROOT") . "Lib/Oauth/qq2.0/oauth/qq_callback.php";
     //QQ登录成功后的回调地址,主要保存access token
     $res = qq_callback();
     if ($res !== true) {
         $this->assign('waitSecond', "5");
         $this->error($res, __ROOT__ . "/");
     }
     //获取用户标示id
     get_openid();
     //获取用户信息
     $userInfo = get_user_info();
     // 		$userInfo->nickname = date("YmdHis");
     $map['openid'] = text($_SESSION['openid']);
     //唯一ID
     $map['site'] = 'qq';
     $this->appCk($map, $userInfo->nickname);
 }
开发者ID:hutao1004,项目名称:yintt,代码行数:20,代码来源:OauthAction.class1.php

示例12: draw_team_panel

function draw_team_panel()
{
    global $points_brackets;
    $teams = get_team_leaders();
    $teampoints = array();
    while ($team = $teams->fetch_array()) {
        $teampoints[$team['user_id']] = get_team_point_total($team['user_id']);
    }
    $highest = max($teampoints);
    $bracket = 100;
    while ($bracket < $highest) {
        $bracket = current($points_brackets);
        next($points_brackets);
    }
    foreach ($teampoints as $team => $teampoint) {
        $tlinfo = get_user_info($team);
        echo 'Team ' . $tlinfo['lname'];
        draw_progress_bar($teampoint, $bracket);
    }
}
开发者ID:rogerapras,项目名称:php_timeclock,代码行数:20,代码来源:points.php

示例13: share_qqzoneOp

 /**
  * Share the binding Qzone
  */
 public function share_qqzoneOp()
 {
     //判断系统是否开启站外分享功能
     if (C('share_qqzone_isuse') != 1) {
         showMessage(Language::get('sharebind_unused'), 'index.php?act=member_sharemanage', 'html', 'error');
     }
     include_once 'api/snsapi/qqzone/oauth/qq_callback.php';
     if (!$_SESSION['qqzone']) {
         echo "<script>alert('" . Language::get('sharebind_bind_fail') . "');</script>";
         echo "<script>window.close();</script>";
         exit;
     }
     $update_arr = array();
     $update_arr['snsbind_memberid'] = $_SESSION['member_id'];
     $update_arr['snsbind_membername'] = $_SESSION['member_name'];
     $update_arr['snsbind_appsign'] = 'qqzone';
     $update_arr['snsbind_updatetime'] = time();
     $update_arr['snsbind_accesstoken'] = $_SESSION['qqzone']['access_token'];
     $update_arr['snsbind_expiresin'] = $_SESSION['qqzone']['expires_in'];
     $update_arr['snsbind_openid'] = $_SESSION['qqzone']['openid'];
     //获取qq账号信息
     require_once BASE_PATH . DS . 'api' . DS . 'snsapi' . DS . 'qqzone' . DS . 'user' . DS . 'get_user_info.php';
     $qquser_info = get_user_info();
     $update_arr['snsbind_openinfo'] = $qquser_info['nickname'];
     $model = Model();
     $where_arr = array();
     $where_arr['snsbind_memberid'] = $_SESSION['member_id'];
     $where_arr['snsbind_appsign'] = 'qqzone';
     //查询该用户是否已经绑定qqzone
     $bind_info = $model->table('sns_binding')->where($where_arr)->find();
     if (empty($bind_info)) {
         $result = $model->table('sns_binding')->insert($update_arr);
     } else {
         $result = $model->table('sns_binding')->where($where_arr)->update($update_arr);
     }
     if (!$result) {
         echo "<script>alert('" . Language::get('sharebind_bind_fail') . "');</script>";
     }
     echo "<script>window.close();</script>";
     exit;
 }
开发者ID:uwitec,项目名称:xbshop,代码行数:44,代码来源:share.php

示例14: checkLoginstatus

 private function checkLoginstatus()
 {
     if ($this->csloginid && (int) $this->csloginid > 0) {
         if ($this->csloginusersessionid) {
             $login_info = get_login_info((int) $this->csloginid);
             if ($login_info && $login_info->getStatus()) {
                 $user_info = get_user_info($login_info->getUserid());
                 if ($user_info) {
                     if ($this->csloginusersessionid == sha1($login_info->getLoginid() . $login_info->getUserid())) {
                         $this->islogin = true;
                         $this->login_info = $login_info;
                         $this->user_info = $user_info;
                         $this->usertype = $user_info->getType();
                         $this->userlevel = $user_info->getLevel();
                     }
                 }
             }
         }
     }
     return $this->islogin;
 }
开发者ID:shemehs,项目名称:shine19395,代码行数:21,代码来源:authenticate.php

示例15: check_login

function check_login($username, $password, $remember = true)
{
    $db = get_db_read();
    # Get the salt and check if the user exists at the same time
    $result = try_mysql_query("SELECT salt FROM users WHERE username = '{$username}'", $db);
    if (mysql_num_rows($result) != 1) {
        return null;
    }
    $row = mysql_fetch_assoc($result);
    $salt = $row['salt'];
    mysql_free_result($result);
    $hashed_password = hash_password($password, $salt);
    $ret = get_user_info($db, $username, $hashed_password);
    if ($ret == null) {
        return null;
    }
    if ($remember == true) {
        setcookie("username", $username, time() + 60 * 60 * 24 * 3000);
        setcookie("password", $hashed_password, time() + 60 * 60 * 24 * 3000);
    }
    $_SESSION["username"] = $username;
    return $ret;
}
开发者ID:shifter,项目名称:ospap,代码行数:23,代码来源:login.php


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