Пример #1
0
 public function ajaxSubmitAction()
 {
     $resetTicket = Request::getPOST('reset-ticket');
     $password = Request::getPOST('password');
     if (empty($password) || empty($resetTicket)) {
         $this->renderAjax(1, '参数错误!');
     }
     if (strlen($password) < 6 || strlen($password) > 30) {
         $this->renderAjax(1, '密码长度为6-30位!');
     }
     $userInfo = UcAuthInterface::getUserInfoByResetTicket(array('reset_ticket' => $resetTicket));
     if (empty($userInfo)) {
         $this->renderAjax(1, '你的操作已经过期,请重新操作!');
     }
     // 修改密码
     UcUserInterface::save(array('id' => $userInfo['id'], 'password' => $password));
     // 删除reset ticket
     UcAuthInterface::deleteResetTicket(array('reset_ticket' => $resetTicket));
     UcUserInterface::logout();
     $this->renderAjax(0);
 }
Пример #2
0
 public function ajaxSubmitAction()
 {
     $email = Request::getPOST('email');
     $checkCode = Request::getPOST('check-code');
     $verify = Request::getPOST('verify');
     if (empty($email) || empty($verify) || empty($checkCode)) {
         $this->renderAjax(1, '请填写信息!');
     }
     // 校验验证码
     $imgCode = Session::get('check_code');
     if (strtolower($verify) != $imgCode) {
         $this->renderAjax(2, '图片验证码错误!');
     }
     $check = UcAuthInterface::checkEmailCode(array('email' => $email, 'code' => $checkCode));
     if (false === $check) {
         $this->renderAjax(1, '邮箱验证码错误!');
     }
     // 删除email code
     UcAuthInterface::deleteEmailCode(array('email' => $email));
     // reset ticket
     $resetTicket = UcAuthInterface::makeResetTicket(array('login_name' => $email));
     $this->renderAjax(0, 'Success', array('resetTicket' => $resetTicket));
 }
 public static function deleteEmailCode($params)
 {
     return UcAuthInterface::deleteEmailCode($params);
 }