Пример #1
0
 /**
  * 忘记密码
  * @return unknown_type
  */
 function forgot()
 {
     if ($_POST) {
         $gets['realname'] = $_POST['realname'];
         $gets['username'] = $_POST['email'];
         $gets['mobile'] = $_POST['mobile'];
         $gets['select'] = 'id';
         $ul = $this->model->UserInfo->gets($gets);
         if (count($ul) != 0) {
             $password = App\Func::randomkeys(6);
             $this->model->UserInfo->set($ul[0]['id'], array('password' => Auth::mkpasswd($gets['username'], $password)));
             App\Func::success('找回成功!', '您的新密码是 <span style="color:#fe7e00;">' . $password . '</a>');
         }
     } else {
         $this->swoole->tpl->display();
     }
 }