/** * [checkcapAction description] * @return [type] [1 成功,10004 手机号未注册] */ public function checkcapAction() { if (!$this->validFlag) { echo json_encode(array('ret' => 0, 'msg' => $this->warnMsg)); } else { $objCaptcha = new Captcha(); $key = 'resetPwd:' . $this->_sanReq['mobile']; $data = $objCaptcha->checkAllCaptcha($this->_sanReq['mobile'], $this->_sanReq['codeImg'], $key, $this->_sanReq['regtype'], $this->_sanReq['captcha']); if ($data == 1) { $user = new User(); $res = $user->existTel($this->_sanReq['mobile']); if (!$res) { echo json_encode(array('ret' => 0, 'msg' => array('email' => array('msg' => $this->di['sysconfig']['flagMsg']['10004'])))); } $token = \Ucenter\Utils\Inputs::makeSecert($this->_sanReq['mobile'], $_SERVER['REQUEST_TIME']); $this->session->set('resetToken', $token); $this->session->set('resetMobile', $this->_sanReq['mobile']); $objCaptcha->delCaptchaRedisKey($key); echo json_encode(array('ret' => 1)); } else { echo json_encode(array('ret' => 0, 'msg' => $data)); } } exit; }
/** * [existTelAction ajax 判断手机号是否已被注册] * @return integer [1存在,0不存在] */ public function existTelAction() { if (!$this->validFlag) { echo json_encode(array('ret' => 0, 'msg' => $this->warnMsg)); exit; } else { $mobile = $this->_sanReq['mobile']; $user = new Users(); $res = $user->existTel($mobile); if ($res == 1) { echo json_encode(array('ret' => 1)); } else { echo json_encode(array('ret' => 0, 'msg' => array('service' => array('msg' => $this->di['sysconfig']['flagMsg']['10004'])))); } $this->view->disable(); return; } }