protected function _process()
 {
     global $lC_MessageStack, $lC_Database, $lC_Language, $lC_Vqmod;
     require_once $lC_Vqmod->modCheck('includes/classes/account.php');
     $Qcheck = $lC_Database->query('select customers_id, customers_firstname, customers_lastname, customers_gender, customers_email_address, customers_password from :table_customers where customers_email_address = :customers_email_address limit 1');
     $Qcheck->bindTable(':table_customers', TABLE_CUSTOMERS);
     $Qcheck->bindValue(':customers_email_address', $_POST['email_address']);
     $Qcheck->execute();
     if ($Qcheck->numberOfRows() === 1) {
         $password = lc_create_random_string(ACCOUNT_PASSWORD);
         if (lC_Account::savePassword($password, $Qcheck->valueInt('customers_id'))) {
             if (ACCOUNT_GENDER > -1) {
                 if ($data['gender'] == 'm') {
                     $email_text = sprintf($lC_Language->get('email_addressing_gender_male'), $Qcheck->valueProtected('customers_lastname')) . "\n\n";
                 } else {
                     $email_text = sprintf($lC_Language->get('email_addressing_gender_female'), $Qcheck->valueProtected('customers_lastname')) . "\n\n";
                 }
             } else {
                 $email_text = sprintf($lC_Language->get('email_addressing_gender_unknown'), $Qcheck->valueProtected('customers_firstname') . ' ' . $Qcheck->valueProtected('customers_lastname')) . "\n\n";
             }
             $email_text .= sprintf($lC_Language->get('email_password_reminder_body'), getenv('REMOTE_ADDR'), STORE_NAME, $password, STORE_OWNER_EMAIL_ADDRESS);
             lc_email($Qcheck->valueProtected('customers_firstname') . ' ' . $Qcheck->valueProtected('customers_lastname'), $Qcheck->valueProtected('customers_email_address'), sprintf($lC_Language->get('email_password_reminder_subject'), STORE_NAME), $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
         }
         lc_redirect(lc_href_link(FILENAME_ACCOUNT, 'login&success=' . urlencode($lC_Language->get('success_password_forgotten_sent')), 'SSL'));
     } else {
         $lC_MessageStack->add('password_forgotten', $lC_Language->get('error_password_forgotten_no_email_address_found'));
     }
 }
Example #2
0
 protected function _process()
 {
     global $lC_Database, $lC_Session, $lC_Language, $lC_ShoppingCart, $lC_MessageStack, $lC_Customer, $lC_NavigationHistory, $lC_Vqmod;
     require $lC_Vqmod->modCheck('includes/classes/account.php');
     if (lC_Account::checkEntry($_POST['email_address'])) {
         if (lC_Account::checkPassword($_POST['password'], $_POST['email_address'])) {
             if (SERVICE_SESSION_REGENERATE_ID == '1') {
                 $lC_Session->recreate();
             }
             $lC_Customer->setCustomerData(lC_Account::getID($_POST['email_address']));
             $Qupdate = $lC_Database->query('update :table_customers set date_last_logon = :date_last_logon, number_of_logons = number_of_logons+1 where customers_id = :customers_id');
             $Qupdate->bindTable(':table_customers', TABLE_CUSTOMERS);
             $Qupdate->bindRaw(':date_last_logon', 'now()');
             $Qupdate->bindInt(':customers_id', $lC_Customer->getID());
             $Qupdate->execute();
             if ($lC_ShoppingCart->hasContents() === true) {
                 $lC_ShoppingCart->synchronizeWithDatabase();
             }
             $lC_NavigationHistory->removeCurrentPage();
             lC_Cache::clearAll();
             if ($lC_NavigationHistory->hasSnapshot()) {
                 $lC_NavigationHistory->redirectToSnapshot();
             } else {
                 lc_redirect(lc_href_link(FILENAME_DEFAULT, null, 'AUTO'));
             }
         } else {
             $lC_MessageStack->add('login', $lC_Language->get('error_login_no_match'));
         }
     } else {
         $lC_MessageStack->add('login', $lC_Language->get('error_login_no_match'));
     }
 }
Example #3
0
 protected function _process()
 {
     global $lC_MessageStack, $lC_Database, $lC_Language, $lC_Customer, $lC_Vqmod;
     require_once $lC_Vqmod->modCheck('includes/classes/account.php');
     $data = array();
     if (ACCOUNT_GENDER >= 0) {
         if (isset($_POST['gender']) && ($_POST['gender'] == 'm' || $_POST['gender'] == 'f')) {
             $data['gender'] = $_POST['gender'];
         } else {
             $lC_MessageStack->add('account_edit', $lC_Language->get('field_customer_gender_error'));
         }
     }
     if (isset($_POST['firstname']) && strlen(trim($_POST['firstname'])) >= ACCOUNT_FIRST_NAME) {
         $data['firstname'] = $_POST['firstname'];
     } else {
         $lC_MessageStack->add('account_edit', sprintf($lC_Language->get('field_customer_first_name_error'), ACCOUNT_FIRST_NAME));
     }
     if (isset($_POST['lastname']) && strlen(trim($_POST['lastname'])) >= ACCOUNT_LAST_NAME) {
         $data['lastname'] = $_POST['lastname'];
     } else {
         $lC_MessageStack->add('account_edit', sprintf($lC_Language->get('field_customer_last_name_error'), ACCOUNT_LAST_NAME));
     }
     if (ACCOUNT_DATE_OF_BIRTH == '1') {
         $dateParts = explode("/", $_POST['dob']);
         if (isset($_POST['dob']) && checkdate($dateParts[0], $dateParts[1], $dateParts[2])) {
             $data['dob'] = @mktime(0, 0, 0, $dateParts[0], $dateParts[1], $dateParts[2]);
         } else {
             $lC_MessageStack->add('account_edit', $lC_Language->get('field_customer_date_of_birth_error'));
         }
     }
     if (isset($_POST['email_address']) && strlen(trim($_POST['email_address'])) >= ACCOUNT_EMAIL_ADDRESS) {
         if (lc_validate_email_address($_POST['email_address'])) {
             if (lC_Account::checkDuplicateEntry($_POST['email_address']) === false) {
                 $data['email_address'] = $_POST['email_address'];
             } else {
                 $lC_MessageStack->add('account_edit', $lC_Language->get('field_customer_email_address_exists_error'));
             }
         } else {
             $lC_MessageStack->add('account_edit', $lC_Language->get('field_customer_email_address_check_error'));
         }
     } else {
         $lC_MessageStack->add('account_edit', sprintf($lC_Language->get('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS));
     }
     if ($lC_MessageStack->size('account_edit') === 0) {
         if (lC_Account::saveEntry($data)) {
             // reset the session variables
             if (ACCOUNT_GENDER > -1) {
                 $lC_Customer->setGender($data['gender']);
             }
             $lC_Customer->setFirstName(trim($data['firstname']));
             $lC_Customer->setLastName(trim($data['lastname']));
             $lC_Customer->setEmailAddress($data['email_address']);
             $lC_MessageStack->add('account', $lC_Language->get('success_account_updated'), 'success');
         }
         lc_redirect(lc_href_link(FILENAME_ACCOUNT, null, 'SSL'));
     }
 }
Example #4
0
 protected function _process()
 {
     global $lC_MessageStack, $lC_Database, $lC_Language, $lC_Vqmod;
     require_once $lC_Vqmod->modCheck('includes/classes/account.php');
     if (!isset($_POST['password_current']) || strlen(trim($_POST['password_current'])) < ACCOUNT_PASSWORD) {
         $lC_MessageStack->add('account_password', sprintf($lC_Language->get('field_customer_password_current_error'), ACCOUNT_PASSWORD));
     } elseif (!isset($_POST['password_new']) || strlen(trim($_POST['password_new'])) < ACCOUNT_PASSWORD) {
         $lC_MessageStack->add('account_password', sprintf($lC_Language->get('field_customer_password_new_error'), ACCOUNT_PASSWORD));
     } elseif (!isset($_POST['password_confirmation']) || trim($_POST['password_new']) != trim($_POST['password_confirmation'])) {
         $lC_MessageStack->add('account_password', $lC_Language->get('field_customer_password_new_mismatch_with_confirmation_error'));
     }
     if ($lC_MessageStack->size('account_password') === 0) {
         if (lC_Account::checkPassword(trim($_POST['password_current']))) {
             if (lC_Account::savePassword(trim($_POST['password_new']))) {
                 lc_redirect(lc_href_link(FILENAME_ACCOUNT, 'success=' . urlencode($lC_Language->get('success_password_updated')), 'SSL'));
             } else {
                 $lC_MessageStack->add('account_password', sprintf($lC_Language->get('field_customer_password_new_error'), ACCOUNT_PASSWORD));
             }
         } else {
             $lC_MessageStack->add('account_password', $lC_Language->get('error_current_password_not_matching'));
         }
     }
 }
Example #5
0
 protected function _process()
 {
     global $lC_MessageStack, $lC_Database, $lC_Language, $lC_Customer, $lC_Vqmod;
     require $lC_Vqmod->modCheck('includes/classes/account.php');
     $data = array();
     if (DISPLAY_PRIVACY_CONDITIONS == '1') {
         if (isset($_POST['privacy_conditions']) && ($_POST['privacy_conditions'] == '1' || $_POST['privacy_conditions'] == 'on')) {
         } else {
             $lC_MessageStack->add($this->_module, $lC_Language->get('error_privacy_statement_not_accepted'));
         }
     }
     if (ACCOUNT_GENDER >= 0) {
         if (isset($_POST['gender']) && ($_POST['gender'] == 'm' || $_POST['gender'] == 'f')) {
             $data['gender'] = $_POST['gender'];
         } else {
             $lC_MessageStack->add($this->_module, $lC_Language->get('field_customer_gender_error'));
         }
     }
     if (isset($_POST['firstname']) && strlen(trim($_POST['firstname'])) >= ACCOUNT_FIRST_NAME) {
         $data['firstname'] = $_POST['firstname'];
     } else {
         $lC_MessageStack->add($this->_module, sprintf($lC_Language->get('field_customer_first_name_error'), ACCOUNT_FIRST_NAME));
     }
     if (isset($_POST['lastname']) && strlen(trim($_POST['lastname'])) >= ACCOUNT_LAST_NAME) {
         $data['lastname'] = $_POST['lastname'];
     } else {
         $lC_MessageStack->add($this->_module, sprintf($lC_Language->get('field_customer_last_name_error'), ACCOUNT_LAST_NAME));
     }
     if (isset($_POST['newsletter']) && $_POST['newsletter'] == '1') {
         $data['newsletter'] = 1;
     } else {
         $data['newsletter'] = '';
     }
     if (ACCOUNT_DATE_OF_BIRTH == '1') {
         if (isset($_POST['dob']) && $_POST['dob'] != NULL) {
             $dateParts = explode("/", $_POST['dob']);
         } else {
             $dateParts = array($_POST['dob_days'], $_POST['dob_months'], $_POST['dob_years']);
         }
         if (isset($dateParts[1]) && isset($dateParts[0]) && isset($dateParts[2]) && checkdate($dateParts[0], $dateParts[1], $dateParts[2])) {
             $data['dob'] = @mktime(0, 0, 0, $dateParts[0], $dateParts[1], $dateParts[2]);
         } else {
             $lC_MessageStack->add($this->_module, $lC_Language->get('field_customer_date_of_birth_error'));
         }
     }
     if (isset($_POST['email_address']) && strlen(trim($_POST['email_address'])) >= ACCOUNT_EMAIL_ADDRESS) {
         if (lc_validate_email_address($_POST['email_address'])) {
             if (lC_Account::checkDuplicateEntry($_POST['email_address']) === false) {
                 $data['email_address'] = $_POST['email_address'];
             } else {
                 $lC_MessageStack->add($this->_module, $lC_Language->get('field_customer_email_address_exists_error'));
             }
         } else {
             $lC_MessageStack->add($this->_module, $lC_Language->get('field_customer_email_address_check_error'));
         }
     } else {
         $lC_MessageStack->add($this->_module, sprintf($lC_Language->get('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS));
     }
     if (isset($_POST['password']) === false || isset($_POST['password']) && strlen(trim($_POST['password'])) < ACCOUNT_PASSWORD) {
         $lC_MessageStack->add($this->_module, sprintf($lC_Language->get('field_customer_password_error'), ACCOUNT_PASSWORD));
     } elseif (isset($_POST['confirmation']) === false || isset($_POST['confirmation']) && trim($_POST['password']) != trim($_POST['confirmation'])) {
         $lC_MessageStack->add($this->_module, $lC_Language->get('field_customer_password_mismatch_with_confirmation'));
     } else {
         $data['password'] = $_POST['password'];
     }
     if ($lC_MessageStack->size($this->_module) === 0) {
         if (lC_Account::createEntry($data)) {
             $lC_MessageStack->add('create', $lC_Language->get('success_account_updated'), 'success');
         }
         // added to redirect to keep customer in checkout stream
         foreach ($_SESSION['lC_NavigationHistory_data'] as $data) {
             foreach ($data as $page) {
                 foreach ($page as $key => $value) {
                     if ($key == 'shipping') {
                         $checkout = true;
                     }
                 }
             }
         }
         if ($checkout == true) {
             lc_redirect(lc_href_link(FILENAME_CHECKOUT, 'shipping&account_created=true', 'SSL'));
         } else {
             lc_redirect(lc_href_link(FILENAME_ACCOUNT, 'create=success', 'SSL'));
         }
     }
 }
Example #6
0
<?php

/**
  @package    catalog::templates::content
  @author     Loaded Commerce
  @copyright  Copyright 2003-2014 Loaded Commerce, LLC
  @copyright  Portions Copyright 2003 osCommerce
  @copyright  Template built on DevKit http://www.bootstraptor.com under GPL license 
  @license    https://github.com/loadedcommerce/loaded7/blob/master/LICENSE.txt
  @version    $Id: account_edit.php v1.0 2013-08-08 datazen $
*/
$Qaccount = lC_Account::getEntry();
?>
<!--content/info/account_edit.php start-->
<div class="row">
  <div class="col-sm-12 col-lg-12">
    <h1 class="page-title"><?php 
echo $lC_Template->getPageTitle();
?>
</h1>
    <?php 
if ($lC_MessageStack->size('account_edit') > 0) {
    echo '<div class="message-stack-container alert alert-error small-margin-bottom margin-left-neg">' . $lC_MessageStack->get('account_edit') . '</div>' . "\n";
}
?>
  </div>
  <div class="col-sm-12 col-lg-12">
    <form role="form" name="account_edit" id="account_edit" action="<?php 
echo lc_href_link(FILENAME_ACCOUNT, 'edit=save', 'SSL');
?>
" method="post" onsubmit="return check_form(account_edit);">