本文整理汇总了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);
}
示例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);
}
示例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()));
}
示例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;
}
示例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;
}