本文整理汇总了PHP中utility::generateUID方法的典型用法代码示例。如果您正苦于以下问题:PHP utility::generateUID方法的具体用法?PHP utility::generateUID怎么用?PHP utility::generateUID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utility
的用法示例。
在下文中一共展示了utility::generateUID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lostPasswordConfirmEmail
public static function lostPasswordConfirmEmail($email)
{
global $lC_Database, $lC_Language;
$lC_Language->loadIniFile('login.php');
// check for email
$Qadmin = $lC_Database->query('select * from :table_administrators where user_name = :user_name limit 1');
$Qadmin->bindTable(':table_administrators', TABLE_ADMINISTRATORS);
$Qadmin->bindValue(':user_name', $email);
$Qadmin->execute();
$admin = $Qadmin->toArray();
// if email exists we continue
if ($Qadmin->numberOfRows() > 0) {
$lC_Database->startTransaction();
$verify_key = utility::generateUID();
// set the key to be verified from the resulting email
$Qsetkey = $lC_Database->query('update :table_administrators set verify_key = :verify_key where user_name = :user_name');
$Qsetkey->bindTable(':table_administrators', TABLE_ADMINISTRATORS);
$Qsetkey->bindValue(':user_name', $email);
$Qsetkey->bindValue(':verify_key', $verify_key);
$Qsetkey->setLogging($_SESSION['module'], $email);
$Qsetkey->execute();
if (!$lC_Database->isError()) {
$lC_Database->commitTransaction();
$_SESSION['user_not_exists'] = null;
$_SESSION['user_confirmed_email'] = $email;
// set email contents
$email_text = '';
$email_text .= sprintf($lC_Language->get('text_lost_password_verification_body_line_1'), $admin['first_name']) . "\n\n";
$email_text .= sprintf($lC_Language->get('text_lost_password_verification_body_line_2'), $admin['user_name']) . "\n\n";
$email_text .= sprintf($lC_Language->get('text_lost_password_verification_body_line_3'), lc_href_link_admin(FILENAME_DEFAULT, 'login&action=lost_password&email=' . $admin['user_name'] . '&key=' . $verify_key)) . "\n\n";
$email_text .= sprintf($lC_Language->get('text_lost_password_verification_body_line_4'), $verify_key) . "\n\n";
$email_text .= $lC_Language->get('text_lost_password_verification_body_line_5') . "\n\n";
$email_text .= $lC_Language->get('text_lost_password_verification_body_line_6') . "\n\n";
$email_text .= sprintf($lC_Language->get('text_lost_password_verification_body_line_7'), STORE_NAME) . "\n\n";
// send verification email
lc_email($Qadmin->valueProtected('first_name') . ' ' . $Qadmin->valueProtected('last_name'), $Qadmin->valueProtected('user_name'), sprintf($lC_Language->get('text_lost_password_verification_subject'), STORE_NAME), $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
return true;
} else {
$lC_Database->rollbackTransaction();
$_SESSION['user_not_exists'] = true;
$_SESSION['user_confirmed_email'] = null;
return false;
}
} else {
$_SESSION['user_not_exists'] = true;
$_SESSION['user_confirmed_email'] = null;
return false;
}
}