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


PHP UserUtils类代码示例

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


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

示例1: _register

 private function _register($res, $username, $password, $email, $mobile, $code, $isValidation)
 {
     if ($isValidation) {
         // 是否开启注册手机验证
         $isRegisterValidation = WebUtils::getDzPluginAppbymeAppConfig('mobcent_register_validation');
         if ($isRegisterValidation) {
             $checkInfo = UserUtils::checkMobileCode($res, $mobile, $code);
             if ($checkInfo['rs'] == 0) {
                 return $this->makeErrorInfo($res, $checkInfo['errcode']);
             }
         }
     }
     $regInfo = UserUtils::register($username, $password, $email);
     if ($regInfo['errcode']) {
         return $this->makeErrorInfo($res, $regInfo['message']);
     }
     if ($isValidation) {
         if ($isRegisterValidation) {
             // 注册完毕之后更新手机验证信息
             $updataArr = array('uid' => $regInfo['info']['uid']);
             AppbymeSendsms::updateMobile($mobile, $updataArr);
         }
     }
     $userInfo = AppbymeUserAccess::registerProcess($regInfo['info']['uid'], $password);
     $res['token'] = (string) $userInfo['token'];
     $res['secret'] = (string) $userInfo['secret'];
     $res['uid'] = (int) $regInfo['info']['uid'];
     return $res;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:29,代码来源:RegisterAction.php

示例2: _getUserInfos

 private function _getUserInfos($uid, $longitude, $latitude, $radius, $page, $pageSize)
 {
     $userInfos = array('count' => 0, 'list' => array());
     $count = SurroundingInfo::getUserCountByUid($uid, $longitude, $latitude, $radius);
     $surroundUsers = SurroundingInfo::getAllUsersByUid($uid, $longitude, $latitude, $radius, $page, $pageSize);
     $list = array();
     foreach ($surroundUsers as $user) {
         $userInfo = array();
         $tmpUid = (int) $user['object_id'];
         $userInfo['uid'] = $tmpUid;
         $userInfo['distance'] = $user['distance'];
         $userInfo['location'] = $user['location'];
         $userInfo['nickname'] = UserUtils::getUserName($tmpUid);
         $userInfo['gender'] = UserUtils::getUserGender($tmpUid);
         $userInfo['status'] = UserUtils::getUserLoginStatus($tmpUid) == UserUtils::STATUS_ONLINE ? 1 : 0;
         $userInfo['icon'] = UserUtils::getUserAvatar($tmpUid);
         // $userInfo['is_friend'] = UserUtils::isFriend($uid, $tmpUid) ? 1 : 0;
         $userInfo['is_friend'] = UserUtils::isFollow($uid, $tmpUid) ? 1 : 0;
         $userInfo['is_black'] = UserUtils::isBlacklist($uid, $tmpUid) ? 1 : 0;
         $list[] = $userInfo;
     }
     $userInfos['count'] = $count;
     $userInfos['list'] = $list;
     return $userInfos;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:25,代码来源:SurroundingAction.php

示例3: _getAnnouncementInfo

 private function _getAnnouncementInfo($res, $id)
 {
     global $_G;
     require_once libfile('function/discuzcode');
     $announce = DzForumAnnouncement::getAnnouncementByUid($id);
     if (!count($announce)) {
         $res = $this->makeErrorInfo($res, 'announcement_nonexistence');
     } else {
         $tempAnnounce = array();
         $tempAnnounce['author'] = $announce['author'];
         $tmp = explode('.', dgmdate($announce['starttime'], 'Y.m'));
         $months[$tmp[0] . $tmp[1]] = $tmp;
         if (!empty($_GET['m']) && $_GET['m'] != dgmdate($announce['starttime'], 'Ym')) {
             continue;
         }
         $tempAnnounce['starttime'] = dgmdate($announce['starttime'], 'd');
         $tempAnnounce['endtime'] = $announce['endtime'] ? dgmdate($announce['endtime'], 'd') : '';
         $tempAnnounce['title'] = WebUtils::emptyHtml($announce['subject']);
         $uid = DzCommonMember::getUidByUsername($announce['author']);
         $tempAnnounce['icon'] = UserUtils::getUserAvatar($uid);
         $announceMessage = $announce['type'] == 1 ? "{$announce[message]}" : $announceMessage;
         $announceMessage = nl2br(discuzcode($announce['message'], 0, 0, 1, 1, 1, 1, 1));
         $announceType = array();
         $announceType['infor'] = WebUtils::emptyHtml($announceMessage);
         $announce['type'] == 1 ? $announceType['type'] = 'url' : ($announceType['type'] = 'text');
         $tempAnnounce['content'] = $announceType;
         $res['body']['list'] = $tempAnnounce;
     }
     return $res;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:30,代码来源:AnnouncementAction.php

示例4: _getImageInfoByTids

 private function _getImageInfoByTids($page, $pageSize)
 {
     $imageList = $this->_getImageTidsByFids($page, $pageSize);
     $list = array();
     global $_G;
     $forum = $_G['forum'];
     foreach ($imageList as $image) {
         $tmpImageInfo = ForumUtils::getTopicInfo($image);
         $imageSummary = ForumUtils::getTopicCover((int) $image);
         $imageInfo['board_id'] = (int) $tmpImageInfo['fid'];
         $imageInfo['board_name'] = $fid != 0 ? $forum['name'] : ForumUtils::getForumName($tmpImageInfo['fid']);
         $imageInfo['board_name'] = WebUtils::emptyHtml($imageInfo['board_name']);
         $imageInfo['topic_id'] = (int) $image;
         $imageInfo['title'] = WebUtils::emptyHtml($tmpImageInfo['subject']);
         $imageInfo['user_id'] = (int) $tmpImageInfo['authorid'];
         $imageInfo['last_reply_date'] = $tmpImageInfo['lastpost'] . "000";
         $imageInfo['user_nick_name'] = $tmpImageInfo['author'];
         $imageInfo['hits'] = (int) $tmpImageInfo['views'];
         $imageInfo['replies'] = (int) $tmpImageInfo['replies'];
         $imageInfo['top'] = (int) ForumUtils::isTopTopic($image) ? 1 : 0;
         $imageInfo['status'] = (int) $tmpImageInfo['status'];
         $imageInfo['essence'] = (int) $tmpImageInfo['digest'] ? 1 : 0;
         $imageInfo['hot'] = (int) $tmpImageInfo['highlight'] ? 1 : 0;
         $tempImageInfo = ImageUtils::getThumbImageEx($imageSummary, 15, true, false);
         $imageInfo['pic_path'] = $tempImageInfo['image'];
         $imageInfo['ratio'] = $tempImageInfo['ratio'];
         $imageInfo['userAvatar'] = UserUtils::getUserAvatar($tmpImageInfo['authorid']);
         $imageInfo['recommendAdd'] = (int) ForumUtils::getRecommendAdd($image);
         $imageInfo['isHasRecommendAdd'] = (int) ForumUtils::isHasRecommendAdd($image);
         $imageInfo['imageList'] = array();
         $imageInfo['sourceWebUrl'] = (string) ForumUtils::getSourceWebUrl($image, 'topic');
         $list[] = $imageInfo;
     }
     return $list;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:35,代码来源:PhotoGalleryAction.php

示例5: beforeControllerAction

 public function beforeControllerAction($controller, $action)
 {
     if (!($controller->id == 'index' && $action->id == 'login') && !UserUtils::isInAppbymeAdminGroup()) {
         $controller->redirect(Yii::app()->createAbsoluteUrl('admin/index/login'));
     }
     return true;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:7,代码来源:AdminModule.php

示例6: _getImageInfoList

 private function _getImageInfoList($res, $landUid, $uid, $page, $pageSize, $albumId)
 {
     $list = array();
     $imageList = UserPhotoInfo::getImageListByAlbumId($albumId, $uid, $page, $pageSize);
     foreach ($imageList as $image) {
         $tempimageInfo = PhotoUtils::getPhotoInfo($image);
         // $imageInfo['board_id'] = (Int)$albumId;
         $imageInfo['pic_id'] = (int) $image;
         $imageInfo['title'] = $tempimageInfo['title'] == "" ? $tempimageInfo['filename'] : $tempimageInfo['title'];
         $imageInfo['title'] = WebUtils::emptyHtml($imageInfo['title']);
         $imageInfo['user_id'] = (int) $uid;
         $imageInfo['release_date'] = $tempimageInfo['dateline'] . "000";
         $lastReplyDate = PhotoUtils::getReplyDate($image);
         $imageInfo['last_update_date'] = $lastReplyDate['last_reply_date'] . "000";
         $imageInfo['user_nick_name'] = $tempimageInfo['username'];
         $imageInfo['hot'] = (int) $tempimageInfo['hot'];
         $imageInfo['replies'] = (int) PhotoUtils::getReplyCount($image);
         $imageInfo['thumb_pic'] = PhotoUtils::getImageCover($image);
         $imageInfo['origin_pic'] = PhotoUtils::getPhotosoRiginCover($tempimageInfo);
         $list[] = $imageInfo;
     }
     global $_G;
     if ($_G['adminid'] != 1) {
         $albumInfo = UserPhotoInfo::getAlbumInfo($uid, $albumId);
         switch ($albumInfo['friend']) {
             case 0:
                 $list;
                 break;
             case 1:
                 UserUtils::isFriend($uid, $landUid) || $landUid == $uid ? $list : ($list = 1);
                 break;
             case 2:
                 $list = PhotoUtils::judgeDesignatedFriends($albumInfo, $landUid, $uid, $list);
                 break;
             case 3:
                 $uid == $landUid ? $list : ($list = 3);
                 break;
             case 4:
                 $landUid == $uid ? $list : ($list = 4);
                 break;
         }
     }
     $res['list'] = $list;
     if ($albumId == 0) {
         $count = UserPhotoInfo::getImageListCountByAlbumId($uid);
     } else {
         $count = UserPhotoInfo::getImageListCount($albumId, $uid);
     }
     $res = WebUtils::getWebApiArrayWithPage_oldVersion($page, $pageSize, $count, $res);
     if (empty($res['list'])) {
         if ($albumId == 0) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'to_view_the_defaultAlbum_does_not_exist');
         }
         return WebUtils::makeErrorInfo_oldVersion($res, 'to_view_the_photo_does_not_exist');
     } elseif ($res['list'] == 1 || $res['list'] == 2 || $res['list'] == 3 || $res['list'] == 4) {
         $res['list'] = array();
         return WebUtils::makeErrorInfo_oldVersion($res, 'to_view_the_photo_set_privacy', array('{username}' => $albumInfo['username']));
     }
     return $res;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:60,代码来源:PhotoListAction.php

示例7: _checkMobileCode

 private function _checkMobileCode($res, $mobile, $code)
 {
     $checkInfo = UserUtils::checkMobileCode($res, $mobile, $code);
     if ($checkInfo['rs'] == 0) {
         return $this->makeErrorInfo($res, $checkInfo['errcode']);
     }
     return $res;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:8,代码来源:CheckMobileCodeAction.php

示例8: checkUserAccess

 protected function checkUserAccess($checkLogin = true)
 {
     if (!UserUtils::checkAccess() && $checkLogin) {
         WebUtils::endAppWithErrorInfo(array('rs' => 0, 'errcode' => 50000000), 'to_login');
         // WebUtils::endAppWithErrorInfo(array(), 'to_login');
     }
     global $_G;
     $this->uid = $_G['uid'];
 }
开发者ID:caidongyun,项目名称:CS,代码行数:9,代码来源:MobcentController.php

示例9: _getUserInfo

 private function _getUserInfo($uid)
 {
     $userInfo = array('uid' => 0, 'name' => '', 'avatar' => '');
     $user = UserUtils::getUserInfo($uid);
     if (!empty($user)) {
         $userInfo['uid'] = (int) $uid;
         $userInfo['name'] = $user['username'];
         $userInfo['avatar'] = UserUtils::getUserAvatar($uid, 'small');
     }
     return $userInfo;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:11,代码来源:PMListAction.php

示例10: _register

 private function _register($res, $username, $password, $email)
 {
     $regInfo = UserUtils::register($username, $password, $email);
     if ($regInfo['errcode']) {
         return $this->makeErrorInfo($res, $regInfo['message']);
     }
     $userInfo = AppbymeUserAccess::registerProcess($regInfo['info']['uid'], $password);
     $res['token'] = (string) $userInfo['token'];
     $res['secret'] = (string) $userInfo['secret'];
     $res['uid'] = (int) $regInfo['info']['uid'];
     return $res;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:12,代码来源:RegisterAction.php

示例11: adduser

function adduser($course, $tmp_roles, $new_username, $mysqli)
{
    $new_password = trim($_POST['new_password']);
    $new_surname = StringUtils::my_ucwords(trim($_POST['new_surname']));
    $new_title = $_POST['new_users_title'];
    $new_email = trim($_POST['new_email']);
    $new_first_names = StringUtils::my_ucwords(trim($_POST['new_first_names']));
    $new_year = $_POST['new_year'];
    $new_gender = $_POST['new_gender'];
    $userid = UserUtils::create_user($new_username, $new_password, $new_title, $new_first_names, $new_surname, $new_email, $course, $new_gender, $new_year, $tmp_roles, '', $mysqli);
    return $userid;
}
开发者ID:vinod-co,项目名称:centa,代码行数:12,代码来源:register.php

示例12: _switchVest

 private function _switchVest($res, $username)
 {
     global $_G;
     $username = WebUtils::t(rawurldecode($username));
     $_GET['username'] = $username;
     $myrepeatsusergroups = (array) dunserialize($_G['cache']['plugin']['myrepeats']['usergroups']);
     if (!in_array($_G['groupid'], $myrepeatsusergroups)) {
         $users = C::t('#myrepeats#myrepeats')->fetch_all_by_username($_G['username']);
         if (!$users) {
             return $this->makeErrorInfo($res, lang('plugin/myrepeats', 'usergroup_disabled'));
         } else {
             $permusers = array();
             foreach ($users as $user) {
                 $permusers[] = $user['uid'];
             }
             $member = C::t('common_member')->fetch_by_username($_GET['username']);
             if (!$member || !in_array($member['uid'], $permusers)) {
                 return $this->makeErrorInfo($res, lang('plugin/myrepeats', 'usergroup_disabled'));
             }
         }
     }
     $user = C::t('#myrepeats#myrepeats')->fetch_all_by_uid_username($_G['uid'], $_GET['username']);
     $user = current($user);
     $olddiscuz_uid = $_G['uid'];
     $olddiscuz_user = $_G['username'];
     $olddiscuz_userss = $_G['member']['username'];
     if (!$user) {
         $newuid = C::t('common_member')->fetch_uid_by_username($_GET['username']);
         if (C::t('#myrepeats#myrepeats')->count_by_uid_username($newuid, $olddiscuz_userss)) {
             // 第一次登录,需要输入密码
         }
         //return $this->makeErrorInfo($res, lang('plugin/myrepeats', 'user_nonexistence'));
     } elseif ($user['locked']) {
         return $this->makeErrorInfo($res, lang('plugin/myrepeats', 'user_locked', array('user' => $_GET['username'])));
     }
     list($password, $questionid, $answer) = explode("\t", authcode($user['logindata'], 'DECODE', $_G['config']['security']['authkey']));
     $logInfo = UserUtils::login($username, $password);
     if ($logInfo['errcode']) {
         return $this->makeErrorInfo($res, $logInfo['message']);
     }
     $userInfo = AppbymeUserAccess::loginProcess($_G['uid'], $password);
     $userAvatar = UserUtils::getUserAvatar($_G['uid']);
     $res['token'] = (string) $userInfo['token'];
     $res['secret'] = (string) $userInfo['secret'];
     $res['uid'] = (int) $_G['uid'];
     $res['avatar'] = (string) $userAvatar;
     $res['userName'] = (string) $_G['username'];
     return $res;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:49,代码来源:SwitchAction.php

示例13: _getPMList

 private function _getPMList($page, $pageSize)
 {
     $pmList = array('list' => array(), 'count' => 0);
     global $_G;
     // 在DISCUZ_ROOT/source/include/space/space_pm.php基础上二次开发
     loaducenter();
     $filter = 'privatepm';
     $perpage = $pageSize;
     $count = 0;
     $list = array();
     if ($filter == 'privatepm' || $filter == 'newpm') {
         $result = uc_pm_list($_G['uid'], $page, $perpage, 'inbox', $filter, 200);
         $count = $result['count'];
         $list = $result['data'];
     }
     if ($_G['member']['newpm']) {
         if ($newpm && $_G['setting']['cloud_status']) {
             $msgService = Cloud::loadClass('Cloud_Service_Client_Message');
             $msgService->setMsgFlag($_G['uid'], $_G['timestamp']);
         }
         C::t('common_member')->update($_G['uid'], array('newpm' => 0));
         uc_pm_ignore($_G['uid']);
     }
     $tempPMList = array();
     foreach ($list as $pm) {
         // 目前只要两人对话的列表
         if ($pm['members'] > 2 || $pm['pmtype'] != 1) {
             $count--;
             continue;
         }
         $tempPm = array();
         $tempPm['plid'] = (int) $pm['plid'];
         $tempPm['pmid'] = (int) $pm['pmid'];
         $tempPm['lastUserId'] = (int) $pm['lastauthorid'];
         $tempPm['lastUserName'] = (string) $pm['lastauthor'];
         $tempPm['lastSummary'] = (string) $pm['lastsummary'];
         $tempPm['lastDateline'] = $pm['lastdateline'] . '000';
         $tempPm['toUserId'] = (int) $pm['touid'];
         $tempPm['toUserAvatar'] = UserUtils::getUserAvatar($pm['touid']);
         $tempPm['toUserName'] = (string) $pm['tousername'];
         $tempPm['toUserIsBlack'] = UserUtils::isBlacklist($_G['uid'], $pm['touid']) ? 1 : 0;
         $tempPm['isNew'] = $pm['new'] ? 1 : 0;
         $tempPMList[] = $tempPm;
     }
     $pmList['list'] = $tempPMList;
     $pmList['count'] = $count;
     return $pmList;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:48,代码来源:PMSessionListAction.php

示例14: getCommentList

 protected function getCommentList($data)
 {
     $res = array('list' => array(), 'count' => 0);
     $list = array();
     $comments = DzPortalComment::getComments($data['id'], $data['idType'], $data['page'], $data['pageSize']);
     foreach ($comments as $comment) {
         $tmpComment = array();
         $tmpComment['managePanel'] = array(array('type' => 'quote', 'action' => '', 'title' => WebUtils::t('引用')));
         $tmpComment['id'] = (int) $comment['cid'];
         $tmpComment['uid'] = (int) $comment['uid'];
         $tmpComment['username'] = $comment['username'];
         $tmpComment['avatar'] = UserUtils::getUserAvatar($comment['uid']);
         $tmpComment['time'] = date('Y-m-d H:i', $comment['dateline']);
         $tmpComment['content'] = $this->transCommentMessage($comment['message']);
         $list[] = $tmpComment;
     }
     $res['list'] = $list;
     $res['count'] = DzPortalComment::getCount($data['id'], $data['idType']);
     return $res;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:20,代码来源:CommentListAction.php

示例15: __construct

 public function __construct(array $data)
 {
     $fields = UserUtils::getTableFields();
     foreach ($fields as $f => $default) {
         if (!isset($data[$f])) {
             Core::throwError("User data is incomplete. Field {$f} is missing.");
             $data[$f] = $default;
         }
     }
     // Special case: Birthday -> Parse it into chunks
     if (strpos($data['birth'], '-') === false) {
         $data['birth'] = '0000-00-00';
     }
     $bday = explode('-', $data['birth']);
     $data['birthday'] = intval($bday[2]);
     $data['birthmonth'] = intval($bday[1]);
     $data['birthyear'] = intval($bday[0]);
     $this->data = $data;
     $this->acl = null;
 }
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:20,代码来源:class.User.php


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