Example #1
0
 /**
  * 发送验证码
  * @return [type] [description]
  */
 public function captchaAction()
 {
     $captchaObj = new Captcha();
     if ($this->_sanReq['type'] == '3') {
         $userInfo = $this->_getToken($this->_sanReq['token']);
         if (isset($this->_sanReq['baby_id'])) {
             $babyId = $this->_sanReq['baby_id'];
         } else {
             $this->_showMsg((string) self::INVALID_OPERATE, $this->di['flagmsg'][self::INVALID_OPERATE]);
         }
     } else {
         $babyId = '';
     }
     $res = $captchaObj->makeCaptcha($this->_sanReq['type'], $this->_sanReq['mobi'], $babyId);
     if ($res === self::SUCCESS) {
         $this->_showMsg((string) $res);
     } else {
         $this->_showMsg((string) $res, $this->di['flagmsg'][$res]);
     }
 }
Example #2
0
 /**
  * 修改密码
  * @return [type] [description]
  */
 public function changeAction()
 {
     $userInfo = $this->_getToken($this->_sanReq['token']);
     $captchaObj = new Captcha();
     $captchaResult = $captchaObj->checkCaptcha($userInfo['mobi'], 9, $this->_sanReq['captcha'], $_SERVER['REQUEST_TIME']);
     if ($captchaResult != 1) {
         $this->_showMsg($captchaResult, $this->di['flagmsg'][$captchaResult]);
     }
     if (($resetRes = $this->user->changePass($userInfo['mobi'], $this->_sanReq['passnew'], $userInfo['regtime'])) == 1) {
         $this->_showMsg('1');
     } else {
         $this->_showMsg($resetRes, $this->di['flagmsg'][$resetRes]);
     }
 }