'); //开启论坛接口 include './bbsapi/config.inc.php'; include './bbsapi/uc_client/client.php'; $cfg_dbhost="localhost"; $cfg_dbname="game021bbsdb"; $cfg_dbuser="game021"; $cfg_dbpwd="game021~2222"; include 'class.mysql.php'; ?> account_check($email); //print($result['data']['error']); //exit(); if($result['data']['error'] == 1) { ShowMsg("该 Email 已经被注册!",-1); exit(); } //检查论坛是否邮箱重复 $ucresult = uc_user_checkemail($email); if($ucresult > 0) { //echo 'Email 格式正确'; //exit(); } elseif($ucresult == -4) { ShowMsg("Email 格式有误!",-1); exit(); } elseif($ucresult == -5) { ShowMsg('Email 不允许注册'); exit(); } elseif($ucresult == -6) { ShowMsg("该 Email 已经被注册!",-1); exit(); } //检查论坛是否用户名重复 $ucresult = uc_user_checkname($name); if($ucresult > 0) { //echo '用户名可用'; //exit(); } elseif($ucresult == -1) { ShowMsg('用户名不合法'); exit(); } elseif($ucresult == -2) { ShowMsg('包含要允许注册的词语'); exit(); } elseif($ucresult == -3) { ShowMsg("用户名已经存在!",-1); exit(); } //exit(); 先不注册------------------------------------------------------------------------------- //$result['data'] = 1; //强行测试 $result = $sdk_request_handle->account_register($_REQUEST['email'], $_REQUEST['pwd']); //print($result['data']); //exit(); if($result['data']['error'] === 0) { //print("注册成功!"); //论坛也得注册 //$uid = 1; //test------------------------------------------------------------------------------- $uid = uc_user_register($name, $pwd, $email); //print($uid); if($uid <= 0) { if($uid == -1) { ShowMsg('用户名不合法',-1); } elseif($uid == -2) { ShowMsg('包含要允许注册的词语',-1); } elseif($uid == -3) { ShowMsg('用户名已经存在',-1); } elseif($uid == -4) { ShowMsg('Email 格式有误',-1); } elseif($uid == -5) { ShowMsg('Email 不允许注册',-1); } elseif($uid == -6) { ShowMsg('该 Email 已经被注册',-1); } else { ShowMsg('未定义',-1); } } else { $username = uc_addslashes($name); $email = uc_addslashes($email); $pwd = md5(rand(1,999)); $time = time(); } //print("=11111111111================================"); $db->runsql("INSERT INTO pre_common_member (uid,email,username,password,groupid,adminid,regdate,credits,timeoffset,newprompt) VALUES ('$uid','$email','$username','$pwd','10','0','$time','2','9999','0')"); // //pre_common_member_count $sql = "INSERT INTO pre_common_member_count (`uid` ,`extcredits2` ) VALUES ('$uid', '2');"; $db->runsql($sql); $sql = "INSERT INTO pre_common_member_field_forum (`uid`, `publishfeed`, `customshow`, `customstatus`, `medals`, `sightml`, `groupterms`, `authstr`, `groups`, `attentiongroup`) VALUES ('$uid', '0', '26', '', '', '', '', '', '', '');"; $db->runsql($sql); $sql = "INSERT INTO pre_common_member_field_home (`uid`, `videophoto`, `spacename`, `spacedescription`, `domain`, `addsize`, `addfriend`, `menunum`, `theme`, `spacecss`, `blockposition`, `recentnote`, `spacenote`, `privacy`, `feedfriend`, `acceptemail`, `magicgift`, `stickblogs`) VALUES ('$uid', '', '', '', '', '0', '0', '0', '', '', '', '', '', '', '', '', '', '');"; $db->runsql($sql); $sql = "INSERT INTO pre_common_member_profile (`uid`, `realname`, `gender`, `birthyear`, `birthmonth`, `birthday`, `constellation`, `zodiac`, `telephone`, `mobile`, `idcardtype`, `idcard`, `address`, `zipcode`, `nationality`, `birthprovince`, `birthcity`, `birthdist`, `birthcommunity`, `resideprovince`, `residecity`, `residedist`, `residecommunity`, `residesuite`, `graduateschool`, `company`, `education`, `occupation`, `position`, `revenue`, `affectivestatus`, `lookingfor`, `bloodtype`, `height`, `weight`, `alipay`, `icq`, `qq`, `yahoo`, `msn`, `taobao`, `site`, `bio`, `interest`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`) VALUES ('$uid', '', '0', '0', '0', '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');"; $db->runsql($sql); $temptime = time(); $regip = get_real_ip(); $lastvisit = get_real_ip(); $sql = "INSERT INTO pre_common_member_status (`uid`, `regip`, `lastip`, `lastvisit`, `lastactivity`, `lastpost`, `lastsendmail`, `invisible`, `buyercredit`, `sellercredit`, `favtimes`, `sharetimes`, `profileprogress`) VALUES ('$uid', '$regip', '$lastvisit', '$temptime', '$temptime', '0', '0', '0', '0', '0', '0', '0', '0');"; $db->runsql($sql); //pre_common_member_field_forum //pre_common_member_field_home //pre_common_member_profile //pre_common_member_status //print("==2222222222222==============================="); //同步登陆 list($uid, $username, $password, $email) = uc_user_login($_REQUEST['name'], $_REQUEST['pwd']); //print($uid); setcookie('Example_auth', '', -86400); if($uid > 0) { //if(!$db->result_first("SELECT count(*) FROM {$tablepre}member WHERE uid='$uid'")) { //判断用户是否存在于用户表,不存在则跳转到激活页面 // $auth = rawurlencode(uc_authcode("$username\t".time(), 'ENCODE')); // echo '您需要需要激活该帐号,才能进入本应用程序
继续'; // exit; //} //用户登陆成功,设置 Cookie,加密直接用 uc_authcode 函数,用户使用自己的函数 setcookie('Example_auth', uc_authcode($uid."\t".$username, 'ENCODE')); //生成同步登录的代码 $ucsynlogin = uc_user_synlogin($uid); // echo '登录成功'.$ucsynlogin.'
继续'; //print("注册成功!"); $_SESSION['islog'] = 1; //登陆中心平台 $_SESSION['name'] = $username; ShowMsg("注册成功!","http://bbs.youxi021.com"); print($ucsynlogin); /* print(" "); */ exit; } elseif($uid == -1) { // echo '用户不存在,或者被删除'; } elseif($uid == -2) { // echo '密码错'; } else { // echo '未定义'; } //注册成功,设置 Cookie,加密直接用 uc_authcode 函数,用户使用自己的函数 setcookie('Example_auth', uc_authcode($uid."\t".$username, 'ENCODE')); //echo '注册成功
继续'; //exit; exit(); } else { //print("注册失败!"); ShowMsg("注册失败!",-1); exit(); } } catch (SDKException $e) { die($e->getMessage() . "\n"); } catch (Exception $e) { die($e->getMessage() . "\n"); } } else if($_REQUEST['do'] == "logon") { //print($_SESSION['dd_ckstr']); //print($_REQUEST['vdcode']); //exit(); if(strtolower($_SESSION['dd_ckstr']) != strtolower($_REQUEST['vdcode'])) { ShowMsg("验证码不正确!",-1); exit(); } //1,首先用email 查询中心平台是否存在当前用户,如果存在。 //2,用email查询论坛是否注册,如果没注册,则让他填写一个昵称,然后取得session中的密码,加他的邮箱,在论坛注册一个账号即可 /************************************************************** 登陆中心服务器平台 ***************************************************************/ $config = include './config.php'; include './sdk.php'; try { $sdk_request_handle = new SDKRequest($config['app_id'], $config['app_secret']); $email = $_REQUEST['email']; $pwd = $_REQUEST['pwd']; //$result['data'] = 1; ////强制测试 $result = $sdk_request_handle->account_login($email, $pwd); //print_r($result); //print($result['ret']); //exit(); if($result['data']['error'] == 1 || $result['data']['error'] == 2 || $result['data']['error'] == 3) { ShowMsg("邮箱或密码错误,请重试!",-1); exit(); } else if($result['data']['error'] === 0 ){ //判断用户是否存在,存在强制改一下密码 $ucresult = uc_user_checkemail($_REQUEST['email']); if($ucresult == -6) { $user = $db->GetOne("select username from pre_common_member where email ='".uc_addslashes($_REQUEST['email'])."'"); //print_r($user); //exit(); uc_user_edit($user['username'] , "" , $_REQUEST['pwd'] , $_REQUEST['email'] ,1); list($uid, $username, $password, $email) = uc_user_login($_REQUEST['email'], $_REQUEST['pwd'],2); } //1,------uc_user_login($email,$pwd,2); //如果没有,跳转到起个新名字的界面,你好第一次进入论坛需要起个名字 list($uid, $username, $password, $email) = uc_user_login($_REQUEST['email'], $_REQUEST['pwd'],2); $_SESSION['username'] = $username; //print($uid); //print($email); if($uid == -1) { //论坛中不存在,跳转 $_SESSION['pwd'] = $pwd; $_SESSION['email'] = $_POST['email']; //print("2"); //header("location:login.php?html=rename"); //print("您好,第一次进入论坛需要起个名字!"); ShowMsg("您好,手机注册用户第一次进入论坛需要起个名字!","login.php?html=htmlrename"); /* print(" "); */ //print("window.location.href='wwww.163.com'"); exit(); } else if($uid > 0){ //强制修改一下密码 //list($uid, $username, $password, $email) = uc_user_login($email, $pwd,2); setcookie('Example_auth', '', -86400); if($uid > 0) { //错误数据校正 $row = $db->queryline("SELECT * FROM `pre_common_member_status` where uid = $uid"); if($row['uid'] < 1) { $sql = "INSERT INTO pre_common_member_count (`uid` ,`extcredits2` ) VALUES ('$uid', '2');"; $db->runsql($sql); //} $sql = "INSERT INTO pre_common_member_field_forum (`uid`, `publishfeed`, `customshow`, `customstatus`, `medals`, `sightml`, `groupterms`, `authstr`, `groups`, `attentiongroup`) VALUES ('$uid', '0', '26', '', '', '', '', '', '', '');"; $db->runsql($sql); $sql = "INSERT INTO pre_common_member_field_home (`uid`, `videophoto`, `spacename`, `spacedescription`, `domain`, `addsize`, `addfriend`, `menunum`, `theme`, `spacecss`, `blockposition`, `recentnote`, `spacenote`, `privacy`, `feedfriend`, `acceptemail`, `magicgift`, `stickblogs`) VALUES ('$uid', '', '', '', '', '0', '0', '0', '', '', '', '', '', '', '', '', '', '');"; $db->runsql($sql); $sql = "INSERT INTO pre_common_member_profile (`uid`, `realname`, `gender`, `birthyear`, `birthmonth`, `birthday`, `constellation`, `zodiac`, `telephone`, `mobile`, `idcardtype`, `idcard`, `address`, `zipcode`, `nationality`, `birthprovince`, `birthcity`, `birthdist`, `birthcommunity`, `resideprovince`, `residecity`, `residedist`, `residecommunity`, `residesuite`, `graduateschool`, `company`, `education`, `occupation`, `position`, `revenue`, `affectivestatus`, `lookingfor`, `bloodtype`, `height`, `weight`, `alipay`, `icq`, `qq`, `yahoo`, `msn`, `taobao`, `site`, `bio`, `interest`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`) VALUES ('$uid', '', '0', '0', '0', '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');"; $db->runsql($sql); $temptime = time(); $regip = get_real_ip(); $lastvisit = get_real_ip(); $sql = "INSERT INTO pre_common_member_status (`uid`, `regip`, `lastip`, `lastvisit`, `lastactivity`, `lastpost`, `lastsendmail`, `invisible`, `buyercredit`, `sellercredit`, `favtimes`, `sharetimes`, `profileprogress`) VALUES ('$uid', '$regip', '$lastvisit', '$temptime', '$temptime', '0', '0', '0', '0', '0', '0', '0', '0');"; $db->runsql($sql); } //用户登陆成功,设置 Cookie,加密直接用 uc_authcode 函数,用户使用自己的函数 setcookie('Example_auth', uc_authcode($uid."\t".$username, 'ENCODE')); //生成同步登录的代码 $ucsynlogin = uc_user_synlogin($uid); //echo '登录成功'.$ucsynlogin.'
继续'; $_SESSION['islog'] = 1; //登陆中心平台 $_SESSION['name'] = $username; ShowMsg($username.'欢迎回来',"http://bbs.youxi021.com"); print($ucsynlogin); exit(); /* print(" "); */ // print("欢迎你回来!");//--------------------------------------------------- // exit; } elseif($uid == -1) { ShowMsg('用户不存在,或者被删除',-1); exit; } elseif($uid == -2) { ShowMsg('密码错',-1); exit; } else { ShowMsg('未定义',-1); exit; } } else if($uid == -2) { ShowMsg('密码错',-1); } //exit(); } else { //print($result['data']); ShowMsg("系统错误,请重试!",-1); exit(); } } catch (SDKException $e) { die($e->getMessage() . "\n"); } catch (Exception $e) { die($e->getMessage() . "\n"); } } else if($_REQUEST['do'] == "exit") { $_SESSION['islog'] = -2; setcookie('Example_auth', '', -86400); $ucsynlogout = uc_user_synlogout(); ShowMsg("您已经安全退出!","http://zgzd.youxi021.com/"); print($ucsynlogout); exit(); } else if($_REQUEST['do'] == "newname") { $email = $_SESSION['email']; $pwd = $_SESSION['pwd']; $name = $_REQUEST['name']; //print($email); $ucresult = uc_user_checkname($name); if($ucresult > 0) { } elseif($ucresult == -1) { ShowMsg('用户名不合法',-1); exit(); } elseif($ucresult == -2) { ShowMsg('包含要允许注册的词语',-1); exit(); } elseif($ucresult == -3) { ShowMsg('用户名已经存在',-1); exit(); } $uid = uc_user_register($name, $pwd, $email); if($uid <= 0) { if($uid == -1) { ShowMsg('用户名不合法',-1); } elseif($uid == -2) { ShowMsg('包含要允许注册的词语',-1); } elseif($uid == -3) { ShowMsg('用户名已经存在',-1); } elseif($uid == -4) { ShowMsg('Email 格式有误',-1); } elseif($uid == -5) { ShowMsg('Email 不允许注册',-1); } elseif($uid == -6) { ShowMsg('该 Email 已经被注册',-1); } else { ShowMsg('未定义',-1); } } else { $username = uc_addslashes($name); $email = uc_addslashes($email); $pwd = md5(rand(1,999)); $time = time(); } //------------------------------------------------------------------------------- 这一步 无法连接数据库则无法激活 //print("INSERT INTO pre_common_member (uid,email,username,password,groupid,adminid,regdate,credits,timeoffset,newprompt) VALUES ('$uid','$email','$username','$pwd','10','0','$time','2','9999','0')"); //exit(); $db->runsql("INSERT INTO pre_common_member (uid,email,username,password,groupid,adminid,regdate,credits,timeoffset,newprompt) VALUES ('$uid','$email','$username','$pwd','10','0','$time','2','9999','0')"); $sql = "INSERT INTO pre_common_member_count (`uid` ,`extcredits2` ) VALUES ('$uid', '2');"; $db->runsql($sql); $sql = "INSERT INTO pre_common_member_field_forum (`uid`, `publishfeed`, `customshow`, `customstatus`, `medals`, `sightml`, `groupterms`, `authstr`, `groups`, `attentiongroup`) VALUES ('$uid', '0', '26', '', '', '', '', '', '', '');"; $db->runsql($sql); $sql = "INSERT INTO pre_common_member_field_home (`uid`, `videophoto`, `spacename`, `spacedescription`, `domain`, `addsize`, `addfriend`, `menunum`, `theme`, `spacecss`, `blockposition`, `recentnote`, `spacenote`, `privacy`, `feedfriend`, `acceptemail`, `magicgift`, `stickblogs`) VALUES ('$uid', '', '', '', '', '0', '0', '0', '', '', '', '', '', '', '', '', '', '');"; $db->runsql($sql); $sql = "INSERT INTO pre_common_member_profile (`uid`, `realname`, `gender`, `birthyear`, `birthmonth`, `birthday`, `constellation`, `zodiac`, `telephone`, `mobile`, `idcardtype`, `idcard`, `address`, `zipcode`, `nationality`, `birthprovince`, `birthcity`, `birthdist`, `birthcommunity`, `resideprovince`, `residecity`, `residedist`, `residecommunity`, `residesuite`, `graduateschool`, `company`, `education`, `occupation`, `position`, `revenue`, `affectivestatus`, `lookingfor`, `bloodtype`, `height`, `weight`, `alipay`, `icq`, `qq`, `yahoo`, `msn`, `taobao`, `site`, `bio`, `interest`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`) VALUES ('$uid', '', '0', '0', '0', '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');"; $db->runsql($sql); $temptime = time(); $regip = get_real_ip(); $lastvisit = get_real_ip(); $sql = "INSERT INTO pre_common_member_status (`uid`, `regip`, `lastip`, `lastvisit`, `lastactivity`, `lastpost`, `lastsendmail`, `invisible`, `buyercredit`, `sellercredit`, `favtimes`, `sharetimes`, `profileprogress`) VALUES ('$uid', '$regip', '$lastvisit', '$temptime', '$temptime', '0', '0', '0', '0', '0', '0', '0', '0');"; $db->runsql($sql); //print("wwwwwwwwwwwwwwwwww"); //exit(); //同步登陆 list($uid, $username, $password, $email) = uc_user_login($_SESSION['email'],$_SESSION['pwd'],2); setcookie('Example_auth', '', -86400); if($uid > 0) { //if(!$db->result_first("SELECT count(*) FROM {$tablepre}member WHERE uid='$uid'")) { //判断用户是否存在于用户表,不存在则跳转到激活页面 // $auth = rawurlencode(uc_authcode("$username\t".time(), 'ENCODE')); // echo '您需要需要激活该帐号,才能进入本应用程序
继续'; // exit; //} //用户登陆成功,设置 Cookie,加密直接用 uc_authcode 函数,用户使用自己的函数 setcookie('Example_auth', uc_authcode($uid."\t".$username, 'ENCODE')); //生成同步登录的代码 $ucsynlogin = uc_user_synlogin($uid); ShowMsg($username.'战国之道论坛欢迎您',"http://bbs.youxi021.com"); print($ucsynlogin); //注册成功,设置 Cookie,加密直接用 uc_authcode 函数,用户使用自己的函数 setcookie('Example_auth', uc_authcode($uid."\t".$username, 'ENCODE')); $_SESSION['islog'] = 1; $_SESSION['name'] = $_REQUEST['name']; /* print(" "); */ //echo '注册成功
继续'; exit; } elseif($uid == -1) { // echo '用户不存在,或者被删除'; } elseif($uid == -2) { // echo '密码错'; } else { // echo '未定义'; } exit(); } function ShowMsg($msg,$gourl,$onlymsg=0,$limittime=0) { if(empty($GLOBALS['cfg_phpurl'])) $GLOBALS['cfg_phpurl'] = '..'; $htmlhead = "\r\n\r\n系统提示信息\r\n\r\n"; $htmlhead .= "\r\n\r\n".(isset($GLOBALS['ucsynlogin']) ? $GLOBALS['ucsynlogin'] : '')."\r\n
\r\n\r\n
\r\n\r\n\r\n"; $litime = ($limittime==0 ? 2500 : $limittime); $func = ''; if($gourl=='-1') { if($limittime==0) $litime = 5000; $gourl = "javascript:history.go(-1);"; } if($gourl=='' || $onlymsg==1) { $msg = ""; } else { //当网址为:close::objname 时, 关闭父框架的id=objname元素 if(eregi('close::',$gourl)) { $tgobj = trim(eregi_replace('close::', '', $gourl)); $gourl = 'javascript:;'; $func .= "window.parent.document.getElementById('{$tgobj}').style.display='none';\r\n"; } $func .= " var pgo=0; function JumpUrl(){ if(pgo==0){ location='$gourl'; pgo=1; } }\r\n"; $rmsg = $func; $rmsg .= "document.write(\"
"; $rmsg .= "
系统提示信息!
\");\r\n"; $rmsg .= "document.write(\"

\");\r\n"; $rmsg .= "document.write(\"".str_replace("\"","“",$msg)."\");\r\n"; $rmsg .= "document.write(\""; if($onlymsg==0) { if( $gourl != 'javascript:;' && $gourl != '') { $rmsg .= "
如果你的浏览器没反应,请点击这里..."; $rmsg .= "
\");\r\n"; $rmsg .= "setTimeout('JumpUrl()',$litime);"; } else { $rmsg .= "
\");\r\n"; } } else { $rmsg .= "

\");\r\n"; } $msg = $htmlhead.$rmsg.$htmlfoot; } echo $msg; //exit(); } function get_real_ip(){ $ip=false; if(!empty($_SERVER["HTTP_CLIENT_IP"])){ $ip = $_SERVER["HTTP_CLIENT_IP"]; } if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ips = explode (", ", $_SERVER['HTTP_X_FORWARDED_FOR']); if ($ip) { array_unshift($ips, $ip); $ip = FALSE; } for ($i = 0; $i < count($ips); $i++) { if (!eregi ("^(10|172\.16|192\.168)\.", $ips[$i])) { $ip = $ips[$i]; break; } } } return ($ip ? $ip : $_SERVER['REMOTE_ADDR']); } ?> 登陆
上海际动网络科技有限公司
玩家交流QQ群: 74462435
用户中心
您现在的位置: 首页 > 用户中心 >

邮箱:  
论坛昵称:  
密码:  
确认密码:  
验证码:  
邮箱:  
密码:  
验证码:  
 
您好首次登入论坛需要一个新的昵称   
新昵称: