Example #1
0
 function logout()
 {
     $rets = jsg_member_logout();
     $rets = jsg_member_login_extract();
     header("Location:index.php?mod=member&code=login");
     exit;
 }
Example #2
0
var errorSrc = '<?php 
echo $GLOBALS['_J']['config']['site_url'];
?>
/images/noavatar.gif';
imgObj.src = errorSrc;
}
</script> <script type="text/javascript" src="static/js/min.js?build+20140103"></script> <script type="text/javascript" src="static/js/common.js?build+20140103"></script> <script type="text/javascript" src="static/js/reg.js?build+20140103"></script> <script type="text/javascript" src="static/js/validate.js?build+20140103"></script> <div class="g-hd"> <div class="m-hd"> <h1 class="u-logo"> <a title="<?php 
echo $GLOBALS['_J']['config']['site_name'];
?>
" href="index.php"><img src="images/logo_guest.png" style="_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=crop)"/></a></h1> </div> </div> <style type="text/css">
#username_tip{ margin-left:10px; background-position:0 2px;}
#username_tip img{ margin:2px 0 0 0;}
</style> <div class="g-bd"> <div class="m-tit">
会员登录
</div> <div class="m-box"> <div class="m-box-reg"> <?php 
$login_extract = jsg_member_login_extract();
?>
 <?php 
if ($login_extract && (($login_extract_forms = $login_extract['login_forms']) || ($login_extract_html = $login_extract['login_html']))) {
    ?>
 <?php 
    if ($login_extract_forms) {
        ?>
 <form method="<?php 
        echo $login_extract_forms['method'];
        ?>
" action="<?php 
        echo $login_extract_forms['action'];
        ?>
"> <?php 
        if (is_array($login_extract_forms['hidden_inputs'])) {
Example #3
0
 function MasterObject(&$config)
 {
     require_once ROOT_PATH . 'mobile/include/func/mobile.func.php';
     $config['client_type'] = '';
     $user_agent = $_SERVER['HTTP_USER_AGENT'];
     if (empty($user_agent)) {
         exit('Access Denied');
     }
     $pc_browser = false;
     if (preg_match("/android/i", $user_agent)) {
         $config['client_type'] = "android";
     } else {
         if (preg_match("/iphone/i", $user_agent)) {
             $config['client_type'] = "iphone";
         } else {
             $pc_browser = true;
         }
     }
     $config['is_mobile_client'] = false;
     if (isset($_GET['JSG_SESSION']) && isset($_GET['iv']) && isset($_GET['app_key']) && isset($_GET['app_secret']) && isset($_GET['bt'])) {
         $config['is_mobile_client'] = true;
         define("IS_MOBILE_CLIENT", true);
     }
     define("CLIENT_TYPE", $config['client_type']);
     $config['sys_version'] = sys_version();
     $config['sys_published'] = SYS_PUBLISHED;
     if (!$config['mobile_url']) {
         $config['mobile_url'] = $config['site_url'] . "/mobile";
     }
     if (!$config['topic_length']) {
         $config['topic_length'] = 140;
     }
     $this->Config = $config;
     $this->Config = array_merge($this->Config, Mobile::config());
     define("CHARSET", $this->Config['charset']);
     Obj::register('config', $this->Config);
     $this->Get =& $_GET;
     $this->Post =& $_POST;
     $this->Module = trim($this->Post['mod'] ? $this->Post['mod'] : $this->Get['mod']);
     $this->Code = trim($this->Post['code'] ? $this->Post['code'] : $this->Get['code']);
     $this->DatabaseHandler =& Obj::registry('DatabaseHandler');
     $uid = 0;
     $password = '';
     $authcode = '';
     $implicit_pass = true;
     if (!empty($this->Get['JSG_SESSION']) && $config['is_mobile_client']) {
         $authcode = $this->Get['JSG_SESSION'];
         $authcode = rawurldecode($authcode);
         $implicit_pass = false;
     } else {
         $authcode = jsg_getcookie('auth');
     }
     if (!empty($authcode)) {
         list($password, $uid) = explode("\t", authcode($authcode, 'DECODE'));
     }
     $this->MemberHandler = jclass('member');
     $MemberFields = $this->MemberHandler->FetchMember($uid, $password);
     if ($this->MemberHandler->HasPermission($this->Module, $this->Code) == false) {
         Mobile::show_message(411);
         exit;
     }
     if (!in_array($this->Module, array('member', 'login', 'wechat'))) {
         $visit_rets = $this->MemberHandler->visit();
         if ($visit_rets['error']) {
             Mobile::show_message(411);
             exit;
         }
     }
     $this->Title = $this->MemberHandler->CurrentAction['name'];
     Obj::register("MemberHandler", $this->MemberHandler);
     $rets = jsg_member_login_extract();
     if ($rets) {
         if (MEMBER_ID < 1) {
             $func = $rets['login_direct'];
         } else {
             $func = $rets['logout_direct'];
         }
         if ($func && function_exists($func)) {
             $ret = $func();
         }
     }
     if (MEMBER_ID > 0) {
         jsg_member_login_set_status($MemberFields);
     }
     if ($this->Config['extcredits_enable']) {
         if (MEMBER_ID > 0 && jsg_getcookie('login_credits') + 3600 < time()) {
             update_credits_by_action('login', MEMBER_ID);
             jsg_setcookie('login_credits', time(), 3600);
         }
     }
 }
Example #4
0
 function LogOut()
 {
     $msg = null;
     $time = 0;
     $to = '?';
     $rets = jsg_member_logout();
     if ($rets['uc_syn_html']) {
         $msg = "退出成功{$rets['uc_syn_html']}";
         $time = 3;
     }
     $rets = jsg_member_login_extract();
     if ($rets && $rets['logout_url']) {
         $to = $rets['logout_url'];
     }
     $this->Messager($msg, $to, $time);
 }