Esempio n. 1
0
 public function sendphonecodex()
 {
     $p = text($_POST['phone']);
     $c = M('members')->where("user_phone='{$p}'")->count('id');
     $needcheck = checkNeedCheck($p);
     if ($needcheck) {
         if ($c > 0) {
             ajaxmsg('', 2);
         }
     }
     $r = Notice(4, $this->uid, array('phone' => $p));
     if (C('SMS_TYPE') == "SIMU") {
         ajaxmsg($r, -1);
         return;
     }
     if ($r) {
         ajaxmsg();
     } else {
         ajaxmsg('', 0);
     }
 }
Esempio n. 2
0
 public function sendphone()
 {
     $smsTxt = FS("Webconfig/smstxt");
     $smsTxt = de_xie($smsTxt);
     $phone = text($_POST['cellphone']);
     $pre = C('DB_PREFIX');
     $cur_mem = M("members")->alias("m")->join("left join {$pre}members_status ms on m.id=ms.uid")->join("left join {$pre}members mb on m.bind_uid=mb.id")->field("m.bind_uid, ms.phone_status,mb.user_name bind_username,m.pin_pass")->where(array("m.id" => $this->uid))->find();
     $needcheck = checkNeedCheck($phone);
     if ($needcheck && empty($cur_mem['bind_username'])) {
         $xuid = M('members')->getFieldByUserPhone($phone, 'id');
         if ($xuid > 0 && $xuid != $this->uid) {
             ajaxmsg($cur_mem['bind_username'], 2);
         }
     }
     $code = rand_string($this->uid, 6, 1, 2);
     $content = str_replace(array("#UserName#", "#CODE#"), array(session('u_user_name'), $code), $smsTxt['verify_phone']);
     //判断是否为模拟短信
     if (C('SMS_TYPE') == "SIMU") {
         session("temp_phone", $phone);
         ajaxmsg($content, -1);
         return;
     } else {
         $res = sendsms($phone, $content);
     }
     if ($res) {
         session("temp_phone", $phone);
         ajaxmsg();
     } else {
         ajaxmsg("", 0);
     }
 }