當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Users::getUserInfo方法代碼示例

本文整理匯總了PHP中Users::getUserInfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP Users::getUserInfo方法的具體用法?PHP Users::getUserInfo怎麽用?PHP Users::getUserInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Users的用法示例。


在下文中一共展示了Users::getUserInfo方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: perform

 /**
  * Carries out the specified action
  */
 function perform()
 {
     // get the parameters, which have already been validated
     $this->_userName = Textfilter::filterAllHTML($this->_request->getValue("userName"));
     $this->_userPassword = $this->_request->getValue("userPassword");
     $this->_op = Textfilter::filterAllHTML($this->_request->getValue("op"));
     // create a plugin manager
     $pm =& PluginManager::getPluginManager();
     // try to authenticate the user
     $users = new Users();
     if (!$users->authenticateUser($this->_userName, $this->_userPassword)) {
         $this->_view = new AdminDefaultView();
         $this->_view->setErrorMessage($this->_locale->tr("error_incorrect_username_or_password"));
         $this->setCommonData();
         $pm->notifyEvent(EVENT_LOGIN_FAILURE, array("user" => $this->_userName));
         return false;
     }
     // if the user is correct, get and put his or her information in the session
     $userInfo = $users->getUserInfo($this->_userName, $this->_userPassword);
     if (!$userInfo) {
         $this->_view = new AdminDefaultView();
         $this->_view->setErrorMessage($this->_locale->tr("error_incorrect_username_or_password"));
         $this->setCommonData();
         $pm->notifyEvent(EVENT_LOGIN_FAILURE, array("user" => $this->_userName));
         return false;
     }
     $pm->notifyEvent(EVENT_USER_LOADED, array("user" => &$userInfo, "from" => "Login"));
     //$sessionInfo = $_SESSION["SessionInfo"];
     $session = HttpVars::getSession();
     $sessionInfo = $session["SessionInfo"];
     $sessionInfo->setValue("userInfo", $userInfo);
     $session["SessionInfo"] = $sessionInfo;
     HttpVars::setSession($session);
     // get the list of blogs to which the user belongs
     $userBlogs = $users->getUsersBlogs($userInfo->getId(), BLOG_STATUS_ACTIVE);
     // but if he or she does not belong to any yet, we quit
     if (empty($userBlogs)) {
         $this->_view = new AdminDefaultView();
         $this->_view->setErrorMessage($this->_locale->tr("error_dont_belong_to_any_blog"));
         $this->setCommonData();
         return false;
     }
     $pm->notifyEvent(EVENT_BLOGS_LOADED, array("blogs" => &$userBlogs, "from" => "Login"));
     // check if we are skipping the dashboard
     if ($this->_config->getValue("skip_dashboard")) {
         // get the first blog that came
         $this->_blogInfo = end($userBlogs);
         // set it in the session
         $session = HttpVars::getSession();
         $session["SessionInfo"]->setValue("blogInfo", $this->_blogInfo);
         HttpVars::setSession($session);
         // and then continue...
         AdminController::setForwardAction("newPost");
     } else {
         $this->_view = new AdminDashboardView($userInfo, $userBlogs);
     }
     // better to return true if everything's fine
     return true;
 }
開發者ID:BackupTheBerlios,項目名稱:plogfr-svn,代碼行數:62,代碼來源:adminloginaction.class.php

示例2: init

 function init()
 {
     parent::init();
     if (zmf::config('closeSite')) {
         header("Content-type: text/html; charset=utf-8");
         exit(zmf::config('closeSiteReason'));
     }
     $this->uid = zmf::uid();
     if (!Yii::app()->user->isGuest) {
         $uid = Yii::app()->user->id;
         $userInfo = Users::getUserInfo($uid);
         $this->truename = $userInfo['username'];
         $this->userInfo = $userInfo;
     }
     $this->pageTitle = zmf::config('sitename');
     self::_referer();
     $this->mobileTitle = zmf::config('sitename');
 }
開發者ID:ph7pal,項目名稱:mei,代碼行數:18,代碼來源:Q.php

示例3: init

 public function init()
 {
     Yii::app()->language = 'zh_cn';
     if (zmf::config('mobile')) {
         if (tools::checkmobile($this->platform)) {
             Yii::app()->theme = 'frozen';
             $this->isMobile = 'yes';
             $this->layout = '//layouts/mobile';
             $this->currentModule = 'frozen';
         }
     }
     if (zmf::uid()) {
         $this->uid = zmf::uid();
         $userInfo = Users::getUserInfo($this->uid);
         $this->truename = $userInfo['truename'];
         $this->userInfo = $userInfo;
     }
     self::_referer();
 }
