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


PHP GWF_User::getByEmail方法代碼示例

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


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

示例1: onRequest

 private function onRequest()
 {
     $form = $this->getForm();
     if (false !== ($errors = $form->validate($this->module))) {
         return $errors . $this->form();
     }
     $email = Common::getPost('email', '');
     $user1 = GWF_User::getByName(Common::getPost('username'));
     $user2 = GWF_Validator::isValidEmail($email) ? GWF_User::getByEmail($email) : false;
     # nothing found
     if ($user1 === false && $user2 === false) {
         return $this->module->error('err_not_found') . $this->form();
     }
     # Two different users
     if ($user1 !== false && $user2 !== false && $user1->getID() !== $user2->getID()) {
         return $this->module->error('err_not_same_user') . $this->form();
     }
     # pick the user and send him mail
     if ($user1 !== false && $user2 !== false) {
         $user = $user1;
     } elseif ($user1 !== false) {
         $user = $user1;
     } elseif ($user2 !== false) {
         $user = $user2;
     }
     return $this->sendMail($user);
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:27,代碼來源:Form.php

示例2: onRequestB

 private function onRequestB()
 {
     $token = Common::getPost('token');
     $userid = (int) Common::getPost('userid');
     if (false === ($row = GWF_AccountChange::checkToken($userid, $token, 'email'))) {
         return $this->module->error('err_token');
     }
     $email1 = Common::getPost('email');
     $email2 = Common::getPost('email_re');
     if (!GWF_Validator::isValidEmail($email1)) {
         return $this->module->error('err_email_invalid') . $this->templateChangeMailB($row);
     }
     if ($email1 !== $email2) {
         return $this->module->error('err_email_retype') . $this->templateChangeMailB($row);
     }
     if (GWF_User::getByEmail($email1) !== false) {
         return $this->module->error('err_email_taken');
     }
     if (false === $row->delete()) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return self::sendEmailB($this->module, $userid, $email1);
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:23,代碼來源:ChangeEmail.php

示例3: getNewsletterMessage

 public function getNewsletterMessage(Module_News $module, $email)
 {
     if (false === ($nl = GWF_Newsletter::getByEmail($email))) {
         $nl = GWF_Newsletter::getPreviewRow($email);
     }
     if (false === ($user = GWF_User::getByEmail($email))) {
         $username = $module->lang('anrede', array($email));
     } else {
         $username = $module->lang('anrede', array($user->getName()));
     }
     $unsign = $nl->getUnsignAnchor();
     return $module->lang('newsletter_wrap', array($username, $unsign, $this->getTitle(), $this->displayMessage()));
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:13,代碼來源:GWF_News.php

示例4: validate_email

 public function validate_email(Module_Register $module, $arg)
 {
     if (!GWF_Validator::isValidEmail($arg)) {
         return $this->module->lang('err_email_invalid');
     }
     if (!$this->module->isEMailAllowedTwice()) {
         if (false !== GWF_User::getByEmail($arg)) {
             return $this->module->lang('err_email_taken');
         }
     }
     if (GWF_BlackMail::isBlacklisted($arg)) {
         return $this->module->lang('err_domain_banned');
     }
     return false;
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:15,代碼來源:Form.php

示例5: validate_email

 public function validate_email(Module_Account $module, $arg)
 {
     $arg = trim($arg);
     $_POST['email'] = $arg;
     if ($arg === GWF_Session::getUser()->getVar('user_email')) {
         return false;
     }
     if (!GWF_Validator::isValidEmail($arg)) {
         return $this->module->lang('err_email_invalid');
     }
     if (GWF_User::getByEmail($arg) !== false) {
         return $this->module->lang('err_email_taken');
     }
     return false;
 }
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:15,代碼來源:Form.php


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