public function do_getopenid() { $weixinopenid = get_session_account(false); }
} if (empty($_GP['third_login'])) { if (empty($_GP['pwd'])) { message("请输入密码!"); } $pwd = md5($_GP['pwd']); } else { $pwd = ''; } $shop_regcredit = intval($cfg['shop_regcredit']); $openid = date("YmdH", time()) . rand(100, 999); $hasmember = mysqld_select("SELECT * FROM " . table('member') . " WHERE openid = :openid ", array(':openid' => $openid)); if (!empty($hasmember['openid'])) { $openid = date("YmdH", time()) . rand(100, 999); } $data = array('mobile' => $_GP['mobile'], 'pwd' => $pwd, 'createtime' => time(), 'status' => 1, 'istemplate' => 0, 'experience' => 0, 'openid' => $openid); mysqld_insert('member', $data); if (!empty($shop_regcredit)) { member_credit($openid, $shop_regcredit, "addcredit", "注册系统赠送积分"); } $member = get_session_account(); $oldsessionid = $member['openid']; $loginid = save_member_login('', $openid); integration_session_account($loginid, $oldsessionid); message('注册成功!', to_member_loginfromurl(), 'success'); } $qqlogin = mysqld_select("SELECT * FROM " . table('thirdlogin') . " WHERE enabled=1 and `code`='qq'"); if (!empty($qqlogin) && !empty($qqlogin['id'])) { $showqqlogin = true; } include themePage('regedit');
function get_member_account($useAccount = true, $mustlogin = false) { if (empty($_SESSION[MOBILE_ACCOUNT]) && $mustlogin) { tosaveloginfrom(); header("location:" . create_url('mobile', array('name' => 'shopwap', 'do' => 'login'))); exit; } if ($mustlogin == true) { return $_SESSION[MOBILE_ACCOUNT]; } if (!empty($_SESSION[MOBILE_ACCOUNT])) { return $_SESSION[MOBILE_ACCOUNT]; } return get_session_account($useAccount); }