本文整理汇总了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;
}
示例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');
}
示例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();
}
示例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();
}
示例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
示例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'];
示例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);
}
示例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' => '');
}
}
示例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
示例10: getCurrentHashedUId
function getCurrentHashedUId()
{
$userID = getCurrentClasUserId();
$user = new Users();
$userInfo = $user->getUserInfo(array($userID));
return $userInfo[0]['hash_user_id'];
}
示例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;
}
示例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'));
}
示例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));
}
示例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']);
?>
回复 <?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");'));
}
示例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');
}
}