Ejemplo n.º 1
0
 public function mobilecheck()
 {
     $webname = $this->_cfg['web_name'];
     $title = "验证手机";
     $time = 3000;
     $name = $this->segment(4);
     $member = $this->db->GetOne("SELECT * FROM `@#_member` WHERE `mobile` = '{$name}' LIMIT 1");
     //var_dump($member);exit;
     if (!$member) {
         _message("参数不正确!");
     }
     if ($member['mobilecode'] == 1) {
         _message("该账号验证成功", WEB_PATH . "/mobile/mobile");
     }
     if ($member['mobilecode'] == -1) {
         $sendok = send_mobile_reg_code($name, $member['uid']);
         if ($sendok[0] != 1) {
             _message($sendok[1]);
         }
         header("location:" . WEB_PATH . "/mobile/user/mobilecheck/" . $member['mobile']);
         exit;
     }
     $enname = substr($name, 0, 3) . '****' . substr($name, 7, 10);
     $time = 120;
     include templates("mobile/user", "mobilecheck");
 }
Ejemplo n.º 2
0
 public function mobilecheck()
 {
     $title = "手机认证 - " . _cfg("web_name");
     $check_code = _encrypt($this->segment(4), "DECODE");
     $check_code = @unserialize($check_code);
     if (!$check_code || !isset($check_code['name']) || !isset($check_code['time'])) {
         _message("参数不正确或者验证已过期!", WEB_PATH . '/register');
     }
     $name = $check_code['name'];
     $member = $this->db->GetOne("SELECT * FROM `@#_member` WHERE `reg_key` = '{$check_code['name']}' and `time` = '{$check_code['time']}' LIMIT 1");
     if (!$member) {
         _message("未知的来源!", WEB_PATH . '/register');
     }
     if ($member['mobilecode'] == '1') {
         _message("该账号验证成功", WEB_PATH . "/login");
     }
     if ($member['mobilecode'] == '-1') {
         $sendok = send_mobile_reg_code($member['reg_key'], $member['uid']);
         if ($sendok[0] != 1) {
             _message($sendok[1]);
         }
         header("location:" . WEB_PATH . "/member/user/mobilecheck/" . $this->segment(4));
         exit;
     }
     if (isset($_POST['submit'])) {
         $checkcodes = isset($_POST['checkcode']) ? $_POST['checkcode'] : _message("参数不正确!");
         if (strlen($checkcodes) != 6) {
             _message("验证码输入不正确!");
         }
         $usercode = explode("|", $member['mobilecode']);
         if ($checkcodes != $usercode[0]) {
             _message("验证码输入不正确!");
         }
         $fili_cfg = System::load_app_config("user_fufen");
         if ($member['yaoqing']) {
             $time = time();
             $yaoqinguid = $member['yaoqing'];
             //福分、经验添加
             if ($fili_cfg['f_visituser']) {
                 $this->db->Query("insert into `@#_member_account` (`uid`,`type`,`pay`,`content`,`money`,`time`) values ('{$yaoqinguid}','1','福分','邀请好友奖励','{$fili_cfg['f_visituser']}','{$time}')");
             }
             $this->db->Query("UPDATE `@#_member` SET `score`=`score`+'{$fili_cfg['f_visituser']}',`jingyan`=`jingyan`+'{$fili_cfg['z_visituser']}' where uid='{$yaoqinguid}'");
         }
         $check = $this->db->Query("UPDATE `@#_member` SET mobilecode='1',mobile='{$member['reg_key']}' where `uid`='{$member['uid']}'");
         _message("验证成功", WEB_PATH . "/login");
     }
     $enname = substr($name, 0, 3) . '****' . substr($name, 7, 10);
     $time = 120;
     $namestr = $this->segment(4);
     include templates("user", "mobilecheck");
 }
Ejemplo n.º 3
0
 public function sendmobile()
 {
     $name = $this->segment(4);
     $member = $this->db->GetOne("SELECT * FROM `@#_member` WHERE `mobile` = '{$name}' LIMIT 1");
     if (!$member) {
         //_message("参数不正确!");
         $sendmobile['state'] = 1;
         echo json_encode($sendmobile);
         exit;
     }
     $checkcode = explode("|", $member['mobilecode']);
     $times = time() - $checkcode[1];
     if ($times > 120) {
         $sendok = send_mobile_reg_code($name, $member['uid']);
         if ($sendok[0] != 1) {
             //_message($sendok[1]);exit;
             $sendmobile['state'] = 1;
             echo json_encode($sendmobile);
             exit;
         }
         //成功
         $sendmobile['state'] = 0;
         echo json_encode($sendmobile);
         exit;
     } else {
         $sendmobile['state'] = 1;
         echo json_encode($sendmobile);
         exit;
     }
 }
Ejemplo n.º 4
0
 public function sendmobile()
 {
     $member = $this->userinfo;
     $mobilecodes = rand(100000, 999999) . '|' . time();
     //验证码
     if ($member['mobilecode'] == 1) {
         _message("该账号验证成功", WEB_PATH . "/member/home");
     }
     $checkcode = explode("|", $member['mobilecode']);
     $times = time() - $checkcode[1];
     if ($times > 120) {
         //重发验证码
         $ok = send_mobile_reg_code($member['mobile'], $member['uid']);
         if ($ok[0] != 1) {
             _messagemobile("发送失败,失败状态:" . $ok[1]);
         }
         _messagemobile("正在重新发送...", WEB_PATH . "/mobile/user/mobilecheck/" . _encrypt($member['mobile']), 2);
     } else {
         _messagemobile("重发时间间隔不能小于2分钟!", WEB_PATH . "/mobile/user/mobilecheck/" . _encrypt($member['mobile']));
     }
 }