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


PHP ca_users::setErrorOutput方法代碼示例

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


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

示例1: resetSend

 function resetSend()
 {
     MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": " . _t("Reset Password"));
     $t_user = new ca_users();
     $vs_message = "";
     $va_errors = array();
     $ps_email = $this->request->getParameter('reset_email', pString);
     if (!caCheckEmailAddress($ps_email)) {
         $this->view->setVar("message", _t("E-mail address is not valid"));
         $this->resetForm();
     } else {
         $t_user->setErrorOutput(0);
         if (!$t_user->load(array("user_name" => $ps_email))) {
             $t_user->load(array("email" => $ps_email));
         }
         # verify user exists with this e-mail address
         if ($t_user->getPrimaryKey()) {
             # user with e-mail does exists...
             if (sizeof($va_errors) == 0) {
                 $o_view = new View($this->request, array($this->request->getViewsDirectoryPath()));
                 $vs_reset_key = md5($t_user->get("user_id") . '/' . $t_user->get("password"));
                 # --- get the subject of the email from template
                 $vs_subject_line = $o_view->render('mailTemplates/instructions_subject.tpl');
                 # -- generate mail text from template - get both the text and html versions
                 $vs_password_reset_url = $this->request->config->get("site_host") . caNavUrl($this->request, '', 'LoginReg', 'resetSave', array('key' => $vs_reset_key));
                 $o_view->setVar("password_reset_url", $vs_password_reset_url);
                 $vs_mail_message_text = $o_view->render('mailTemplates/instructions.tpl');
                 $vs_mail_message_html = $o_view->render('mailTemplates/instructions_html.tpl');
                 caSendmail($t_user->get('email'), $this->request->config->get("ca_admin_email"), $vs_subject_line, $vs_mail_message_text, $vs_mail_message_html);
                 $this->view->setVar("email", $this->request->config->get("ca_admin_email"));
                 $this->view->setVar("action", "send");
                 $this->render('LoginReg/form_reset_html.php');
             }
         } else {
             $this->view->setVar("message", _t("There is no registered user with the email address you provided"));
             $this->resetForm();
         }
     }
 }
開發者ID:kai-iak,項目名稱:pawtucket2,代碼行數:39,代碼來源:LoginRegController.php


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