Exemplo n.º 1
0
 function _process()
 {
     global $osC_Database, $osC_Session, $osC_Language, $osC_ShoppingCart, $messageStack, $osC_Customer, $osC_NavigationHistory, $toC_Wishlist;
     if (osC_Account::checkEntry($_POST['email_address'])) {
         if (osC_Account::checkPassword($_POST['password'], $_POST['email_address'])) {
             if (osC_Account::checkStatus($_POST['email_address'])) {
                 if (SERVICE_SESSION_REGENERATE_ID == '1') {
                     $osC_Session->recreate();
                 }
                 $osC_Customer->setCustomerData(osC_Account::getID($_POST['email_address']));
                 $Qupdate = $osC_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', $osC_Customer->getID());
                 $Qupdate->execute();
                 $osC_ShoppingCart->synchronizeWithDatabase();
                 $toC_Wishlist->synchronizeWithDatabase();
                 $osC_NavigationHistory->removeCurrentPage();
                 if ($osC_NavigationHistory->hasSnapshot()) {
                     $osC_NavigationHistory->redirectToSnapshot();
                 } else {
                     osc_redirect(osc_href_link(FILENAME_DEFAULT, null, 'AUTO'));
                 }
             } else {
                 $messageStack->add('login', $osC_Language->get('error_login_status_disabled'));
             }
         } else {
             $messageStack->add('login', $osC_Language->get('error_login_no_match'));
         }
     } else {
         $messageStack->add('login', $osC_Language->get('error_login_no_match'));
     }
 }