public function forgotpasswordAction() { $configs = Gio_Core_Config_Xml::getConfig('web'); $this->setTemplate($configs->admin->template); $this->setLayout('forgotpassword'); $request = $this->getRequest(); if ($request->isPost()) { $email = $request->getPost('email'); if (!$email) { $this->view->error = $this->view->TRANSLATOR->translator('user_forgotpassword_email_notnull'); return; } $user = Modules_Core_Services_User::checkEmailExist($email); if (null == $user) { $this->view->error = $this->view->TRANSLATOR->translator('user_forgotpassword_email_notexist'); return; } $code = Gio_Core_String::generateString(50); $user['code'] = $code; Modules_Core_Services_User::update($user); Modules_Core_Services_User::sendPassword($user['username'], $user['email'], $code); Gio_Core_Messenger::getInstance()->addMessage($this->view->TRANSLATOR->translator('user_forgotpassword_send_success')); $this->redirect($this->view->url('core_user_forgotpassword')); } }