Example #1
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 #2
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'));
         }
     }
 }