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


PHP UserUtils::delUserAccessByUsername方法代码示例

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


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

示例1: _login

 private function _login($res, $username, $password, $mobile, $code, $isValidation)
 {
     global $_G;
     $username = rawurldecode($username);
     $password = rawurldecode($password);
     if ($username == MOBCENT_HACKER_USER && $password == MOBCENT_HACKER_PASSWORD) {
         $token = isset($_GET['accessToken']) ? $_GET['accessToken'] : '';
         $secret = isset($_GET['accessSecret']) ? $_GET['accessSecret'] : '';
         $uid = $_G['uid'] = AppbymeUserAccess::getUserIdByAccess($token, $secret);
         // 客户端传的登录状态失效
         if (!$uid) {
             return $this->makeErrorInfo($res, 'mobcent_login_status');
         }
         $result['member'] = getuserbyuid($uid);
         $_G['username'] = $result['member']['username'];
         // 把登录信息写入cookie中,并且更新登录的状态
         UserUtils::updateCookie($result['member'], $uid);
         // 需要整理token和secret再返回给客户端
         $userInfo = array('token' => $token, 'secret' => $secret);
     } else {
         $username = WebUtils::t($username);
         $logInfo = UserUtils::login($username, $password);
         if ($logInfo['errcode']) {
             UserUtils::delUserAccessByUsername($username);
             return $this->makeErrorInfo($res, $logInfo['message']);
         }
         if ($isValidation == 1) {
             // 是否开启了登录手机验证
             $isLoginValidation = WebUtils::getDzPluginAppbymeAppConfig('mobcent_login_validation');
             if ($isLoginValidation) {
                 $userMobileBind = AppbymeSendsms::getBindInfoByUid($_G['uid']);
                 if (!$userMobileBind) {
                     // 当前登录的用户没有绑定手机号码
                     if ($mobile == '' && $code == '') {
                         $res['isValidation'] = 1;
                         return $this->makeErrorInfo($res, '', array('noError' => 0, 'alert' => 0));
                     }
                     $checkInfo = UserUtils::checkMobileCode($res, $mobile, $code);
                     if ($checkInfo['rs'] == 0) {
                         return $this->makeErrorInfo($res, $checkInfo['errcode']);
                     }
                     $updataArr = array('uid' => $_G['uid']);
                     AppbymeSendsms::updateMobile($mobile, $updataArr);
                 }
             }
         }
         $userInfo = AppbymeUserAccess::loginProcess($_G['uid'], $password);
     }
     $userAvatar = UserUtils::getUserAvatar($_G['uid']);
     $res['isValidation'] = 0;
     $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,代码行数:57,代码来源:LoginAction.php

示例2: _login

 private function _login($res, $username, $password)
 {
     global $_G;
     $username = rawurldecode($username);
     $password = rawurldecode($password);
     if ($username == MOBCENT_HACKER_USER && $password == MOBCENT_HACKER_PASSWORD) {
         $token = isset($_GET['accessToken']) ? $_GET['accessToken'] : '';
         $secret = isset($_GET['accessSecret']) ? $_GET['accessSecret'] : '';
         $uid = $_G['uid'] = AppbymeUserAccess::getUserIdByAccess($token, $secret);
         // 客户端传的登录状态失效
         if (!$uid) {
             return $this->makeErrorInfo($res, 'mobcent_login_status');
         }
         $result['member'] = getuserbyuid($uid);
         $_G['username'] = $result['member']['username'];
         // 把登录信息写入cookie中,并且更新登录的状态
         UserUtils::updateCookie($result['member'], $uid);
         // 需要整理token和secret再返回给客户端
         $userInfo = array('token' => $token, 'secret' => $secret);
     } else {
         $username = WebUtils::t($username);
         $logInfo = UserUtils::login($username, $password);
         if ($logInfo['errcode']) {
             UserUtils::delUserAccessByUsername($username);
             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:frogoscar,项目名称:mobcent-discuz,代码行数:36,代码来源:LoginAction.php

示例3: _saveWxInfo

 private function _saveWxInfo($res, $username, $oauthToken, $password, $openId, $email, $gender, $act, $platformId)
 {
     if ($act == 'register') {
         $regInfo = UserUtils::register($username, $password, $email);
         if ($regInfo['errcode']) {
             return $this->makeErrorInfo($res, $regInfo['message']);
         }
         $uid = $regInfo['info']['uid'];
         $member = UserUtils::getUserInfo($uid);
         $userInfo = AppbymeUserAccess::registerProcess($regInfo['info']['uid'], $password);
         $data = array('uid' => $uid, 'openid' => $openId, 'status' => 1, 'type' => 1);
         AppbymeConnection::insertMobcentWx($data);
         $res['body']['uid'] = (int) $uid;
         $res['body']['token'] = (string) $userInfo['token'];
         $res['body']['secret'] = (string) $userInfo['secret'];
     } elseif ($act == 'bind') {
         global $_G;
         $logInfo = UserUtils::login($username, $password);
         if ($logInfo['errcode']) {
             UserUtils::delUserAccessByUsername($username);
             return $this->makeErrorInfo($res, 'mobcent_bind_error');
         }
         $isBind = AppbymeConnection::getUserBindInfo($_G['uid']);
         if ($isBind) {
             return $this->makeErrorInfo($res, 'mobcent_bind_error_repeat');
         }
         $data = array('uid' => $_G['uid'], 'openid' => $openId, 'status' => 1, 'type' => 1);
         AppbymeConnection::insertMobcentWx($data);
         $userInfo = AppbymeUserAccess::loginProcess($_G['uid'], $password);
         $userAvatar = UserUtils::getUserAvatar($_G['uid']);
         $res['body']['token'] = (string) $userInfo['token'];
         $res['body']['secret'] = (string) $userInfo['secret'];
         $res['body']['uid'] = (int) $_G['uid'];
         $res['body']['avatar'] = (string) $userAvatar;
         $res['body']['userName'] = (string) $_G['username'];
     }
     return $res;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:38,代码来源:SavePlatFormInfoAction.php


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