示例#1
0
 function common()
 {
     global $_G;
     if (!$_G['wechat']['setting']) {
         $_G['wechat']['setting'] = unserialize($_G['setting']['mobilewechat']);
     }
     if ($_G['uid']) {
         if ($_G['wechat']['setting']['wechat_qrtype']) {
             $_G['wechatuser'] = C::t('#wechat#common_member_wechatmp')->fetch($_G['uid']);
             if ($_G['wechatuser'] && !$_G['wechatuser']['status']) {
                 $_G['wechatuser']['isregister'] = 1;
             }
         } else {
             $_G['wechatuser'] = C::t('#wechat#common_member_wechat')->fetch($_G['uid']);
         }
         if ($_G['wechatuser'] && $wechatuser['status'] == 1) {
             C::t('#wechat#common_member_wechat')->update($_G['uid'], array('status' => 0));
             require_once libfile('function/member');
             clearcookies();
         }
     }
     if (!$_G['uid'] && !defined('IN_MOBILE') && $_G['wechat']['setting']['wsq_allow']) {
         $_G['setting']['pluginhooks']['global_login_text'] .= wechat_tpl_login_bar();
     }
     $_G['Plang'] = $_G['setting']['wechatviewpluginid'] ? lang('plugin/' . $_G['setting']['wechatviewpluginid']) : array();
     if (!$_G['Plang'] || !$_G['wechatuser']) {
         unset($_G['setting']['plugins']['spacecp']['wechat:spacecp']);
     }
 }
示例#2
0
 function logout()
 {
     global $_G;
     $ctlObj = new logging_ctl();
     $ctlObj->setting = $_G['setting'];
     clearcookies();
     $_G['groupid'] = $_G['member']['groupid'] = 7;
     $_G['uid'] = $_G['member']['uid'] = 0;
     $_G['username'] = $_G['member']['username'] = $_G['member']['password'] = '';
     $_G['setting']['styleid'] = $ctlObj->setting['styleid'];
     echo BIGAPPJSON::encode(array('error_code' => 0, 'error_msg' => lang('plugin/bigapp', 'logout_succ'), 'Message' => array('messageval' => 'logout_succeed', 'messagestr' => lang('plugin/bigapp', 'logout_succ')), 'Variables' => array('auth' => null)));
     die(0);
 }
示例#3
0
 function on_logout()
 {
     global $_G;
     $ucsynlogout = uc_user_synlogout();
     if ($_G['gp_formhash'] != $_G['formhash']) {
         showmessage('logout_succeed', dreferer(), array('formhash' => FORMHASH, 'ucsynlogout' => $ucsynlogout));
     }
     clearcookies();
     $_G['groupid'] = $_G['member']['groupid'] = 7;
     $_G['uid'] = $_G['member']['uid'] = 0;
     $_G['username'] = $_G['member']['username'] = $_G['member']['password'] = '';
     $_G['setting']['styleid'] = $_G['setting']['styleid'];
     showmessage('logout_succeed', dreferer(), array('formhash' => FORMHASH, 'ucsynlogout' => $ucsynlogout, 'module' => $_G['showmessage']['module'], 'tpl' => $_G['showmessage']['tpl']));
 }
 function adminsession($uid, $groupid, $adminid, $ip)
 {
     global $adminipaccess, $db, $tablepre;
     $this->panel = defined('IN_ADMINCP') ? 1 : (defined('IN_MODCP') ? 2 : -1);
     $this->inadmincp = defined('IN_ADMINCP');
     $this->uid = $uid;
     $this->timelimit = time() - 1800;
     $this->db =& $db;
     $this->tablepre =& $tablepre;
     if ($uid < 1 || $adminid < 1 || $this->inadmincp && $adminid != 1) {
         $cpaccess = 0;
     } elseif ($this->inadmincp && $adminipaccess && !ipaccess($ip, $adminipaccess)) {
         $cpaccess = 2;
     } else {
         $session = $this->_loadsession($uid, $ip, $GLOBALS['admincp']['checkip']);
         $this->errorcount = $session['errorcount'];
         $this->storage = $session['storage'];
         if (empty($session)) {
             $this->creatsession($uid, $adminid, $ip);
             $cpaccess = 1;
         } elseif ($session['errorcount'] == -1) {
             $this->update();
             $cpaccess = 3;
         } elseif ($session['errorcount'] <= 3) {
             $cpaccess = 1;
         } else {
             $cpaccess = -1;
         }
     }
     if ($cpaccess == 0) {
         clearcookies();
         showmessage('admin_cpanel_noaccess', 'logging.php?action=login', 'HALTED');
     } elseif ($cpaccess == 2) {
         showmessage('admin_cpanel_noaccess_ip', NULL, 'HALTED');
     } elseif ($cpaccess == -1) {
         showmessage('admin_cpanel_locked', NULL, 'HALTED');
     }
     $this->cpaccess = $cpaccess;
 }
