當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserAccount::recoverPassword方法代碼示例

本文整理匯總了PHP中UserAccount::recoverPassword方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserAccount::recoverPassword方法的具體用法?PHP UserAccount::recoverPassword怎麽用?PHP UserAccount::recoverPassword使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserAccount的用法示例。


在下文中一共展示了UserAccount::recoverPassword方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: resetpasswordAction

 function resetpasswordAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(TRUE);
     $session = SessionWrapper::getInstance();
     $this->_translate = Zend_Registry::get("translate");
     $id = decode($this->_getParam('id'));
     // debugMessage($id);
     $user = new UserAccount();
     $user->populate($id);
     debugMessage($user->toArray());
     // $formvalues = array('email'=>$user->getEmail());
     $user->setEmail($user->getEmail());
     // debugMessage('error '.$user->getErrorStackAsString()); exit();
     if ($user->recoverPassword()) {
         $session->setVar(SUCCESS_MESSAGE, sprintf($this->_translate->translate('profile_change_password_admin_confirmation'), $user->getName()));
         // send a link to enable the user to recover their password
         // debugMessage('no error found ');
         $view = new Zend_View();
         $url = $this->view->serverUrl($this->view->baseUrl('profile/view/id/' . encode($user->getID())));
         $usecase = '1.9';
         $module = '1';
         $type = USER_RESET_PASSWORD;
         $details = "Reset password request. Reset link sent to <a href='" . $url . "' class='blockanchor'>" . $user->getName() . "</a>";
         $browser = new Browser();
         $audit_values = $session->getVar('browseraudit');
         $audit_values['module'] = $module;
         $audit_values['usecase'] = $usecase;
         $audit_values['transactiontype'] = $type;
         $audit_values['userid'] = $session->getVar('userid');
         $audit_values['url'] = $url;
         $audit_values['transactiondetails'] = $details;
         $audit_values['status'] = "Y";
         // debugMessage($audit_values);
         $this->notify(new sfEvent($this, $type, $audit_values));
     } else {
         $session->setVar(ERROR_MESSAGE, $user->getErrorStackAsString());
         $session->setVar(FORM_VALUES, $this->_getAllParams());
         // debugMessage('no error found ');
     }
     // exit();
     $this->_helper->redirector->gotoUrl(decode($this->_getParam(URL_SUCCESS)));
 }
開發者ID:7thZoneTechnology,項目名稱:hrms-1,代碼行數:43,代碼來源:ProfileController.php


注:本文中的UserAccount::recoverPassword方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。