当前位置: 首页>>代码示例>>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;未经允许,请勿转载。