示例#5
0
 public function actionLogout()
 {
     global $_G;
     if (!$_G['uid']) {
         dheader('location: index.php?r=site/index');
     }
     if ($_GET['formhash'] != $_G['formhash']) {
         exit('请求来路不明');
     } else {
         global $_G;
         require_once libfile('function/member');
         $ucsynlogout = $this->setting['allowsynlogin'] ? uc_user_synlogout() : '';
         clearcookies();
         $_G['groupid'] = $_G['member']['groupid'] = 7;
         $_G['uid'] = $_G['member']['uid'] = 0;
         $_G['username'] = $_G['member']['username'] = $_G['member']['password'] = '';
         $_G['setting']['styleid'] = $this->setting['styleid'];
         //退出登录成功
         dheader('location: ' . dreferer());
     }
     return true;
 }
示例#6
0
        showmessage('profile_passwd_notmatch');
    }
    if (!$_GET['newpassword1'] || $_GET['newpassword1'] != addslashes($_GET['newpassword1'])) {
        showmessage('profile_passwd_illegal');
    }
    loaducenter();
    uc_user_edit(addslashes($_G['member']['username']), null, $_GET['newpassword1'], null, 1);
    C::t('common_member')->update($_G['uid'], array('password' => md5(random(10))));
    if ($_G['wechat']['setting']['wechat_qrtype']) {
        C::t('#wechat#common_member_wechatmp')->update($_G['uid'], array('status' => 1));
    } else {
        C::t('#wechat#common_member_wechat')->update($_G['uid'], array('isregister' => 0));
    }
    showmessage('wechat:wsq_password_reset', dreferer());
} elseif (submitcheck('unbindsubmit')) {
    require_once libfile('function/member');
    if ($_G['wechat']['setting']['wechat_qrtype']) {
        require_once DISCUZ_ROOT . './source/plugin/wechat/wsq.class.php';
        $member = C::t('#wechat#common_member_wechatmp')->fetch($_G['uid']);
        if (!$member || !wsq::userunbind($_G['uid'], $member['openid'])) {
            showmessage('wechat:wechat_message_unbind_fail');
        }
        C::t('#wechat#common_member_wechatmp')->delete($_G['uid']);
    } else {
        C::t('#wechat#common_member_wechat')->delete($_G['uid']);
        require_once DISCUZ_ROOT . './source/plugin/wechat/wsq.class.php';
        wsq::report('unbind');
    }
    clearcookies();
    showmessage('wechat:wechat_message_unbinded', $_G['siteurl']);
}
 function on_logout()
 {
     global $_G;
     $ucsynlogout = $this->setting['allowsynlogin'] ? uc_user_synlogout() : '';
     if ($_GET['formhash'] != $_G['formhash']) {
         showmessage('logout_succeed', dreferer(), array('formhash' => FORMHASH, 'ucsynlogout' => $ucsynlogout));
     }
     clearcookies();
     $_G['groupid'] = $_G['member']['groupid'] = 7;
     $_G['uid'] = $_G['member']['uid'] = 0;
     $_G['username'] = $_G['member']['username'] = $_G['member']['password'] = '';
     $_G['setting']['styleid'] = $this->setting['styleid'];
     if (defined('IN_MOBILE')) {
         showmessage('location_logout_succeed_mobile', dreferer(), array('formhash' => FORMHASH));
     } else {
         showmessage('logout_succeed', dreferer(), array('formhash' => FORMHASH, 'ucsynlogout' => $ucsynlogout));
     }
 }
示例#8
0
 /**
  * 退出登录
  *
  * @author HanPengyu
  * @return 退出登录信息
  */
 public static function logout()
 {
     global $_G;
     require_once libfile('function/member');
     require_once libfile('class/member');
     $ctlObj = new logging_ctl();
     $ctlObj->setting = $_G['setting'];
     clearcookies();
     $_G['groupid'] = $_G['member']['groupid'] = 7;
     $_G['uid'] = $_G['member']['uid'] = 0;
     $_G['username'] = $_G['member']['username'] = $_G['member']['password'] = '';
     $_G['setting']['styleid'] = $ctlObj->setting['styleid'];
     if (empty($_G['uid']) && empty($_G['username'])) {
         $accessToken = (string) $_GET['accessToken'];
         $accessSecret = (string) $_GET['accessSecret'];
         $userId = AppbymeUserAccess::getUserIdByAccess($accessToken, $accessSecret);
         if ($userId) {
             DB::query('DELETE FROM ' . DB::table('common_session') . ' WHERE uid=' . $userId);
         }
     }
     return self::errorInfo(lang('message', 'modcp_logout_succeed'));
 }
示例#9
0
 function api_logout()
 {
     global $_G;
     clearcookies();
     $_G['groupid'] = $_G['member']['groupid'] = 7;
     $_G['uid'] = $_G['member']['uid'] = 0;
     $_G['username'] = $_G['member']['username'] = $_G['member']['password'] = '';
     json_success(t('logout_succeed'));
 }
 function on_logout()
 {
     global $_G;
     $ucsynlogout = $this->setting['allowsynlogin'] ? uc_user_synlogout() : '';
     if ($_GET['formhash'] != $_G['formhash']) {
         showmessage('logout_succeed', dreferer(), array('formhash' => FORMHASH, 'ucsynlogout' => $ucsynlogout));
     }
     clearcookies();
     passport::logout();
     //add
     $_G['groupid'] = $_G['member']['groupid'] = 7;
     $_G['uid'] = $_G['member']['uid'] = 0;
     $_G['username'] = $_G['member']['username'] = $_G['member']['password'] = '';
     $_G['setting']['styleid'] = $this->setting['styleid'];
     showmessage('logout_succeed', dreferer(), array('formhash' => FORMHASH, 'ucsynlogout' => $ucsynlogout));
 }
