本文整理汇总了PHP中zen_encrypt_password函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_encrypt_password函数的具体用法?PHP zen_encrypt_password怎么用?PHP zen_encrypt_password使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zen_encrypt_password函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
}
//valid password
if (strlen($password) < ENTRY_PASSWORD_MIN_LENGTH) {
$error = true;
$messageStack->add_session('easy_createaccount', ENTRY_PASSWORD_ERROR);
} elseif ($password != $confirmation) {
$error = true;
$messageStack->add_session('easy_createaccount', ENTRY_PASSWORD_ERROR_NOT_MATCHING);
}
if ($error == true) {
// hook notifier class
$zco_notifier->notify('NOTIFY_FAILURE_DURING_CREATE_ACCOUNT');
// redirect back to login page
zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
} else {
$sql_data_array = array('customers_email_address' => $email_address, 'customers_password' => zen_encrypt_password($password), 'customers_nick' => $nick, 'customers_authorization' => (int) CUSTOMERS_APPROVAL_AUTHORIZATION);
if (CUSTOMERS_REFERRAL_STATUS == '2' and $customers_referral != '') {
$sql_data_array['customers_referral'] = $customers_referral;
}
/* if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = (empty($_POST['dob']) || $dob_entered == '0001-01-01 00:00:00' ? zen_db_prepare_input('0001-01-01 00:00:00') : zen_date_raw($_POST['dob']));*/
zen_db_perform(TABLE_CUSTOMERS, $sql_data_array);
$_SESSION['customer_id'] = $db->Insert_ID();
$_SESSION['shipping'] = '';
$sql = "insert into " . TABLE_CUSTOMERS_INFO . "\n\t\t\t (customers_info_id, customers_info_number_of_logons,\n\t\t\t customers_info_date_account_created)\n values ('" . (int) $_SESSION['customer_id'] . "', '0', now())";
$db->Execute($sql);
// BEGIN newsletter_subscribe mod 1/1
// If a newsletter only account exists we update the info,
// but keep the subscription active, and give them a message that to
// change they should do so on their account page (after creation).
if (defined('NEWSONLY_SUBSCRIPTION_ENABLED') && NEWSONLY_SUBSCRIPTION_ENABLED == 'true') {
示例2: elseif
} else {
$entry_antirobotreg_error = false;
}
}
if (strlen($password) < ENTRY_PASSWORD_MIN_LENGTH) {
$error = true;
$messageStack->add('create_account', ENTRY_PASSWORD_ERROR);
} elseif ($password != $confirmation) {
$error = true;
$messageStack->add('create_account', ENTRY_PASSWORD_ERROR_NOT_MATCHING);
}
if ($error == true) {
// hook notifier class
$zco_notifier->notify('NOTIFY_FAILURE_DURING_CREATE_ACCOUNT');
} else {
$sql_data_array = array('customers_firstname' => $firstname, 'customers_lastname' => $lastname, 'customers_email_address' => $email_address, 'customers_nick' => $nick, 'customers_telephone' => $telephone, 'customers_fax' => $fax, 'customers_newsletter' => (int) $newsletter, 'customers_email_format' => $email_format, 'customers_default_address_id' => 0, 'customers_password' => zen_encrypt_password($password), 'customers_authorization' => (int) CUSTOMERS_APPROVAL_AUTHORIZATION);
if (CUSTOMERS_REFERRAL_STATUS == '2' and $customers_referral != '') {
$sql_data_array['customers_referral'] = $customers_referral;
}
if (ACCOUNT_GENDER == 'true') {
$sql_data_array['customers_gender'] = $gender;
}
if (ACCOUNT_DOB == 'true') {
$sql_data_array['customers_dob'] = empty($_POST['dob']) || $dob_entered == '0001-01-01 00:00:00' ? zen_db_prepare_input('0001-01-01 00:00:00') : zen_date_raw($_POST['dob']);
}
zen_db_perform(TABLE_CUSTOMERS, $sql_data_array);
$_SESSION['customer_id'] = $db->Insert_ID();
$zco_notifier->notify('NOTIFY_MODULE_CREATE_ACCOUNT_ADDED_CUSTOMER_RECORD', array_merge(array('customer_id' => $_SESSION['customer_id']), $sql_data_array));
$sql_data_array = array('customers_id' => $_SESSION['customer_id'], 'entry_firstname' => $firstname, 'entry_lastname' => $lastname, 'entry_street_address' => $street_address, 'entry_postcode' => $postcode, 'entry_city' => $city, 'entry_country_id' => $country);
if (ACCOUNT_GENDER == 'true') {
$sql_data_array['entry_gender'] = $gender;
示例3: zen_db_prepare_input
$admin_email = zen_db_prepare_input($_POST['admin_email']);
$password_new = zen_db_prepare_input($password_new);
$admin_level = zen_db_prepare_input($_POST['admin_level']);
$password_new = zen_db_prepare_input($password_new);
$sql_data_array = array('admin_name' => $admin_name, 'admin_email' => $admin_email, 'admin_level' => $admin_level);
if ($action == 'insert') {
$insert_sql_data = array('admin_pass' => zen_encrypt_password($password_new));
$sql_data_array = array_merge($sql_data_array, $insert_sql_data);
zen_db_perform(TABLE_ADMIN, $sql_data_array);
$admin_id = zen_db_insert_id();
$admins_id = $admin_id;
} elseif ($action == 'save') {
zen_db_perform(TABLE_ADMIN, $sql_data_array, 'update', "admin_id = '" . (int) $admins_id . "'");
$db->Execute("Update " . TABLE_CONFIGURATION . " set configuration_value='" . $_POST['demo_status'] . "' where configuration_key='ADMIN_DEMO'");
} elseif ($action == 'reset') {
$update_sql_data = array('admin_pass' => zen_encrypt_password($password_new));
$sql_data_array = array_merge($sql_data_array, $update_sql_data);
zen_db_perform(TABLE_ADMIN, $sql_data_array, 'update', "admin_id = '" . (int) $admins_id . "'");
}
// end action check
zen_redirect(zen_href_link(FILENAME_ADMIN, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'adminID=' . $admins_id));
}
// end error check
//echo $action;
// zen_redirect(zen_href_link(FILENAME_ADMIN, (isset($_GET['page']) ? 'page=' . '&' : '') . 'adminID=' . $admins_id));
break;
// ----------------------------------------------------------------------------------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------------------------------------------------------------------------------
case 'deleteconfirm':
示例4: elseif
} elseif (strlen($password_new) < ENTRY_PASSWORD_MIN_LENGTH) {
$error = true;
$messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR);
} elseif ($password_new != $password_confirmation) {
$error = true;
$messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING);
}
if ($error == false) {
$check_customer_query = "SELECT customers_password, customers_nick\n FROM " . TABLE_CUSTOMERS . "\n WHERE customers_id = :customersID";
$check_customer_query = $db->bindVars($check_customer_query, ':customersID', $_SESSION['customer_id'], 'integer');
$check_customer = $db->Execute($check_customer_query);
if (zen_validate_password($password_current, $check_customer->fields['customers_password'])) {
$nickname = $check_customer->fields['customers_nick'];
$sql = "UPDATE " . TABLE_CUSTOMERS . "\n SET customers_password = :password \n WHERE customers_id = :customersID";
$sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
$sql = $db->bindVars($sql, ':password', zen_encrypt_password($password_new), 'string');
$db->Execute($sql);
$sql = "UPDATE " . TABLE_CUSTOMERS_INFO . "\n SET customers_info_date_account_last_modified = now()\n WHERE customers_info_id = :customersID";
$sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
$db->Execute($sql);
if ($phpBB->phpBB['installed'] == true) {
if (zen_not_null($nickname) && $nickname != '') {
$phpBB->phpbb_change_password($nickname, $password_new);
}
}
$messageStack->add_session('account', SUCCESS_PASSWORD_UPDATED, 'success');
zen_redirect(zen_href_link(FILENAME_ACCOUNT, '', 'SSL'));
} else {
$error = true;
$messageStack->add('account_password', ERROR_CURRENT_PASSWORD_NOT_MATCHING);
}
示例5: module_visitor_to_account
function module_visitor_to_account($return = array())
{
global $db, $messageStack, $zco_notifier;
$return = $this->zoneOptions($return);
$process = false;
/**
* Process form contents
*/
if (isset($_POST['action']) && $_POST['action'] == 'process') {
$process = true;
$return['error'] = false;
$return['error_messages'] = array();
$return = $this->prosessPrivacyConditions($return);
$return = $this->processGender($return);
$return = $this->processNames($return);
$return = $this->processNick($return);
$return = $this->processDOB($return);
$return = $this->processEmailAddress($return);
$return = $this->processAddress($return);
$return = $this->processEmailFormat($return);
$return = $this->processCustomersAuthorization($return);
$return = $this->processCustomersReferral($return);
$return = $this->processNewsletter($return);
$return = $this->processPassword($return);
if (count($return['error_messages']) > 0) {
foreach ($return['error_messages'] as $error_message) {
$messageStack->add('create_account', $error_message['message'], $error_message['type']);
}
}
if ($return['error'] == true) {
// hook notifier class
$zco_notifier->notify('NOTIFY_FAILURE_DURING_VISITOR_TO_ACCOUNT');
} else {
extract($return);
$sql_data_array = array('customers_firstname' => $firstname, 'customers_lastname' => $lastname, 'customers_email_address' => $email_address, 'customers_nick' => $nick, 'customers_telephone' => $telephone, 'customers_fax' => $fax, 'customers_newsletter' => (int) $newsletter, 'customers_email_format' => $email_format, 'customers_password' => zen_encrypt_password($password), 'customers_authorization' => (int) CUSTOMERS_APPROVAL_AUTHORIZATION);
// ->furikana
if (FURIKANA_NESESSARY) {
$sql_data_array['customers_firstname_kana'] = $firstname_kana;
$sql_data_array['customers_lastname_kana'] = $lastname_kana;
}
// <-furikana
if (CUSTOMERS_REFERRAL_STATUS == '2' and $customers_referral != '') {
$sql_data_array['customers_referral'] = $customers_referral;
}
if (ACCOUNT_GENDER == 'true') {
$sql_data_array['customers_gender'] = $gender;
}
// if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = zen_date_raw($dob);
if (ACCOUNT_DOB == 'true') {
$sql_data_array['customers_dob'] = empty($_POST['dob']) ? zen_db_prepare_input('0001-01-01 00:00:00') : zen_date_raw($_POST['dob']);
}
zen_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int) $_SESSION['customer_id'] . "'");
// delete a visitor
$db->Execute("delete from " . TABLE_VISITORS . "\r\n where visitors_id = '" . (int) $_SESSION['visitors_id'] . "'");
unset($_SESSION['visitors_id']);
$sql_data_array = array('entry_firstname' => $firstname, 'entry_lastname' => $lastname, 'entry_telephone' => $telephone, 'entry_fax' => $fax, 'entry_street_address' => $street_address, 'entry_postcode' => $postcode, 'entry_city' => $city, 'entry_country_id' => $country);
// ->furikana
if (FURIKANA_NESESSARY) {
$sql_data_array['entry_firstname_kana'] = $firstname_kana;
$sql_data_array['entry_lastname_kana'] = $lastname_kana;
}
// <-furikana
if (ACCOUNT_GENDER == 'true') {
$sql_data_array['entry_gender'] = $gender;
}
if (ACCOUNT_COMPANY == 'true') {
$sql_data_array['entry_company'] = $company;
}
if (ACCOUNT_SUBURB == 'true') {
$sql_data_array['entry_suburb'] = $suburb;
}
if (ACCOUNT_STATE == 'true') {
if ($zone_id > 0) {
$sql_data_array['entry_zone_id'] = $zone_id;
$sql_data_array['entry_state'] = '';
} else {
$sql_data_array['entry_zone_id'] = '0';
$sql_data_array['entry_state'] = $state;
}
}
zen_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int) $_SESSION['customer_id'] . "' and address_book_id = '" . (int) $_SESSION['customer_default_address_id'] . "'");
$sql = "UPDATE " . TABLE_CUSTOMERS_INFO . "\r\n SET customers_info_date_account_last_modified = now()\r\n WHERE customers_info_id = :customersID";
$sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
// phpBB create account
if ($phpBB->phpBB['installed'] == true) {
$phpBB->phpbb_create_account($nick, $password, $email_address);
}
// End phppBB create account
$_SESSION['customer_first_name'] = $firstname;
$_SESSION['customer_last_name'] = $lastname;
// ->furikana
if (FURIKANA_NESESSARY) {
$_SESSION['customer_first_name_kana'] = $firstname_kana;
$_SESSION['customer_last_name_kana'] = $lastname_kana;
}
// <-furikana
$_SESSION['customer_country_id'] = $country;
$_SESSION['customer_zone_id'] = $zone_id;
// restore cart contents
$_SESSION['cart']->restore_contents();
//.........这里部分代码省略.........
示例6: zen_db_prepare_input
$error_check = false;
if (isset($_POST['submit'])) {
if (!$_POST['admin_email']) {
$error_check = true;
$email_message = ERROR_WRONG_EMAIL_NULL;
}
$admin_email = zen_db_prepare_input($_POST['admin_email']);
$sql = "select admin_id, admin_name, admin_email, admin_pass from " . TABLE_ADMIN . " where admin_email = '" . zen_db_input($admin_email) . "'";
$result = $db->Execute($sql);
if (!($admin_email == $result->fields['admin_email'])) {
$error_check = true;
$email_message = ERROR_WRONG_EMAIL;
}
if ($error_check == false) {
$new_password = zen_create_random_value(ENTRY_PASSWORD_MIN_LENGTH);
$admin_pass = zen_encrypt_password($new_password);
$sql = "update " . TABLE_ADMIN . " set admin_pass = '" . zen_db_input($admin_pass) . "' where admin_email = '" . $result->fields['admin_email'] . "'";
$db->Execute($sql);
$html_msg['EMAIL_CUSTOMERS_NAME'] = $result->fields['admin_name'];
$html_msg['EMAIL_MESSAGE_HTML'] = sprintf(TEXT_EMAIL_MESSAGE, $new_password);
zen_mail($result->fields['admin_name'], $result->fields['admin_email'], TEXT_EMAIL_SUBJECT, sprintf(TEXT_EMAIL_MESSAGE, $new_password), STORE_NAME, EMAIL_FROM, $html_msg, 'password_forgotten_admin');
$email_message = SUCCESS_PASSWORD_SENT;
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php
echo HTML_PARAMS;
?>
>
<head>
示例7: dbAdminSetup
function dbAdminSetup()
{
$this->dbActivate();
// can likely remove this line for v1.4
$sql = "update " . DB_PREFIX . "admin set admin_name = '" . $this->configInfo['admin_username'] . "', admin_email = '" . $this->configInfo['admin_email'] . "', admin_pass = '" . zen_encrypt_password($this->configInfo['admin_pass']) . "' where admin_id = 1";
$this->db->Execute($sql) or die("Error in query: {$sql}" . $this->db->ErrorMsg());
// enable/disable automatic version-checking
$sql = "update " . DB_PREFIX . "configuration set configuration_value = '" . ($this->configInfo['check_for_updates'] ? 'true' : 'false') . "' where configuration_key = 'SHOW_VERSION_UPDATE_IN_HEADER'";
$this->db->Execute($sql) or die("Error in query: {$sql}" . $this->db->ErrorMsg());
$this->db->Close();
}
示例8: zen_db_prepare_input
// BEGIN SLAM PREVENTION
if ($_POST['email_address'] != '') {
if (!isset($_SESSION['login_attempt'])) {
$_SESSION['login_attempt'] = 0;
}
$_SESSION['login_attempt']++;
}
// END SLAM PREVENTION
$email_address = zen_db_prepare_input($_POST['email_address']);
$check_customer_query = "SELECT customers_firstname, customers_lastname, customers_password, customers_id\n FROM " . TABLE_CUSTOMERS . "\n WHERE customers_email_address = :emailAddress";
$check_customer_query = $db->bindVars($check_customer_query, ':emailAddress', $email_address, 'string');
$check_customer = $db->Execute($check_customer_query);
if ($check_customer->RecordCount() > 0) {
$zco_notifier->notify('NOTIFY_PASSWORD_FORGOTTEN_VALIDATED');
$new_password = zen_create_PADSS_password(ENTRY_PASSWORD_MIN_LENGTH > 0 ? ENTRY_PASSWORD_MIN_LENGTH : 5);
$crypted_password = zen_encrypt_password($new_password);
$sql = "UPDATE " . TABLE_CUSTOMERS . "\n SET customers_password = :password\n WHERE customers_id = :customersID";
$sql = $db->bindVars($sql, ':password', $crypted_password, 'string');
$sql = $db->bindVars($sql, ':customersID', $check_customer->fields['customers_id'], 'integer');
$db->Execute($sql);
$html_msg['EMAIL_CUSTOMERS_NAME'] = $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'];
$html_msg['EMAIL_MESSAGE_HTML'] = sprintf(EMAIL_PASSWORD_REMINDER_BODY, $new_password);
// send the email
zen_mail($check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'], $email_address, EMAIL_PASSWORD_REMINDER_SUBJECT, sprintf(EMAIL_PASSWORD_REMINDER_BODY, $new_password), STORE_NAME, EMAIL_FROM, $html_msg, 'password_forgotten');
$messageStack->add_session('login', SUCCESS_PASSWORD_SENT, 'success');
zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
} else {
$messageStack->add('password_forgotten', TEXT_NO_EMAIL_ADDRESS_FOUND);
}
}
$breadcrumb->add(NAVBAR_TITLE_1, zen_href_link(FILENAME_LOGIN, '', 'SSL'));
示例9: zen_db_prepare_input
$how_know_web = zen_db_prepare_input($_POST['how_know_web']);
} else {
$how_know_web = 0;
}
$check_email_query = "select count(*) as total\n from " . TABLE_CUSTOMERS . "\n where customers_email_address = '" . zen_db_input($email_address) . "'";
$check_email = $db->Execute($check_email_query);
if ($check_email->fields['total'] > 0) {
$error = true;
$messageStack->add_session('login', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
}
if ($error == true) {
// hook notifier class
$zco_notifier->notify('NOTIFY_FAILURE_DURING_CREATE_ACCOUNT');
} else {
$sql_data_array = array('customers_lastname' => 'New Customer', 'customers_email_address' => $email_address, 'customers_newsletter' => (int) $newsletter, 'customers_email_format' => $email_format, 'customers_default_address_id' => 0, 'customers_password' => zen_encrypt_password($password), 'customers_describes' => $describes, 'customers_referral' => $customers_referral, 'customers_authorization' => (int) CUSTOMERS_APPROVAL_AUTHORIZATION);
zen_db_perform(TABLE_CUSTOMERS, $sql_data_array);
$_SESSION['customer_id'] = $db->Insert_ID();
$sql_data_array = array('customers_id' => $_SESSION['customer_id'], 'from_type_id' => $how_know_web);
zen_db_perform(TABLE_ORIGIN, $sql_data_array);
$freq_type_id = $how_know_web;
$sql_update_origin = "UPDATE " . TABLE_ORIGIN_FREQ . " SET `from_type_freq` = `from_type_freq` +'1' WHERE `from_type_id` = " . $freq_type_id . " LIMIT 1 ; ";
$db->Execute($sql_update_origin);
$zco_notifier->notify('NOTIFY_MODULE_CREATE_ACCOUNT_ADDED_CUSTOMER_RECORD', array_merge(array('customer_id' => $_SESSION['customer_id']), $sql_data_array));
$sql_data_array = array('customers_id' => $_SESSION['customer_id'], 'entry_company' => $company);
zen_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
$address_id = $db->Insert_ID();
$zco_notifier->notify('NOTIFY_MODULE_CREATE_ACCOUNT_ADDED_ADDRESS_BOOK_RECORD', array_merge(array('address_id' => $address_id), $sql_data_array));
$sql = "update " . TABLE_CUSTOMERS . "\n set customers_default_address_id = '" . (int) $address_id . "'\n where customers_id = '" . (int) $_SESSION['customer_id'] . "'";
$db->Execute($sql);
$sql = "insert into " . TABLE_CUSTOMERS_INFO . "\n (customers_info_id, customers_info_number_of_logons,\n customers_info_date_account_created)\n values ('" . (int) $_SESSION['customer_id'] . "', '0', now())";
示例10: email_templates_make_new_passord
function email_templates_make_new_passord($customers_id, $email_address)
{
global $db;
$new_password = zen_create_random_value(ENTRY_PASSWORD_MIN_LENGTH);
$crypted_password = zen_encrypt_password($new_password);
$sql = "UPDATE " . TABLE_CUSTOMERS . "\n SET customers_password = :password\n WHERE customers_id = :customersID";
$sql = $db->bindVars($sql, ':password', $crypted_password, 'string');
$sql = $db->bindVars($sql, ':customersID', $customers_id, 'integer');
$db->Execute($sql);
return $new_password;
}
示例11: makeSqlString
$customer_exists = $db->Execute("select customers_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . makeSqlString($data[$root]['buyer-billing-address']['email']['VALUE']) . "'");
// Check if the GC buyer id exists
$customer_info = $db->Execute("select gct.customers_id from " . $googlepayment->table_name . " gct " . " inner join " . TABLE_CUSTOMERS . " tc on gct.customers_id = tc.customers_id " . " where gct.buyer_id = " . makeSqlString($data[$root]['buyer-id']['VALUE']));
$new_user = false;
// Ignore session to avoid mix of Cart-GC sessions/emails
// GC email is the most important one
// if ((isset($_SESSION['customer_id']) && $_SESSION['customer_id'] != '')
// || $customer_exists->RecordCount() != 0) {
if ($customer_exists->RecordCount() != 0) {
$_SESSION['customer_id'] = $customer_exists->fields['customers_id'];
} else {
if ($customer_info->RecordCount() != 0) {
$_SESSION['customer_id'] = $customer_info->fields['customers_id'];
} else {
list($firstname, $lastname) = explode(' ', makeSqlString($data[$root]['buyer-billing-address']['contact-name']['VALUE']), 2);
$sql_data_array = array('customers_firstname' => $firstname, 'customers_lastname' => $lastname, 'customers_email_address' => $data[$root]['buyer-billing-address']['email']['VALUE'], 'customers_nick' => '', 'customers_telephone' => $data[$root]['buyer-billing-address']['phone']['VALUE'], 'customers_fax' => $data[$root]['buyer-billing-address']['fax']['VALUE'], 'customers_default_address_id' => 0, 'customers_password' => zen_encrypt_password(makeSqlString($data[$root]['buyer-id']['VALUE'])), 'customers_newsletter' => $data[$root]['buyer-marketing-preferences']['email-allowed']['VALUE'] == 'true' ? 1 : 0);
if (ACCOUNT_DOB == 'true') {
$sql_data_array['customers_dob'] = 'now()';
}
zen_db_perform(TABLE_CUSTOMERS, $sql_data_array);
$_SESSION['customer_id'] = $db->Insert_ID();
$db->Execute("insert into " . TABLE_CUSTOMERS_INFO . "\n (customers_info_id, customers_info_number_of_logons,\n customers_info_date_account_created)\n values ('" . (int) $_SESSION['customer_id'] . "', '0', now())");
/* $db->Execute("insert into " . $googlepayment->table_name . " " .
" values ( " . $_SESSION['customer_id'] . ", " .
$data[$root]['buyer-id']['VALUE'] . ")");*/
$new_user = true;
}
}
// thx ZachAnderson ;)
$customer_in_gc = $db->Execute("select gct.customers_id from " . $googlepayment->table_name . " gct " . " where gct.buyer_id = " . makeSqlString($data[$root]['buyer-id']['VALUE']));
if ($customer_in_gc->RecordCount() == 0) {
示例12: zen_db_prepare_input
$admin_pass_confirm = zen_db_prepare_input($_POST['admin_pass_confirm']);
if (isset($_POST['check_for_updates']) && $_POST['check_for_updates'] == '1') {
$check_for_updates = 1;
} else {
$check_for_updates = 0;
}
$zc_install->isEmpty($admin_username, ERROR_TEXT_ADMIN_USERNAME_ISEMPTY, ERROR_CODE_ADMIN_USERNAME_ISEMPTY);
$zc_install->isEmpty($admin_email, ERROR_TEXT_ADMIN_EMAIL_ISEMPTY, ERROR_CODE_ADMIN_EMAIL_ISEMPTY);
$zc_install->isEmail($admin_email, ERROR_TEXT_ADMIN_EMAIL_NOTEMAIL, ERROR_CODE_ADMIN_EMAIL_NOTEMAIL);
$zc_install->isEmpty($admin_pass, ERROR_TEXT_ADMIN_PASS_ISEMPTY, ERROR_CODE_ADMIN_PASS_ISEMPTY);
$zc_install->isEqual($admin_pass, $admin_pass_confirm, ERROR_TEXT_ADMIN_PASS_NOTEQUAL, ERROR_CODE_ADMIN_PASS_NOTEQUAL);
if (!$zc_install->error) {
require '../includes/classes/db/' . DB_TYPE . '/query_factory.php';
$db = new queryFactory();
$db->Connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE) or die("Unable to connect to database");
$sql = "update " . DB_PREFIX . "admin set admin_name = '" . $admin_username . "', admin_email = '" . $admin_email . "', admin_pass = '" . zen_encrypt_password($admin_pass) . "' where admin_id = 1";
$db->Execute($sql) or die("Error in query: {$sql}" . $db->ErrorMsg());
// enable/disable automatic version-checking
$sql = "update " . DB_PREFIX . "configuration set configuration_value = '" . ($check_for_updates ? 'true' : 'false') . "' where configuration_key = 'SHOW_VERSION_UPDATE_IN_HEADER'";
$db->Execute($sql) or die("Error in query: {$sql}" . $db->ErrorMsg());
$db->Close();
header('location: index.php?main_page=finished&language=' . $language);
exit;
}
}
if (!isset($_POST['admin_username'])) {
$_POST['admin_username'] = '';
}
if (!isset($_POST['admin_email'])) {
$_POST['admin_email'] = '';
}
示例13: zen_reset_password
function zen_reset_password($id, $password, $compare)
{
global $db;
$errors = array();
$id = (int) $id;
if ($password != 'no password' || $compare != 'no password') {
$password = zen_db_prepare_input($password);
$compare = zen_db_prepare_input($compare);
if ($password != $compare) {
$errors[] = ERROR_PASSWORDS_NOT_MATCHING;
}
if (zen_check_for_password_problems($password, $id)) {
$errors[] = ENTRY_PASSWORD_CHANGE_ERROR . ' ' . sprintf(ERROR_PASSWORD_RULES, (int) ADMIN_PASSWORD_MIN_LENGTH < 7 ? 7 : (int) ADMIN_PASSWORD_MIN_LENGTH);
}
}
if (sizeof($errors) == 0) {
$encryptedPassword = zen_encrypt_password($password);
$sql = "UPDATE " . TABLE_ADMIN . "\r\n SET prev_pass3 = prev_pass2, prev_pass2 = prev_pass1, prev_pass1 = admin_pass, admin_pass = :newpwd:, pwd_last_change_date = now()\r\n WHERE admin_id = :adminID:";
$sql = $db->bindVars($sql, ':adminID:', $id, 'integer');
$sql = $db->bindVars($sql, ':newpwd:', zen_encrypt_password($password), 'string');
$db->Execute($sql);
}
return $errors;
}
示例14: zen_create_PADSS_password
if (!($admin_email == $result->fields['admin_email'])) {
$error = true;
$email_message = MESSAGE_PASSWORD_SENT;
$resetToken = 'bad';
}
// BEGIN SLAM PREVENTION
if ($_POST['admin_email'] != '') {
if (!isset($_SESSION['login_attempt'])) {
$_SESSION['login_attempt'] = 0;
}
$_SESSION['login_attempt']++;
}
// END SLAM PREVENTION
if ($error == false) {
$new_password = zen_create_PADSS_password((int) ADMIN_PASSWORD_MIN_LENGTH < 7 ? 7 : (int) ADMIN_PASSWORD_MIN_LENGTH);
$resetToken = time() + ADMIN_PWD_TOKEN_DURATION . '}' . zen_encrypt_password($new_password);
$sql = "update " . TABLE_ADMIN . " set reset_token = :token: where admin_id = :admID: ";
$sql = $db->bindVars($sql, ':token:', $resetToken, 'string');
$sql = $db->bindVars($sql, ':admID:', $result->fields['admin_id'], 'string');
$db->Execute($sql);
$html_msg['EMAIL_CUSTOMERS_NAME'] = $result->fields['admin_name'];
$html_msg['EMAIL_MESSAGE_HTML'] = sprintf(TEXT_EMAIL_MESSAGE_PWD_RESET, $_SERVER['REMOTE_ADDR'], $new_password);
zen_mail($result->fields['admin_name'], $result->fields['admin_email'], TEXT_EMAIL_SUBJECT_PWD_RESET, sprintf(TEXT_EMAIL_MESSAGE_PWD_RESET, $_SERVER['REMOTE_ADDR'], $new_password), STORE_NAME, EMAIL_FROM, $html_msg, 'password_forgotten_admin');
$email_message = MESSAGE_PASSWORD_SENT;
}
}
?>
<!DOCTYPE html >
<html <?php
echo HTML_PARAMS;
?>
示例15: elseif
if (strlen($password_current) < ENTRY_PASSWORD_MIN_LENGTH) {
$error = true;
$messageStack->add('account_password', ENTRY_PASSWORD_CURRENT_ERROR);
} elseif (strlen($password_new) < ENTRY_PASSWORD_MIN_LENGTH) {
$error = true;
$messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR);
} elseif ($password_new != $password_confirmation) {
$error = true;
$messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING);
}
if ($error == false) {
$check_customer_query = "select customers_password, customers_nick\r\n from " . TABLE_CUSTOMERS . "\r\n where customers_id = '" . (int) $_SESSION['customer_id'] . "'";
$check_customer = $db->Execute($check_customer_query);
if (zen_validate_password($password_current, $check_customer->fields['customers_password'])) {
$nickname = $check_customer->fields['customers_nick'];
$db->Execute("update " . TABLE_CUSTOMERS . " set customers_password = '" . zen_encrypt_password($password_new) . "' where customers_id = '" . (int) $_SESSION['customer_id'] . "'");
$sql = "update " . TABLE_CUSTOMERS_INFO . "\r\n set customers_info_date_account_last_modified = now()\r\n where customers_info_id = '" . (int) $_SESSION['customer_id'] . "'";
$db->Execute($sql);
if ($sniffer->phpBB['installed'] == true) {
if (zen_not_null($nickname) && $nickname != '') {
// require($sniffer->phpBB['phpbb_path'] . 'config.php');
$db_phpbb = new queryFactory();
$db_phpbb->connect($sniffer->phpBB['dbhost'], $sniffer->phpBB['dbuser'], $sniffer->phpBB['dbpasswd'], $sniffer->phpBB['dbname'], USE_PCONNECT, false);
$sql = "update " . $sniffer->phpBB['users_table'] . " set user_password='" . MD5($password_new) . "'\r\n where username = '" . $nickname . "'";
$phpbb_users = $db_phpbb->Execute($sql);
$db->connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE, USE_PCONNECT, false);
}
}
$messageStack->add_session('account', SUCCESS_PASSWORD_UPDATED, 'success');
zen_redirect(zen_href_link(FILENAME_ACCOUNT, '', 'SSL'));
} else {