本文整理汇总了PHP中tep_encrypt_password函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_encrypt_password函数的具体用法?PHP tep_encrypt_password怎么用?PHP tep_encrypt_password使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tep_encrypt_password函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _process
function _process()
{
global $messageStack, $osC_Database, $osC_Customer;
if (!isset($_POST['password_current']) || strlen(trim($_POST['password_current'])) < ACCOUNT_PASSWORD) {
$messageStack->add('account_password', ENTRY_PASSWORD_CURRENT_ERROR);
} elseif (!isset($_POST['password_new']) || strlen(trim($_POST['password_new'])) < ACCOUNT_PASSWORD) {
$messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR);
} elseif (!isset($_POST['password_confirmation']) || trim($_POST['password_new']) != trim($_POST['password_confirmation'])) {
$messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING);
}
if ($messageStack->size('account_password') === 0) {
$Qcheck = $osC_Database->query('select customers_password from :table_customers where customers_id = :customers_id');
$Qcheck->bindTable(':table_customers', TABLE_CUSTOMERS);
$Qcheck->bindInt(':customers_id', $osC_Customer->id);
$Qcheck->execute();
if (tep_validate_password(trim($_POST['password_current']), $Qcheck->value('customers_password'))) {
$Qupdate = $osC_Database->query('update :table_customers set customers_password = :customers_password where customers_id = :customers_id');
$Qupdate->bindTable(':table_customers', TABLE_CUSTOMERS);
$Qupdate->bindValue(':customers_password', tep_encrypt_password(trim($_POST['password_new'])));
$Qupdate->bindInt(':customers_id', $osC_Customer->id);
$Qupdate->execute();
$Qupdate = $osC_Database->query('update :table_customers_info set customers_info_date_account_last_modified = now() where customers_info_id = :customers_info_id');
$Qupdate->bindTable(':table_customers_info', TABLE_CUSTOMERS_INFO);
$Qupdate->bindInt(':customers_info_id', $osC_Customer->id);
$Qupdate->execute();
$messageStack->add_session('account', SUCCESS_PASSWORD_UPDATED, 'success');
tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
} else {
$messageStack->add('account_password', ERROR_CURRENT_PASSWORD_NOT_MATCHING);
}
}
}
开发者ID:itnovator,项目名称:oscommerce_cvs,代码行数:32,代码来源:password.php
示例2: execute
function execute()
{
global $login_customer_id, $messageStack, $oscTemplate;
$OSCOM_Db = Registry::get('Db');
$error = false;
if (isset($_GET['action']) && $_GET['action'] == 'process' && isset($_POST['formid']) && $_POST['formid'] == $_SESSION['sessiontoken']) {
$email_address = HTML::sanitize($_POST['email_address']);
$password = HTML::sanitize($_POST['password']);
// Check if email exists
$Qcustomer = $OSCOM_Db->get('customers', ['customers_id', 'customers_password'], ['customers_email_address' => $email_address], null, 1);
if ($Qcustomer->fetch() === false) {
$error = true;
} else {
// Check that password is good
if (!tep_validate_password($password, $Qcustomer->value('customers_password'))) {
$error = true;
} else {
// set $login_customer_id globally and perform post login code in catalog/login.php
$login_customer_id = $Qcustomer->valueInt('customers_id');
// migrate old hashed password to new phpass password
if (tep_password_type($Qcustomer->value('customers_password')) != 'phpass') {
$OSCOM_Db->save('customers', ['customers_password' => tep_encrypt_password($password)], ['customers_id' => $login_customer_id]);
}
}
}
}
if ($error == true) {
$messageStack->add('login', MODULE_CONTENT_LOGIN_TEXT_LOGIN_ERROR);
}
ob_start();
include DIR_WS_MODULES . 'content/' . $this->group . '/templates/login_form.php';
$template = ob_get_clean();
$oscTemplate->addContent($template, $this->group);
}
开发者ID:Akofelaz,项目名称:oscommerce2,代码行数:34,代码来源:cm_login_form.php
示例3: create_user
/**
* @param $first_name
* @param $last_name
* @param $email
* @return integer Customer ID
*/
public static function create_user($first_name, $last_name, $email)
{
$existing_customer = self::get_customer_id_by_email($email);
if (!$existing_customer) {
// Customer doesn't exist, create them.
// tep_encrypt_password deals with actual hashing, this is simply generating a longer string.
$password_string = md5(self::gen_random_string());
$customer_data = array('customers_firstname' => $first_name, 'customers_lastname' => $last_name, 'customers_email_address' => $email, 'customers_gender' => '', 'customers_dob' => tep_db_prepare_input('0001-01-01 00:00:00'), 'customers_telephone' => '', 'customers_newsletter' => '0', 'customers_default_address_id' => 0, 'customers_password' => tep_encrypt_password($password_string));
$cust = tep_db_perform(TABLE_CUSTOMERS, $customer_data);
$cust_id = tep_db_insert_id();
if (!$cust_id) {
return FALSE;
}
// Set an invalid password
$query = "UPDATE " . TABLE_CUSTOMERS . " SET `customers_password` = :pw WHERE `customers_id` = :id";
$query = bind_vars($query, ':pw', 'LOGINWITHAMAZON00000000000000000');
$query = bind_vars($query, ':id', $cust_id);
tep_db_query($query);
// Add user to the Amazon users table
$amazon_table_safe = tep_db_input(self::TABLE_NAME_ONLY);
$cust_id_safe = tep_db_input($cust_id);
$query = "INSERT INTO " . $amazon_table_safe . " (customer_id) VALUES (" . $cust_id_safe . ")";
tep_db_query($query);
// Create customer info entry
tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int) $cust_id . "', '0', now())");
return $cust_id;
} else {
return $existing_customer;
}
}
开发者ID:amzn,项目名称:login-with-amazon-oscommerce,代码行数:36,代码来源:tools.php
示例4: execute
function execute()
{
global $sessiontoken, $login_customer_id, $messageStack, $oscTemplate;
$error = false;
if (isset($_GET['action']) && $_GET['action'] == 'process' && isset($_POST['formid']) && $_POST['formid'] == $sessiontoken) {
$email_address = tep_db_prepare_input($_POST['email_address']);
$password = tep_db_prepare_input($_POST['password']);
// Check if email exists
$customer_query = tep_db_query("select customers_id, customers_password from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' limit 1");
if (!tep_db_num_rows($customer_query)) {
$error = true;
} else {
$customer = tep_db_fetch_array($customer_query);
// Check that password is good
if (!tep_validate_password($password, $customer['customers_password'])) {
$error = true;
} else {
// set $login_customer_id globally and perform post login code in catalog/login.php
$login_customer_id = (int) $customer['customers_id'];
// migrate old hashed password to new phpass password
if (tep_password_type($customer['customers_password']) != 'phpass') {
tep_db_query("update " . TABLE_CUSTOMERS . " set customers_password = '" . tep_encrypt_password($password) . "' where customers_id = '" . (int) $login_customer_id . "'");
}
}
}
}
if ($error == true) {
$messageStack->add('login', MODULE_CONTENT_LOGIN_TEXT_LOGIN_ERROR);
}
ob_start();
include 'includes/modules/content/' . $this->group . '/templates/login_form.php';
$template = ob_get_clean();
$oscTemplate->addContent($template, $this->group);
}
开发者ID:katapofatico,项目名称:Responsive-osCommerce,代码行数:34,代码来源:cm_login_form.php
示例5: create_temp_customer
function create_temp_customer($customer_info)
{
global $customer_id, $customer_first_name, $customer_default_address_id, $customer_country_id, $customer_zone_id, $billto, $sendto;
$query = tep_db_query("SELECT c.customers_id as customer_id, c.customers_firstname, c.customers_default_address_id as customer_default_address_id, ab.entry_country_id as customer_country_id, ab.entry_zone_id as customer_zone_id FROM " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab WHERE c.customers_id = ab.customers_id AND c.customers_default_address_id = ab.address_book_id AND c.customers_email_address = '" . $customer_info['EMAIL'] . "'");
if (tep_db_num_rows($query) > 0) {
$data = tep_db_fetch_array($query);
$customer_id = $data['customer_id'];
$customer_first_name = $data['customer_first_name'];
$customer_default_address_id = $data['customer_default_address_id'];
$customer_country_id = $data['customer_country_id'];
$customer_zone_id = $data['customer_zone_id'];
} else {
$_SESSION['temp_password'] = tep_create_random_value(ENTRY_PASSWORD_MIN_LENGTH);
$sql_data_array = array('customers_firstname' => $customer_info['FIRSTNAME'], 'customers_lastname' => $customer_info['LASTNAME'], 'customers_email_address' => $customer_info['EMAIL'], 'customers_validation' => '1', 'customers_password' => tep_encrypt_password($_SESSION['temp_password']));
tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);
$customer_id = tep_db_insert_id();
$sql_query = tep_db_query("SELECT countries_id FROM " . TABLE_COUNTRIES . " WHERE countries_iso_code_2 = '" . $customer_info['SHIPTOCOUNTRYCODE'] . "'");
if (tep_db_num_rows($sql_query) == 0) {
$sql_query = tep_db_query("SELECT countries_id FROM " . TABLE_COUNTRIES . " WHERE countries_iso_code_2 = '" . $customer_info['COUNTRYCODE'] . "'");
}
$country = tep_db_fetch_array($sql_query);
$customer_country_id = $country['countries_id'];
$zone = tep_db_fetch_array(tep_db_query("SELECT zone_id FROM " . TABLE_ZONES . " WHERE zone_country_id = '" . $country['countries_id'] . "' AND zone_code = '" . $customer_info['SHIPTOSTATE'] . "'"));
if (tep_not_null($zone['zone_id'])) {
$customer_zone_id = $zone['zone_id'];
$state = '';
} else {
$customer_zone_id = '0';
$state = $customer_info['SHIPTOSTATE'];
}
$customer_first_name = $customer_info['FIRSTNAME'];
$customer_last_name = $customer_info['LASTNAME'];
$sql_data_array = array('customers_id' => $customer_id, 'entry_firstname' => $customer_first_name, 'entry_lastname' => $customer_last_name, 'entry_telephone' => $customer_info['PHONENUM'], 'entry_street_address' => $customer_info['SHIPTOSTREET'], 'entry_postcode' => $customer_info['SHIPTOZIP'], 'entry_city' => $customer_info['SHIPTOCITY'], 'entry_country_id' => $customer_country_id, 'entry_zone_id' => $customer_zone_id, 'entry_state' => $state);
tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
$customer_default_address_id = tep_db_insert_id();
$billto = $customer_default_address_id;
$sendto = $customer_default_address_id;
tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int) $customer_default_address_id . "' where customers_id = '" . (int) $customer_id . "'");
tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int) $customer_id . "', '0', now())");
$_SESSION['paypalxc_create_account'] = '1';
}
$_SESSION['customer_id'] = $customer_id;
$_SESSION['customer_first_name'] = $customer_first_name;
$_SESSION['customer_default_address_id'] = $customer_default_address_id;
$_SESSION['customer_country_id'] = $customer_country_id;
$_SESSION['customer_zone_id'] = $customer_zone_id;
}
开发者ID:resultsonlyweb,项目名称:loaded6-template,代码行数:47,代码来源:paypalxc_applicationtop_bottom.php
示例6: tep_db_prepare_input
}
// needs to be included earlier to set the success message in the messageStack
require 'includes/languages/' . $language . '/modules/content/account/cm_account_set_password.php';
if (isset($_POST['action']) && $_POST['action'] == 'process' && isset($_POST['formid']) && $_POST['formid'] == $sessiontoken) {
$password_new = tep_db_prepare_input($_POST['password_new']);
$password_confirmation = tep_db_prepare_input($_POST['password_confirmation']);
$error = false;
if (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) {
tep_db_query("update customers set customers_password = '" . tep_encrypt_password($password_new) . "' where customers_id = '" . (int) $customer_id . "'");
tep_db_query("update customers_info set customers_info_date_account_last_modified = now() where customers_info_id = '" . (int) $customer_id . "'");
$messageStack->add_session('account', MODULE_CONTENT_ACCOUNT_SET_PASSWORD_SUCCESS_PASSWORD_SET, 'success');
tep_redirect(tep_href_link('account.php', '', 'SSL'));
}
}
$breadcrumb->add(MODULE_CONTENT_ACCOUNT_SET_PASSWORD_NAVBAR_TITLE_1, tep_href_link('account.php', '', 'SSL'));
$breadcrumb->add(MODULE_CONTENT_ACCOUNT_SET_PASSWORD_NAVBAR_TITLE_2, tep_href_link('ext/modules/content/account/set_password.php', '', 'SSL'));
require 'includes/template_top.php';
?>
<div class="page-header">
<h1><?php
echo MODULE_CONTENT_ACCOUNT_SET_PASSWORD_HEADING_TITLE;
?>
</h1>
开发者ID:katapofatico,项目名称:Responsive-osCommerce,代码行数:31,代码来源:set_password.php
示例7: array
}
}
if ($entity == 0) {
$setperson = $worketc->SetPerson(array('person' => array('Title' => $title, 'FirstName' => $firstname, 'MiddleName' => '', 'Surname' => $lastname, 'Gender' => $newgender, 'EntityID' => 0, 'LastActivity' => date('c'), 'DateLastModified' => date('c'), 'CreationDate' => date('c'), 'Email' => $email_address, 'CustomerCredentials' => 'SupportPersonal', 'Delete' => false, 'RemoveParentLinks' => false, 'OwnerID' => $OwnerID, 'SupplierRate' => 3.1, 'SupplierUnit' => 'None', 'Website' => $website, 'Addresses' => array('Address' => array('AddressID' => $addid, 'AddressType' => 'Home', 'Street' => $street_address, 'Suburb' => $city, 'StateOrProv' => $state, 'PostalCode' => $postcode, 'Country' => tep_get_country_name($country), 'Phone' => $telephone, 'PhoneExt' => $customers_telephone_ext, 'Fax' => $fax, 'Delete' => false, 'RemoveParentLinks' => false, 'DateLastModified' => date('c'))), 'RelatedBranches' => array('BranchResult' => array('BranchName' => $company, 'BranchLabel' => $company, 'CompanyName' => $company, 'EntityID' => 0, 'IsPrimary' => true, 'BranchID' => 0, 'Delete' => false)))));
$entityid = $setperson->EntityID;
} else {
$findcompany = $worketc->FindCompanies(array('keywords' => $company));
$company_id = $findcompany->Company->Branches->Branch->BranchID;
$setperson = $worketc->SetPerson(array('person' => array('Title' => $title, 'FirstName' => $firstname, 'MiddleName' => '', 'Surname' => $lastname, 'Gender' => $newgender, 'EntityID' => $entity, 'LastActivity' => date('c'), 'DateLastModified' => date('c'), 'CreationDate' => date('c'), 'Email' => $email_address, 'CustomerCredentials' => 'SupportPersonal', 'Delete' => false, 'RemoveParentLinks' => false, 'OwnerID' => $OwnerID, 'SupplierRate' => 3.1, 'SupplierUnit' => 'None', 'Website' => $website, 'Addresses' => array('Address' => array('AddressID' => $addid, 'AddressType' => 'Home', 'Street' => $street_address, 'Suburb' => $city, 'StateOrProv' => $state, 'PostalCode' => $postcode, 'Country' => tep_get_country_name($country), 'Phone' => $telephone, 'PhoneExt' => $customers_telephone_ext, 'Fax' => $fax, 'Delete' => false, 'RemoveParentLinks' => false, 'DateLastModified' => date('c'))), 'RelatedBranches' => array('BranchResult' => array('BranchName' => $company, 'BranchLabel' => $company, 'CompanyName' => $company, 'EntityID' => $entity, 'IsPrimary' => true, 'BranchID' => 0, 'Delete' => false)))));
$entityid = $entity;
}
$worketc->EntityAddTag(array('EntityID' => $entityid, 'Tag' => "Registered Online"));
}
//end etc
if ($error == false) {
$sql_data_array = array('customers_firstname' => $firstname, 'referral' => $referral, 'referral_other' => $referral_other, 'customers_lastname' => $lastname, 'customers_email_address' => $email_address, 'customers_telephone' => $telephone, 'customers_telephone_ext' => $customers_telephone_ext, 'customers_fax' => $fax, 'customers_newsletter' => $newsletter, 'customers_group' => $group, 'website' => $website, 'title' => $title, 'st' => $st, 'ip' => $_SERVER['REMOTE_ADDR'], 'customers_password' => tep_encrypt_password($password));
tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);
$customer_id = tep_db_insert_id();
if (WORKETC_ENABLE == 'True' && tep_connect_worketc() != 0) {
$sql_data_array2 = array('customer_id' => $customer_id, 'tag_id' => 1);
tep_db_perform('customers_to_tag', $sql_data_array2);
}
$sql_data_array = array('customers_id' => $customer_id, 'entry_firstname' => $firstname, 'entry_lastname' => $lastname, 'entry_street_address' => $street_address, 'entry_postcode' => $postcode, 'entry_city' => $city, 'entry_country_id' => $country);
$sql_data_array['entry_company'] = $company;
$sql_data_array['entry_zone_id'] = '0';
$sql_data_array['entry_state'] = $state;
tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
$address_id = tep_db_insert_id();
tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int) $address_id . "' where customers_id = '" . (int) $customer_id . "'");
tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int) $customer_id . "', '0', now())");
if (SESSION_RECREATE == 'True') {
开发者ID:rongandat,项目名称:scalaprj,代码行数:31,代码来源:cya_ajax.php
示例8: elseif
}
}
}
if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
$error = true;
$messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);
}
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 == false) {
$sql_data_array = array('customers_firstname' => $firstname, 'customers_lastname' => $lastname, 'customers_email_address' => $email_address, 'customers_telephone' => $telephone, 'customers_fax' => $fax, 'customers_newsletter' => $newsletter, 'customers_password' => tep_encrypt_password($password));
if (ACCOUNT_GENDER == 'true') {
$sql_data_array['customers_gender'] = $gender;
}
if (ACCOUNT_DOB == 'true') {
$sql_data_array['customers_dob'] = tep_date_raw($dob);
}
tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);
$customer_id = tep_db_insert_id();
$sql_data_array = array('customers_id' => $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;
}
if (ACCOUNT_COMPANY == 'true') {
$sql_data_array['entry_company'] = $company;
}
开发者ID:laiello,项目名称:hotel-os,代码行数:31,代码来源:create_account.php
示例9: elseif
}
if ($error == true) {
OSCOM::redirect('password_forgotten.php');
}
if (isset($_GET['action']) && $_GET['action'] == 'process' && isset($_POST['formid']) && $_POST['formid'] == $_SESSION['sessiontoken']) {
$password_new = HTML::sanitize($_POST['password']);
$password_confirmation = HTML::sanitize($_POST['confirmation']);
if (strlen($password_new) < ENTRY_PASSWORD_MIN_LENGTH) {
$error = true;
$messageStack->add('password_reset', ENTRY_PASSWORD_NEW_ERROR);
} elseif ($password_new != $password_confirmation) {
$error = true;
$messageStack->add('password_reset', ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING);
}
if ($error == false) {
$OSCOM_Db->save('customers', ['customers_password' => tep_encrypt_password($password_new)], ['customers_id' => $Qcheck->valueInt('customers_id')]);
$OSCOM_Db->save('customers_info', ['customers_info_date_account_last_modified' => 'now()', 'password_reset_key' => 'null', 'password_reset_date' => 'null'], ['customers_info_id' => $Qcheck->valueInt('customers_id')]);
$messageStack->add_session('login', SUCCESS_PASSWORD_RESET, 'success');
OSCOM::redirect('login.php', '', 'SSL');
}
}
$breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('login.php', '', 'SSL'));
$breadcrumb->add(NAVBAR_TITLE_2);
require 'includes/template_top.php';
?>
<div class="page-header">
<h1><?php
echo HEADING_TITLE;
?>
</h1>
开发者ID:Akofelaz,项目名称:oscommerce2,代码行数:31,代码来源:password_reset.php
示例10: tep_session_unregister
break;
case 'logoff':
tep_session_unregister('selected_box');
tep_session_unregister('admin');
if (isset($HTTP_SERVER_VARS['PHP_AUTH_USER']) && !empty($HTTP_SERVER_VARS['PHP_AUTH_USER']) && isset($HTTP_SERVER_VARS['PHP_AUTH_PW']) && !empty($HTTP_SERVER_VARS['PHP_AUTH_PW'])) {
tep_session_register('auth_ignore');
$auth_ignore = true;
}
tep_redirect(tep_href_link(FILENAME_DEFAULT));
break;
case 'create':
$check_query = tep_db_query("select id from " . TABLE_ADMINISTRATORS . " limit 1");
if (tep_db_num_rows($check_query) == 0) {
$username = tep_db_prepare_input($HTTP_POST_VARS['username']);
$password = tep_db_prepare_input($HTTP_POST_VARS['password']);
tep_db_query("insert into " . TABLE_ADMINISTRATORS . " (user_name, user_password) values ('" . tep_db_input($username) . "', '" . tep_db_input(tep_encrypt_password($password)) . "')");
}
tep_redirect(tep_href_link(FILENAME_LOGIN));
break;
}
}
$languages = tep_get_languages();
$languages_array = array();
$languages_selected = DEFAULT_LANGUAGE;
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
$languages_array[] = array('id' => $languages[$i]['code'], 'text' => $languages[$i]['name']);
if ($languages[$i]['directory'] == $language) {
$languages_selected = $languages[$i]['code'];
}
}
$admins_check_query = tep_db_query("select id from " . TABLE_ADMINISTRATORS . " limit 1");
开发者ID:wrtcoder,项目名称:mini_isp,代码行数:31,代码来源:login.php
示例11: elseif
if (!isset($_POST['password']) || strlen(trim($_POST['password'])) < ACCOUNT_PASSWORD) {
$messageStack->add('create_account', ENTRY_PASSWORD_ERROR);
} elseif (!isset($_POST['confirmation']) || trim($_POST['password']) != trim($_POST['confirmation'])) {
$messageStack->add('create_account', ENTRY_PASSWORD_ERROR_NOT_MATCHING);
}
if ($messageStack->size('create_account') === 0) {
$osC_Database->startTransaction();
$Qcustomer = $osC_Database->query('insert into :table_customers (customers_firstname, customers_lastname, customers_email_address, customers_newsletter, customers_status, customers_ip_address, customers_password, customers_gender, customers_dob) values (:customers_firstname, :customers_lastname, :customers_email_address, :customers_newsletter, :customers_status, :customers_ip_address, :customers_password, :customers_gender, :customers_dob)');
$Qcustomer->bindRaw(':table_customers', TABLE_CUSTOMERS);
$Qcustomer->bindValue(':customers_firstname', trim($_POST['firstname']));
$Qcustomer->bindValue(':customers_lastname', trim($_POST['lastname']));
$Qcustomer->bindValue(':customers_email_address', trim($_POST['email_address']));
$Qcustomer->bindValue(':customers_newsletter', isset($_POST['newsletter']) && $_POST['newsletter'] == '1' ? '1' : '');
$Qcustomer->bindValue(':customers_status', '1');
$Qcustomer->bindValue(':customers_ip_address', tep_get_ip_address());
$Qcustomer->bindValue(':customers_password', tep_encrypt_password(trim($_POST['password'])));
$Qcustomer->bindValue(':customers_gender', ACCOUNT_GENDER > -1 && isset($_POST['gender']) && ($_POST['gender'] == 'm' || $_POST['gender'] == 'f') ? $_POST['gender'] : '');
$Qcustomer->bindValue(':customers_dob', ACCOUNT_DATE_OF_BIRTH > -1 ? date('Ymd', $dob) : '');
$Qcustomer->execute();
if ($Qcustomer->affectedRows() === 1) {
$customer_id = $osC_Database->nextID();
$Qci = $osC_Database->query('insert into :table_customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values (:customers_info_id, :customers_info_number_of_logons, :customers_info_date_account_created)');
$Qci->bindRaw(':table_customers_info', TABLE_CUSTOMERS_INFO);
$Qci->bindInt(':customers_info_id', $customer_id);
$Qci->bindInt(':customers_info_number_of_logons', 0);
$Qci->bindRaw(':customers_info_date_account_created', 'now()');
$Qci->execute();
if ($Qci->affectedRows() === 1) {
$osC_Database->commitTransaction();
if (SERVICE_SESSION_REGENERATE_ID == 'True') {
$osC_Session->recreate();
开发者ID:itnovator,项目名称:oscommerce_cvs,代码行数:31,代码来源:create_account.php
示例12: randomize
function randomize()
{
$salt = "ABCDEFGHIJKLMNOPQRSTUVWXWZabchefghjkmnpqrstuvwxyz0123456789";
srand((double) microtime() * 1000000);
$i = 0;
while ($i <= 7) {
$num = rand() % 33;
$tmp = substr($salt, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return $pass;
}
$makePassword = randomize();
tep_mail($check_admin['check_firstname'] . ' ' . $check_admin['admin_lastname'], $check_admin['check_email_address'], ADMIN_EMAIL_SUBJECT, sprintf(ADMIN_EMAIL_TEXT, $check_admin['check_firstname'], HTTP_SERVER . DIR_WS_ADMIN, $check_admin['check_email_address'], $makePassword, STORE_OWNER), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
tep_db_query("update " . TABLE_ADMIN . " set admin_password = '" . tep_encrypt_password($makePassword) . "' where admin_id = '" . $check_admin['check_id'] . "'");
}
}
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php
echo HTML_PARAMS;
?>
>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php
echo CHARSET;
?>
">
<title><?php
开发者ID:eosc,项目名称:EosC-2.3,代码行数:31,代码来源:password_forgotten.php
示例13: tep_db_prepare_input
$password_confirmation = tep_db_prepare_input($_POST['password_confirmation']);
$error = false;
if (strlen($password_current) < ENTRY_PASSWORD_MIN_LENGTH) {
$error = true;
$messageStack->add('a_password', ENTRY_PASSWORD_CURRENT_ERROR);
} elseif (strlen($password_new) < ENTRY_PASSWORD_MIN_LENGTH) {
$error = true;
$messageStack->add('a_password', ENTRY_PASSWORD_NEW_ERROR);
} elseif ($password_new != $password_confirmation) {
$error = true;
$messageStack->add('a_password', ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING);
}
if ($error == false) {
$check_affiliate_query = tep_db_query("select affiliate_password from " . TABLE_AFFILIATE . " where affiliate_id = '" . (int) $affiliate_id . "'");
$check_affiliate = tep_db_fetch_array($check_affiliate_query);
if (tep_validate_password($password_current, $check_affiliate['affiliate_password'])) {
tep_db_query("update " . TABLE_AFFILIATE . " set affiliate_password = '" . tep_encrypt_password($password_new) . "' where affiliate_id = '" . (int) $affiliate_id . "'");
$messageStack->add_session('account', SUCCESS_PASSWORD_UPDATED, 'success');
tep_redirect(tep_href_link(FILENAME_AFFILIATE_SUMMARY, '', 'SSL'));
} else {
$error = true;
$messageStack->add('a_password', ERROR_CURRENT_PASSWORD_NOT_MATCHING);
}
}
}
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_AFFILIATE_PASSWORD, '', 'SSL'));
$content = affiliate_password;
include bts_select('main');
// BTSv1.5
require DIR_WS_INCLUDES . 'application_bottom.php';
开发者ID:digideskio,项目名称:oscmax2,代码行数:31,代码来源:affiliate_password.php
示例14: randomize
} else {
function randomize()
{
$salt = "abchefghjkmnpqrstuvwxyz0123456789";
srand((double) microtime() * 1000000);
$i = 0;
while ($i <= 7) {
$num = rand() % 33;
$tmp = substr($salt, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return $pass;
}
$makePassword = randomize();
$sql_data_array = array('admin_groups_id' => tep_db_prepare_input($_POST['admin_groups_id']), 'admin_firstname' => tep_db_prepare_input($_POST['admin_firstname']), 'admin_lastname' => tep_db_prepare_input($_POST['admin_lastname']), 'admin_email_address' => tep_db_prepare_input($_POST['admin_email_address']), 'admin_password' => tep_encrypt_password($makePassword), 'admin_created' => 'now()');
tep_db_perform(TABLE_ADMIN, $sql_data_array);
$admin_id = tep_db_insert_id();
tep_mail($_POST['admin_firstname'] . ' ' . $_POST['admin_lastname'], $_POST['admin_email_address'], ADMIN_EMAIL_SUBJECT, sprintf(ADMIN_EMAIL_TEXT, $_POST['admin_firstname'], HTTP_SERVER . DIR_WS_ADMIN, $_POST['admin_email_address'], $makePassword, STORE_OWNER), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
tep_redirect(tep_href_link(FILENAME_ADMIN_MEMBERS, 'page=' . $_GET['page'] . '&mID=' . $admin_id));
}
break;
case 'member_edit':
$admin_id = tep_db_prepare_input($_POST['admin_id']);
$hiddenPassword = '-hidden-';
$stored_email[] = 'NONE';
$check_email_query = tep_db_query("select admin_email_address from " . TABLE_ADMIN . " where admin_id <> " . $admin_id . "");
while ($check_email = tep_db_fetch_array($check_email_query)) {
$stored_email[] = $check_email['admin_email_address'];
}
if (in_array($_POST['admin_email_address'], $stored_email)) {
开发者ID:eosc,项目名称:EosC-2.3,代码行数:31,代码来源:admin_members.php
示例15: bts_select
Copyright 2006 osCMax2002 -2003 osCommerce
Released under the GNU General Public License
*/
// Most of this file is changed or moved to BTS - Basic Template System - format.
// For adding in contribution or modification - parts of this file has been moved to: catalog\templates\fallback\contents\<filename>.tpl.php as a default (sub 'fallback' with your current template to see if there is a template specife change).
// catalog\templates\fallback\contents\<filename>.tpl.php as a default (sub 'fallback' with your current template to see if there is a template specife change).
// (Sub 'fallback' with your current template to see if there is a template specific file.)
require 'includes/application_top.php';
require bts_select('language', FILENAME_AFFILIATE_PASSWORD_FORGOTTEN);
if (isset($_GET['action']) && $_GET['action'] == 'process') {
$check_affiliate_query = tep_db_query("select affiliate_firstname, affiliate_lastname, affiliate_password, affiliate_id from " . TABLE_AFFILIATE . " where affiliate_email_address = '" . $_POST['email_address'] . "'");
if (tep_db_num_rows($check_affiliate_query)) {
$check_affiliate = tep_db_fetch_array($check_affiliate_query);
// Crypted password mods - create a new password, update the database and mail it to them
$newpass = tep_create_random_value(ENTRY_PASSWORD_MIN_LENGTH);
$crypted_password = tep_encrypt_password($newpass);
tep_db_query("update " . TABLE_AFFILIATE . " set affiliate_password = '" . $crypted_password . "' where affiliate_id = '" . $check_affiliate['affiliate_id'] . "'");
tep_mail($check_affiliate['affiliate_firstname'] . " " . $check_affiliate['affiliate_lastname'], $_POST['email_address'], sprintf(EMAIL_PASSWORD_REMINDER_SUBJECT, STORE_NAME), nl2br(sprintf(EMAIL_PASSWORD_REMINDER_BODY, STORE_NAME, $newpass)), STORE_OWNER, AFFILIATE_EMAIL_ADDRESS);
tep_redirect(tep_href_link(FILENAME_AFFILIATE, 'info_message=' . urlencode(TEXT_PASSWORD_SENT), 'SSL', true, false));
} else {
tep_redirect(tep_href_link(FILENAME_AFFILIATE_PASSWORD_FORGOTTEN, 'email=nonexistent', 'SSL'));
}
} else {
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_AFFILIATE, '', 'SSL'));
$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_AFFILIATE_PASSWORD_FORGOTTEN, '', 'SSL'));
$content = affiliate_password_forgotten;
include bts_select('main');
// BTSv1.5
require DIR_WS_INCLUDES . 'application_bottom.php';
}
开发者ID:digideskio,项目名称:oscmax2,代码行数:30,代码来源:affiliate_password_forgotten.php
示例16: setCheckoutAddress
function setCheckoutAddress($action)
{
global $order, $onepage, $customer_id;
if ($action == 'setSendTo' && !tep_not_null($_POST['shipping_country'])) {
$prefix = 'billing_';
} else {
$prefix = $action == 'setSendTo' ? 'shipping_' : 'billing_';
}
if (ACCOUNT_GENDER == 'true') {
$gender = $_POST[$prefix . 'gender'];
}
if (ACCOUNT_COMPANY == 'true') {
$company = tep_db_prepare_input($_POST[$prefix . 'company']);
}
if (ACCOUNT_COMPANY == 'true') {
$btwnr = tep_db_prepare_input($_POST['btwnr']);
}
if (ACCOUNT_SUBURB == 'true') {
$suburb = tep_db_prepare_input($_POST[$prefix . 'suburb']);
}
if (!isset($_POST[$prefix . 'zipcode'])) {
if (ONEPAGE_AUTO_SHOW_BILLING_SHIPPING == 'True') {
$zip_code = tep_db_prepare_input(ONEPAGE_AUTO_SHOW_DEFAULT_ZIP);
}
} else {
$zip_code = tep_db_prepare_input($_POST[$prefix . 'zipcode']);
}
if (!isset($_POST[$prefix . 'country'])) {
if (ONEPAGE_AUTO_SHOW_BILLING_SHIPPING == 'True') {
$country = tep_db_prepare_input(ONEPAGE_AUTO_SHOW_DEFAULT_COUNTRY);
}
} else {
$country = tep_db_prepare_input($_POST[$prefix . 'country']);
}
if (ACCOUNT_STATE == 'true') {
if (isset($_POST[$prefix . 'zone_id'])) {
$zone_id = tep_db_prepare_input($_POST[$prefix . 'zone_id']);
} else {
if (!isset($_POST[$prefix . 'zone_id'])) {
if (ONEPAGE_AUTO_SHOW_BILLING_SHIPPING == 'True') {
if ($country == ONEPAGE_AUTO_SHOW_DEFAULT_COUNTRY) {
$zone_id = tep_db_prepare_input(ONEPAGE_AUTO_SHOW_DEFAULT_STATE);
}
}
} else {
$zone_id = false;
}
}
if ($prefix == 'shipping_') {
$state = tep_db_prepare_input($_POST['delivery_state']);
} else {
$state = tep_db_prepare_input($_POST[$prefix . 'state']);
}
$zone_name = '';
$zone_id = 0;
$check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int) $country . "'");
$check = tep_db_fetch_array($check_query);
$entry_state_has_zones = $check['total'] > 0;
if ($entry_state_has_zones == true) {
$zone_query = tep_db_query("select distinct zone_id, zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int) $country . "' and (zone_name = '" . tep_db_input($state) . "' or zone_code = '" . tep_db_input($state) . "')");
if (tep_db_num_rows($zone_query) == 1) {
$zone = tep_db_fetch_array($zone_query);
$zone_id = $zone['zone_id'];
$zone_name = $zone['zone_name'];
}
}
}
$tva_query = tep_db_query('select ab.billing_tva_intracom from customers c, ' . TABLE_ADDRESS_BOOK . ' ab where c.customers_id = "' . (int) $customer_id . '" and ab.customers_id = "' . (int) $customer_id . '" and c.customers_default_address_id = ab.address_book_id');
$tva = tep_db_fetch_array($tva_query);
$QcInfo = tep_db_query('select * from ' . TABLE_COUNTRIES . ' where countries_id = "' . $country . '"');
$cInfo = tep_db_fetch_array($QcInfo);
if ($action == 'setBillTo') {
$varName = 'billing';
if (ACCOUNT_DOB == 'true' && tep_not_null($_POST[$prefix . 'dob'])) {
$dob = $_POST[$prefix . 'dob'];
}
} else {
$varName = 'delivery';
}
if ($action == 'setBillTo') {
if (ACCOUNT_DOB == 'true') {
$dob = tep_db_prepare_input($_POST[$prefix . 'dob']);
$order->customer['dob'] = $dob;
$onepage['customer']['dob'] = $dob;
}
if (tep_not_null($_POST['billing_email_address'])) {
$order->customer['email_address'] = tep_db_prepare_input($_POST['billing_email_address']);
$onepage['customer']['email_address'] = $order->customer['email_address'];
$order->{$varName}['email_address'] = $order->customer['email_address'];
}
if (tep_not_null($_POST['billing_telephone'])) {
$order->customer['telephone'] = tep_db_prepare_input($_POST['billing_telephone']);
$onepage['customer']['telephone'] = $order->customer['telephone'];
$order->{$varName}['telephone'] = $order->customer['telephone'];
}
if (tep_not_null($_POST['password'])) {
$onepage['customer']['password'] = tep_encrypt_password($_POST['password']);
}
}
$order->{$varName}['gender'] = $gender;
//.........这里部分代码省略.........
开发者ID:CristianCCIT,项目名称:shop4office,代码行数:101,代码来源:onepage_checkout.php
示例17: create_customer
//.........这里部分代码省略.........
}
}
if ($this->options['conditions_create_account'] != 'Uitgeschakeld' && CONDITIONS_MUST_ACCEPT == 'true') {
$terms = mysql_real_escape_string($data['TermsAgree']);
if (!$terms) {
$error = true;
$errors['terms'] = Translate('U moet akkoord gaan met de algemene voorwaarden voor u een account kan aanmaken!');
}
}
//Check if error
if ($error) {
return array('errors' => $errors);
} else {
if ($this->options['create_account_mode'] == 'Direct access' || $this->options['create_account_mode'] == 'Moderated access') {
/********************************/
/* Direct Or Moderated access */
/********************************/
if ($this->options['create_account_mode'] == 'Moderated access') {
$status = '0';
} else {
$status = '1';
}
//Newsletter
$lists = PHPLIST_LISTNUMBERS;
$lists = explode(';', $lists);
$newsletter = false;
foreach (
|
请发表评论