示例#11
0
function customVerifyCurrent()
{
    if ($_REQUEST['action'] == 'logout') {
        return;
    }
    global $customMainSiteURL;
    global $customCookie;
    global $customCache;
    global $_DCOOKIE;
    //echo MD5(MD5('8458402').'k00wHf');
    /*
    global $uid;
    */
    /*
    global $discuz_pw;
    global $discuz_secques;
    global $discuz_uid;
    global $discuz_user;
    global $discuz_ticket;
    global $adminid,$groupid;
    
    
    printbox(daddslashes(explode("\t", authcode($_DCOOKIE['auth'], 'DECODE')), 1));
    */
    list($discuz_pw, $discuz_secques, $discuz_uid, $lmsh_ticket, $lmsh_version) = empty($_DCOOKIE['auth']) ? array('', '', 0) : daddslashes(explode("\t", authcode($_DCOOKIE['auth'], 'DECODE')), 1);
    //echo $discuz_uid;
    //if($_COOKIE[$customCookie['ticket']]!=''){
    //	echo "COOKIE[LMSH_SID]=".$_COOKIE[$customCookie['ticket']] .",AUTH[LMSH_SID]=".$lmsh_ticket;
    //}
    $selfURL = $_SERVER['PHP_SELF'] . ($_SERVER['QUERY_STRING'] != '' ? '?' . $_SERVER['QUERY_STRING'] : '');
    //$selfURL = $selfURL.(isset($_POST)?((strpos($selfURL,'?')===false?'?':'&').'POSTDATA='.json_encode($_POST)):'');
    if ($_COOKIE[$customCookie['ticket']] == '' && $discuz_uid != 0) {
        require_once DISCUZ_ROOT . './include/misc.func.php';
        require_once DISCUZ_ROOT . './include/login.func.php';
        require_once DISCUZ_ROOT . './uc_client/client.php';
        $ucsynlogout = $allowsynlogin ? uc_user_synlogout() : '';
        clearcookies();
        /*
        global $discuz_uid, $discuz_user, $discuz_pw, $discuz_secques, $adminid, $credits;
        foreach(array('sid', 'auth', 'visitedfid', 'onlinedetail', 'loginuser', 'activationauth', 'indextype') as $k) {
        	dsetcookie($k);
        }
        $discuz_uid = $adminid = $credits = 0;
        $discuz_user = $discuz_pw = $discuz_secques = '';
        */
        //stopPage("123");
        $groupid = 7;
        $discuz_uid = 0;
        $discuz_user = $discuz_pw = '';
        $styleid = $_DCACHE['settings']['styleid'];
        //echo "000";
        //exit();
        //list($discuz_pw, $discuz_secques, $discuz_uid, $lmsh_ticket, $lmsh_version) = empty($_DCOOKIE['auth']) ? array('', '', 0) : daddslashes(explode("\t", authcode($_DCOOKIE['auth'], 'DECODE')), 1);
        //echo $selfURL.'<br>';
        //echo $discuz_uid.'<br>';
        header('Location:' . $selfURL);
    }
    /*
     */
    //updatesession();
    if ($discuz_uid != 0) {
        //echo ",已登录";
        //判断ticket值
        //如果当前的ticket值与登录的ticket值不一致,重新登录
        if ($_COOKIE[$customCookie['ticket']] != '' && $_COOKIE[$customCookie['ticket']] != $lmsh_ticket || $_COOKIE[$customCookie['version']] != '' && $_COOKIE[$customCookie['version']] != $lmsh_version) {
            customExecuteUser(customGetVerifyString());
            //echo "<script>alert('1,$lmsh_ticket');</script>";
            //clearcookies();
            //header("location:./custom/login.php?redirect=".urlencode($selfURL));
        }
    } else {
        if ($_COOKIE[$customCookie['ticket']] != '') {
            //echo ",未登录";
            customExecuteUser(customGetVerifyString());
            //clearcookies();
            //header("location:./custom/login.php?redirect=".urlencode($selfURL));
        }
    }
    //echo "000";
    //echo $discuz_uid;
    if (!$discuz_uid) {
        list($discuz_pw, $discuz_secques, $discuz_uid, $lmsh_ticket, $lmsh_version) = empty($_DCOOKIE['auth']) ? array('', '', 0) : daddslashes(explode("\t", authcode($_DCOOKIE['auth'], 'DECODE')), 1);
    }
    //updatesession();
    //if($_COOKIE[$customCookie['ticket']]!='' && empty($_DCOOKIE['auth'])){
    //echo "<script>alert('1,$discuz_uid');location.href=location.href;</script>";
    //}
    //echo "<script>alert('1,$discuz_uid');</script>";
}