開發者ID:ph7pal,項目名稱:wedding,代碼行數:19,代碼來源:T.php

示例4: init

 function init()
 {
     parent::init();
     if (zmf::config('closeSite')) {
         header("Content-type: text/html; charset=utf-8");
         exit(zmf::config('closeSiteReason'));
     }
     $this->uid = zmf::uid();
     if ($this->uid) {
         $uid = $this->uid;
         $userInfo = Users::getUserInfo($uid);
         $this->truename = $userInfo['truename'];
         $this->userInfo = $userInfo;
         $this->userCode = zmf::jiaMi('zmf#' . $this->uid);
     }
     $this->pageTitle = zmf::config('sitename');
     $this->mobileTitle = zmf::config('sitename');
     if ($this->isMobile == 'yes') {
         Yii::app()->theme = 'mobile';
     } else {
         Yii::app()->theme = 'naodong';
     }
     self::_referer();
 }
開發者ID:ph7pal,項目名稱:naodong,代碼行數:24,代碼來源:Q.php

示例5: isset

<?php

if (!$userInfo) {
    $userInfo = Users::getUserInfo($data['uid']);
}
$_uname = $userInfo['truename'];
$_imgsize = isset($imgsize) ? $imgsize : 170;
$formatTime = '';
if ($data['lastupdate'] > $data['cTime']) {
    $formatTime = '更新於' . tools::formatTime($data['lastupdate']);
} else {
    $formatTime = tools::formatTime($data['cTime']);
}
$areaInfo = Area::getOneInfo($data['areaid']);
$toAreaInfo = Area::getOneInfo($data['toAreaid']);
?>
<div class="media <?php 
echo $noborder == 'yes' ? '' : 'zmf-border-bottom';
?>
">
    <div class="media-left">
        <?php 
$this->renderPartial('/common/_user', array('uid' => $data['uid'], 'uname' => $_uname, 'type' => 'a'));
?>
    </div>
    <div class="media-body poi-tips-body">        
        <p class="author">
            <?php 
$this->renderPartial('/common/_user', array('uid' => $data['uid'], 'uname' => $_uname, 'type' => 'l', 'lcss' => ''));
?>
            <?php 
開發者ID:ph7pal,項目名稱:wedding,代碼行數:31,代碼來源:_view.php

示例6: Users

