本文整理汇总了PHP中erLhcoreClassModelUser::fetchUserByEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassModelUser::fetchUserByEmail方法的具体用法?PHP erLhcoreClassModelUser::fetchUserByEmail怎么用?PHP erLhcoreClassModelUser::fetchUserByEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassModelUser
的用法示例。
在下文中一共展示了erLhcoreClassModelUser::fetchUserByEmail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: trim
<?php
$cfgSite = erConfigClassLhConfig::getInstance();
$secretHash = $cfgSite->getSetting('site', 'secrethash');
if ($Params['user_parameters']['validation_hash'] == sha1(sha1($Params['user_parameters']['email'] . $secretHash) . $secretHash)) {
$accept = erLhcoreClassModelChatAccept::fetchByHash($Params['user_parameters']['hash']);
if ($accept !== false) {
$chat_id = $accept->chat_id;
if ($accept->wused == 0) {
$userID = erLhcoreClassModelUser::fetchUserByEmail($Params['user_parameters']['email'], trim($Params['user_parameters']['email']) != '' ? trim($Params['user_parameters']['email']) : false);
if ($userID !== false && $accept->ctime > time() - erLhcoreClassModelChatConfig::fetch('accept_chat_link_timeout')->current_value) {
$accept->wused = 1;
$accept->saveThis();
erLhcoreClassUser::instance()->setLoggedUser($userID);
erLhcoreClassModule::redirect('chat/single', '/' . $chat_id);
exit;
} else {
erLhcoreClassModule::redirect('user/login', '/(r)/' . rawurlencode(base64_encode('chat/single/' . $chat_id)));
exit;
}
} else {
erLhcoreClassModule::redirect('user/login', '/(r)/' . rawurlencode(base64_encode('chat/single/' . $chat_id)));
exit;
}
erLhcoreClassModelChatAccept::cleanup();
}
}
erLhcoreClassModule::redirect('user/login');
exit;
示例2: array
$tpl = erLhcoreClassTemplate::getInstance('lhuser/forgotpassword.tpl.php');
$currentUser = erLhcoreClassUser::instance();
if (isset($_POST['Forgotpassword'])) {
$definition = array('Email' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::REQUIRED, 'validate_email'));
$form = new ezcInputForm(INPUT_POST, $definition);
$Errors = array();
if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
erLhcoreClassModule::redirect('user/forgotpassword');
exit;
}
if (!$form->hasValidData('Email')) {
$Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('user/forgotpassword', 'Invalid e-mail address!');
}
if (count($Errors) == 0) {
if (($userID = erLhcoreClassModelUser::fetchUserByEmail($form->Email)) !== false) {
$host = $_SERVER['HTTP_HOST'];
$adminEmail = erConfigClassLhConfig::getInstance()->getSetting('site', 'site_admin_email');
$UserData = erLhcoreClassUser::getSession()->load('erLhcoreClassModelUser', $userID);
$hash = erLhcoreClassModelForgotPassword::randomPassword(40);
erLhcoreClassModelForgotPassword::setRemindHash($UserData->id, $hash);
$mail = new PHPMailer();
$mail->CharSet = "UTF-8";
$mail->From = $adminEmail;
$mail->FromName = erConfigClassLhConfig::getInstance()->getSetting('site', 'title');
$mail->Subject = erTranslationClassLhTranslation::getInstance()->getTranslation('user/forgotpassword', 'Password remind');
// HTML body
$body = erTranslationClassLhTranslation::getInstance()->getTranslation('user/forgotpassword', 'Click this link and You will be sent a new password') . ' </br><a href="http://' . $host . erLhcoreClassDesign::baseurl('user/remindpassword') . '/' . $hash . '">Restore password</a>';
// Plain text body
$text_body = erTranslationClassLhTranslation::getInstance()->getTranslation('user/forgotpassword', 'Click this link and You will be sent a new password') . ' - http://' . $host . erLhcoreClassDesign::baseurl('user/remindpassword') . '/' . $hash;
$mail->Body = $body;