示例#1
0
 public function sendMails($uid, $toMailAdr)
 {
     $secert = \Ucenter\Utils\Encrypt::authcode($uid, 'ENCODE');
     $res = $this->emailVerify->innserEmailVerify($uid, $toMailAdr, $secert);
     $emailTplPath = dirname(dirname(__FILE__)) . '/webpc/views/Template/email.html';
     $emailTpl = file_get_contents($emailTplPath);
     $urlCode = $this->di['sysconfig']['emailValidurl'] . '?token=' . rawurlencode($secert);
     $RedisLib = new \Ucenter\Utils\RedisLib($this->di);
     $redis = $RedisLib::getRedis();
     $redis->lPush('mail_verify', array('mail_address' => $toMailAdr, 'mail_verify_code' => $urlCode));
     return true;
 }
 /**
  * [validemailAction 邮件验证]
  * @return [type] [description]
  */
 public function validemailAction()
 {
     $emailVerify = new EmailVerify($this->di);
     if (!$this->validFlag) {
         echo $this->warnMsg;
     } else {
         if (empty($this->session->get('uid'))) {
             $backurl = $this->di['sysconfig']['domain'] . '/mailverify/validemail?token=' . $this->_sanReq['token'];
             $this->response->redirect($this->di['sysconfig']['domain'] . '/login?bakcurl=' . $backurl);
         }
         $uid = \Ucenter\Utils\Encrypt::authcode($this->_sanReq['token'], 'DECODE');
         // $user = new User();
         // $userinfo = $user->getUserInfo($uid);
         $res = $emailVerify->validemail($uid, $this->_sanReq['token'], $_SERVER['REQUEST_TIME']);
         $this->showMsg($this->di['sysconfig']['domain'] . '/user/index', $this->di['sysconfig']['emailMsg'][$res], '用户中心', $res);
     }
 }