public function sendEmailValidationAction() { //send validation email $registerService = new PwRegisterService(); $info = $this->loginUser->info; if (false == $registerService->checkIfActiveEmailSend($info['uid'], $info['email'])) { $this->sendEmailActive($info['username'], $info['email'], $statu, $info['uid']); } else { $this->sendEmailActive($info['username'], $info['email']); } $returnData = array("success" => true, "data" => 更新成功); print_r(json_encode($returnData)); die; }
/** * 发送激活邮箱 */ public function sendActiveEmailAction() { $statu = $this->checkRegisterUser(); if (!Pw::getstatus($this->loginUser->info['status'], PwUser::STATUS_UNACTIVE)) { $this->setOutput('activeEmail', 'type'); $this->setTemplate('register_about'); return; } $registerService = new PwRegisterService(); $info = $this->loginUser->info; if (false == $registerService->checkIfActiveEmailSend($info['uid'], $info['email'])) { $registerService->sendEmailActive($info['username'], $info['email'], $statu, $info['uid']); } $mailList = array('gmail.com' => 'google.com'); list(, $mail) = explode('@', $info['email'], 2); $gotoEmail = 'http://mail.' . (isset($mailList[$mail]) ? $mailList[$mail] : $mail); $this->setOutput($info['email'], 'email'); $this->setOutput($info['username'], 'username'); $this->setOutput($gotoEmail, 'gotoEmail'); $this->setOutput($statu, '_statu'); $this->setOutput($this->getInput('from'), 'from'); $this->setTemplate('register_emailactive'); }