本文整理汇总了PHP中Customers::static_error方法的典型用法代码示例。如果您正苦于以下问题:PHP Customers::static_error方法的具体用法?PHP Customers::static_error怎么用?PHP Customers::static_error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customers
的用法示例。
在下文中一共展示了Customers::static_error方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Reactivate
/**
* Send activation email
* @param $email
*/
public static function Reactivate($email)
{
global $objSettings;
// deny all operations in demo version
if (strtolower(SITE_MODE) == 'demo') {
self::$static_error = _OPERATION_BLOCKED;
return false;
}
if (!empty($email)) {
if (check_email_address($email)) {
$sql = 'SELECT id, first_name, last_name, user_name, registration_code, preferred_language, is_active ';
if (!PASSWORDS_ENCRYPTION) {
$sql .= ', user_password ';
} else {
if (strtolower(PASSWORDS_ENCRYPTION_TYPE) == 'aes') {
$sql .= ', AES_DECRYPT(user_password, \'' . PASSWORDS_ENCRYPT_KEY . '\') as user_password ';
} else {
if (strtolower(PASSWORDS_ENCRYPTION_TYPE) == 'md5') {
$sql .= ', \'\' as user_password ';
}
}
}
$sql .= 'FROM ' . TABLE_CUSTOMERS . ' WHERE email = \'' . $email . '\'';
$temp = database_query($sql, DATA_ONLY, FIRST_ROW_ONLY);
if (is_array($temp) && count($temp) > 0) {
if ($temp['registration_code'] != '' && $temp['is_active'] == '0') {
////////////////////////////////////////////////////////
if (!PASSWORDS_ENCRYPTION) {
$user_password = $temp['user_password'];
} else {
if (strtolower(PASSWORDS_ENCRYPTION_TYPE) == 'aes') {
$user_password = $temp['user_password'];
} else {
if (strtolower(PASSWORDS_ENCRYPTION_TYPE) == 'md5') {
$user_password = get_random_string(8);
$sql = 'UPDATE ' . TABLE_CUSTOMERS . ' SET user_password = \'' . md5($user_password) . '\' WHERE id = ' . $temp['id'];
database_void_query($sql);
}
}
}
send_email($email, $objSettings->GetParameter('admin_email'), 'new_account_created_confirm_by_email', array('{FIRST NAME}' => $temp['first_name'], '{LAST NAME}' => $temp['last_name'], '{USER NAME}' => $temp['user_name'], '{USER PASSWORD}' => $user_password, '{REGISTRATION CODE}' => $temp['registration_code'], '{WEB SITE}' => $_SERVER['SERVER_NAME'], '{BASE URL}' => APPHP_BASE, '{YEAR}' => date('Y')), $temp['preferred_language']);
////////////////////////////////////////////////////////
return true;
} else {
self::$static_error = _EMAILS_SENT_ERROR;
return false;
}
} else {
self::$static_error = _EMAIL_NOT_EXISTS;
return false;
}
} else {
self::$static_error = _EMAIL_IS_WRONG;
return false;
}
} else {
self::$static_error = _EMAIL_EMPTY_ALERT;
return false;
}
return true;
}