示例#1
0
 /**
  * [accountBindAction 获取用户绑定的第三方信息]
  * @return [type] [description]
  */
 public function accountBindAction()
 {
     $this->view->setVar('pageTitle', '账号绑定');
     $users = new Users();
     if ($this->session->has('uid')) {
         $userinfo = $users->getUserInfo($this->session->get('uid'));
         $this->view->setVars(array('userinfo' => $userinfo));
     }
 }
示例#2
0
 /**
  * [changeAction 输入新邮箱]
  * @return [type] [description]
  */
 public function changeAction()
 {
     $this->view->setVar('pageTitle', '更改邮箱');
     if (empty($this->session->get('emailToken'))) {
         $this->response->redirect('email/index');
     }
     $user = new User();
     $userinfo = $user->getUserInfo($this->session->get('uid'));
     $this->view->setVars(array('userinfo' => $userinfo));
 }
示例#3
0
 /**
  * [sendMailAction 发送邮件]
  * @return [type] [description]
  */
 public function sendMailAction()
 {
     if (!$this->validFlag) {
         echo json_encode(array('ret' => 0, 'msg' => $this->warnMsg));
     } else {
         if (isset($this->_sanReq['mobile'])) {
             $email = $this->_sanReq['email'];
         } else {
             $user = new User();
             $userinfo = $user->getUserInfo($this->session->get('uid'));
             $email = $userinfo['u_email'];
         }
         $Service = new Service($this->di);
         $Service->sendMails($this->session->get('uid'), $email);
         echo json_encode(array('ret' => 1));
     }
     exit;
 }
示例#4
0
 private function _autoLogin()
 {
     if (empty($this->session->get('uid'))) {
         $key = substr(md5($this->di['sysconfig']['siteUrl']), 5, 15);
         if ($this->cookies->has($key)) {
             $val = explode(':', base64_decode($this->cookies->get($key)));
             $uid = base64_decode($val[1]);
             $time = base64_decode($val[2]);
             $user = new Users();
             $userInfo = $user->getUserInfo($uid);
             if ($time == $userInfo['u_last_logintime']) {
                 if ($val[0] === substr(md5($userInfo['u_mobi']), 8, 20)) {
                     $this->session->set('uid', $userInfo['u_id']);
                     $this->session->set('uinfo', array('name' => $userInfo['u_name'], 'mobile' => $userInfo['u_mobi']));
                     $this->response->redirect('user/index');
                 }
             }
         }
     } else {
         $this->response->redirect('user/index');
     }
 }