if (!empty($_REQUEST['email']) && empty($_REQUEST['register'])) {
    //LOGGING IN
    //LOGGING IN
    $db = Database::obtain(DB_SERVER, DB_USER, DB_PASS, DB_DATABASE);
    $db->connect();
    $password = $_REQUEST['password'];
    $email = $_REQUEST['email'];
    $u = new Users('unknown', BASE_DOMAIN);
    $login = $u->login($email, $password);
    //print_r($login);
    //$avatar = $u->my_avatar($_SESSION['uid']);
    //sessions set in users class on login
    //get user data
    $uid = $_SESSION['uid'];
    $u = new Users('member', BASE_DOMAIN);
    $user_info = $u->getUserInfo($uid);
    //4 is customers, 3 is employee 2 is admin
    //print_r($user_info);
    $first = $user_info[0]['first'];
    $last = $user_info[0]['last'];
    $email = $user_info[0]['email'];
    $avatar = $user_info[0]['avatar'];
    $pwd_reset_code = $user_info[0]['pwd_reset_code'];
    if ($avatar === "") {
        $settings_avatar = "<img src=\"img/generic.png\" width=\"50\" class=\"img-circle\" alt=\"User Image\"/>";
    } else {
        $settings_avatar = "<img src=\"avatars/" . $avatar . "\" width=\"50\" class=\"img-circle\" alt=\"User Image\"/>";
    }
}
if (!empty($_SESSION['uid'])) {
    $first = $_SESSION['first'];
開發者ID:autonomous019,項目名稱:fsi,代碼行數:31,代碼來源:admin.php

示例7: actionConfig

 public function actionConfig()
 {
     if (Yii::app()->user->isGuest) {
         $this->message(0, Yii::t('default', 'loginfirst'), Yii::app()->createUrl('site/login'), 1);
     }
     $keyid = zmf::uid();
     $info = Users::getUserInfo($keyid);
     if (!$info) {
         $this->message(0, '該用戶不存在,請核實');
     }
     $config = zmf::userConfig($keyid);
     $data = array('info' => $info, 'config' => $config);
     $this->pageTitle = '個人設置 - ' . zmf::config('sitename');
     $this->render('config', $data);
 }
開發者ID:ph7pal,項目名稱:mei,代碼行數:15,代碼來源:UsersController.php

示例8: check

 /**
  * 驗證用戶具體發帖權限,並不影響其他權限
  * @param type $uid 驗證的用戶
  * @param type $type 驗證的類型
  * @param type $field 是否檢查總數
  * @return type
  */
 public static function check($type, $field = false, $uid = '')
 {
     if (!$uid) {
         $uid = Yii::app()->user->id;
     }
     if (!$uid) {
         if (zmf::config('officalUid')) {
             return array('status' => 1, 'msg' => '');
         }
         return array('status' => 0, 'msg' => '用戶不存在');
     }
     $uinfo = Users::getUserInfo($uid);
     if (!$uinfo) {
         return array('status' => 0, 'msg' => '用戶不存在');
     }
     if (!$uinfo['groupid']) {
         return array('status' => 0, 'msg' => '無組織用戶');
     }
     $groupInfo = UserPower::model()->find('groupid=:gid', array(':gid' => $uinfo['groupid']));
     if (!$groupInfo) {
         return array('status' => 0, 'msg' => '無組織用戶');
     }
     $num = $groupInfo->getAttribute($type);
     if ($num === null) {
         return array('status' => 0, 'msg' => '無法完成驗證的type:' . $type);
     } elseif ($num === 0) {
         return array('status' => 0, 'msg' => '不允許');
     } elseif ($field) {
         switch ($field) {
             case 'addPost':
                 $totalNum = $groupInfo['postNum'];
                 $hasNum = Posts::model()->count('uid=:uid AND cTime>=:cTime', array(':uid' => $uid, ':cTime' => $ctime));
                 break;
             case 'addQuestion':
                 $totalNum = $groupInfo['questionNum'];
                 $hasNum = Question::model()->count('uid=:uid AND cTime>=:cTime', array(':uid' => $uid, ':cTime' => $ctime));
                 break;
             case 'addAnswer':
                 $totalNum = $groupInfo['answerNum'];
                 $hasNum = Answer::model()->count('uid=:uid AND cTime>=:cTime', array(':uid' => $uid, ':cTime' => $ctime));
                 break;
             case 'addPoiPost':
                 $totalNum = $groupInfo['poiPostNum'];
                 $hasNum = PoiPost::model()->count('uid=:uid AND cTime>=:cTime', array(':uid' => $uid, ':cTime' => $ctime));
                 break;
             case 'addPoiTips':
                 $totalNum = $groupInfo['poiTipsNum'];
                 $hasNum = PoiTips::model()->count('uid=:uid AND cTime>=:cTime', array(':uid' => $uid, ':cTime' => $ctime));
                 break;
             case 'addImage':
                 $totalNum = $groupInfo['imageNum'];
                 $hasNum = Attachments::model()->count('uid=:uid AND cTime>=:cTime', array(':uid' => $uid, ':cTime' => $ctime));
                 break;
             case 'addComment':
                 $totalNum = $groupInfo['commentNum'];
                 $hasNum = Comments::model()->count('uid=:uid AND cTime>=:cTime', array(':uid' => $uid, ':cTime' => $ctime));
                 break;
             case 'addPlan':
                 $totalNum = $groupInfo['planNum'];
                 $hasNum = Plans::model()->count('uid=:uid AND cTime>=:cTime', array(':uid' => $uid, ':cTime' => $ctime));
                 break;
             case 'yueban':
                 $totalNum = $groupInfo['yuebanNum'];
                 $hasNum = Posts::model()->count('uid=:uid AND cTime>=:cTime', array(':uid' => $uid, ':cTime' => $ctime));
                 break;
         }
         if (!$totalNum) {
             return array('status' => 1, 'msg' => '無限製');
         } else {
             if ($hasNum >= $totalNum) {
                 return array('status' => 0, 'msg' => '已超出限製:' . $totalNum);
             } else {
                 return array('status' => 1, 'msg' => '');
             }
         }
     } else {
         return array('status' => 1, 'msg' => '');
     }
 }
開發者ID:ph7pal,項目名稱:wedding,代碼行數:86,代碼來源:UserPower.php

示例9: array

</span>
    </div>	
<p><img src="<?php 
echo zmf::imgurl($data['logid'], $data['filePath'], 600, $data['classify']);
?>
" alt="<?php 
echo $data['fileDesc'];
?>
" width="550px"/></p>
<div class="photo_desc">
<p></p>
</div>
<div class="photo_info">
    <span>
        <?php 
echo CHtml::link(Users::getUserInfo($data['uid'], 'truename'), array('users/index', 'id' => $data['uid']));
?>
上傳於<?php 
echo date(zmf::config('dateFormat'), $data['cTime']);
?>
,<a href="<?php 
echo zmf::imgurl($data['logid'], $data['filePath'], 'origin', $data['classify']);
?>
" target="_blank">查看原圖</a>
    </span>
    <span style="float:right">
    <?php 
if ($data['uid'] == Yii::app()->user->id || Users::checkPower('delattachment', false, true)) {
    ?>
   
        <?php 
開發者ID:ph7pal,項目名稱:wedding,代碼行數:31,代碼來源:image.php

示例10: getCurrentHashedUId

function getCurrentHashedUId()
{
    $userID = getCurrentClasUserId();
    $user = new Users();
    $userInfo = $user->getUserInfo(array($userID));
    return $userInfo[0]['hash_user_id'];
}
開發者ID:anzhao,項目名稱:CLAS,代碼行數:7,代碼來源:auth.inc.php

示例11: checkPower

 /**
  * 權限判斷
  * @param type $type 權限名
  * @param type $json 是否以json返回
  * @param type $return 是否不終止運行
  * @return boolean
  */
 public function checkPower($type, $json = false, $return = false)
 {
     if (Yii::app()->user->isGuest) {
         if ($return) {
             return false;
         } elseif (!$json and !Yii::app()->request->isAjaxRequest) {
             T::message(0, Yii::t('default', 'loginfirst'), Yii::app()->createUrl('site/login'));
         } else {
             T::jsonOutPut(0, Yii::t('default', 'loginfirst'));
         }
     } else {
         $uid = Yii::app()->user->id;
     }
     if ($type == 'login') {
         return true;
     }
     $userinfo = Users::getUserInfo($uid);
     if (!$userinfo) {
         if ($return) {
             return false;
         } elseif (!$json and !Yii::app()->request->isAjaxRequest) {
             T::message(0, '不存在的用戶,請核實', Yii::app()->createUrl('site/logout'));
         } else {
             T::jsonOutPut(0, '不存在的用戶,請核實');
         }
     }
     $gid = $userinfo['groupid'];
     $groupinfo = UserPower::getInfo($gid);
     if (!$groupinfo) {
         if ($return) {
             return false;
         } elseif (!$json and !Yii::app()->request->isAjaxRequest) {
             T::message(0, '您所在用戶組不存在,請核實', Yii::app()->createUrl('site/logout'));
         } else {
             T::jsonOutPut(0, '您所在用戶組不存在,請核實');
         }
     }
     $power = GroupPowers::model()->findByAttributes(array('powers' => $type), 'gid=:gid', array(':gid' => $gid));
     if (!$power) {
         $power = GroupPowers::model()->findByAttributes(array('powers' => 'all'), 'gid=:gid', array(':gid' => $gid));
     }
     if (!$power) {
         if ($return) {
             return false;
         } elseif (!$json and !Yii::app()->request->isAjaxRequest) {
             T::message(0, '您所在用戶組【' . $groupinfo['title'] . '】無權該操作');
         } else {
             T::jsonOutPut(0, '您所在用戶組【' . $groupinfo['title'] . '】無權該操作');
         }
     }
     return true;
 }
開發者ID:ph7pal,項目名稱:wedding,代碼行數:59,代碼來源:Users.php

示例12: isset

<?php

if ($uid) {
    if (!$userInfo) {
        $userInfo = Users::getUserInfo($uid);
    }
}
$size = isset($size) ? $size : 'small';
$width = isset($width) ? $width : 34;
$acss = isset($acss) ? $acss : '';
//avatar css
$lcss = isset($lcss) ? $lcss : '';
//link css
if (!isset($userInfo->avatarImg)) {
    $userInfo->avatarImg = Users::getAvatar($userInfo['avatar']);
}
if ($type == 'l') {
    //link
    echo CHtml::link($userInfo['truename'], array('users/index', 'id' => $userInfo['id']), array('action' => 'card', 'action-type' => 'user', 'action-data' => $userInfo['id'], 'class' => $lcss, 'target' => '_blank'));
} elseif ($type == 'a') {
    //avatar
    echo CHtml::link(CHtml::image($userInfo->avatarImg, $userInfo['truename'], array('width' => $width, 'class' => $acss)), array('users/index', 'id' => $userInfo['id']), array('action' => 'card', 'action-type' => 'user', 'action-data' => $userInfo['id'], 'class' => $lcss, 'target' => '_blank'));
}
開發者ID:ph7pal,項目名稱:wedding,代碼行數:23,代碼來源:_user.php

示例13: actionMedia

 public function actionMedia()
 {
     $id = tools::val('id');
     if (!$id || !is_numeric($id)) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     $userInfo = Users::getUserInfo($id);
     if (!$userInfo || $userInfo['status'] != Posts::STATUS_PASSED) {
         throw new CHttpException(404, '您所查看的頁麵不存在或已刪除');
     }
     $criteria = new CDbCriteria();
     $criteria->order = 'hits DESC';
     //        $criteria->select='id,truename,`desc`,avatar,posts,hits';
     $criteria->condition = "uid='{$id}' AND status=" . Posts::STATUS_PASSED;
     $count = Naodong::model()->count($criteria);
     $pager = new CPagination($count);
     $pager->pageSize = $this->pageSize;
     $pager->applyLimit($criteria);
     $posts = Naodong::model()->findAll($criteria);
     $posts = self::foreachNaodong($posts);
     Posts::updateCount($id, 'Users');
     $this->pageTitle = $userInfo['truename'] . ' - ' . zmf::config('sitename');
     $this->mobileTitle = $userInfo['truename'];
     $this->pageDescription = $userInfo['desc'] != '' ? $userInfo['desc'] : zmf::config('siteDesc');
     $this->render('media', array('pages' => $pager, 'posts' => $posts, 'userInfo' => $userInfo));
 }
開發者ID:ph7pal,項目名稱:naodong,代碼行數:26,代碼來源:IndexController.php

示例14: array

<?php

$_userInfo = Users::getUserInfo($data['uid']);
$_uname = $_userInfo['truename'];
?>
<div class="media zmf-border-bottom" id="comment_<?php 
echo $data['id'];
?>
"><?php 
$this->renderPartial('/common/_user', array('uid' => $data['uid'], 'userInfo' => $_userInfo, 'type' => 'a', 'width' => 25, 'lcss' => 'pull-left', 'acss' => 'media-object'));
?>
<div class="media-body"><p><?php 
$this->renderPartial('/common/_user', array('uid' => $data['uid'], 'userInfo' => $_userInfo, 'type' => 'l'));
if ($data['tocommentid'] > 0) {
    $cominfo = Comments::getSimpleInfo($data['tocommentid']);
    $_cuInfo = Users::getUserInfo($cominfo['uid']);
    ?>
&nbsp;回複&nbsp;<?php 
    $this->renderPartial('/common/_user', array('uid' => $cominfo['uid'], 'userInfo' => $_cuInfo, 'type' => 'l'));
}
?>
</p><p><?php 
echo zmf::filterOutput($data['content'], true);
?>
</p><p class="color-grey"><?php 
echo tools::formatTime($data['cTime']);
?>
<span class="pull-right action-bar"><?php 
if ($data['uid'] != zmf::uid()) {
    echo CHtml::link('舉報', 'javascript:void(0)', array('onclick' => 'report(' . $data['id'] . ',"comments");'));
}
開發者ID:ph7pal,項目名稱:wedding,代碼行數:31,代碼來源:_comment.php

示例15: getUserInfo

function getUserInfo($args)
{
    $appkeyp = $args[0];
    $username = $args[1];
    $password = $args[2];
    /*
    "nickname" =>
    "firstname" =>
    "lastname" =>
    "email" =>
    "userid" =>
    "url" =>
    */
    $users = new Users();
    $erg = $users->getUserInfo($username, $password);
    if ($erg != false) {
        $ret = array();
        $ret["nickname"] = $erg["_username"];
        $ret["firstname"] = $erg["_username"];
        $ret["lastname"] = "";
        $ret["email"] = $erg["_email"];
        $ret["userid"] = $erg["_id"];
        $ret["url"] = "";
        return $ret;
    } else {
        return new IXR_Error(-1, 'You did not provide the correct password');
    }
}
開發者ID:BackupTheBerlios,項目名稱:plogfr-svn,代碼行數:28,代碼來源:xmlrpc.php


注:本文中的Users::getUserInfo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。