Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

757
 
814
 
814
 
account.php
_> 11 <?php
  22 /*
<> 3 -  $Id: account.php 757 2006-08-23 12:22:54Z hpdl $
   3+  $Id: account.php 814 2006-08-27 15:28:23Z hpdl $
44 
  55   osCommerce, Open Source E-Commerce Solutions
  66   http://www.oscommerce.com
     
 !
4141     function createEntry($data) {
  4242       global $osC_Database, $osC_Session, $osC_Language, $osC_ShoppingCart, $osC_Customer, $osC_NavigationHistory;
  4343 
<> 44 -      $osC_Database->startTransaction();
  45 -
  46 -      $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)');
   44+      $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, number_of_logons, date_account_created) values (:customers_firstname, :customers_lastname, :customers_email_address, :customers_newsletter, :customers_status, :customers_ip_address, :customers_password, :customers_gender, :customers_dob, :number_of_logons, :date_account_created)');
4745       $Qcustomer->bindTable(':table_customers', TABLE_CUSTOMERS);
  4846       $Qcustomer->bindValue(':customers_firstname', $data['firstname']);
  4947       $Qcustomer->bindValue(':customers_lastname', $data['lastname']);
     
 !
5452       $Qcustomer->bindValue(':customers_password', osc_encrypt_string($data['password']));
  5553       $Qcustomer->bindValue(':customers_gender', (((ACCOUNT_GENDER > -1) && isset($data['gender']) && (($data['gender'] == 'm') || ($data['gender'] == 'f'))) ? $data['gender'] : ''));
  5654       $Qcustomer->bindValue(':customers_dob', ((ACCOUNT_DATE_OF_BIRTH == '1') ? date('Ymd', $data['dob']) : ''));
<>  55+      $Qcustomer->bindInt(':number_of_logons', 0);
   56+      $Qcustomer->bindRaw(':date_account_created', 'now()');
5757       $Qcustomer->execute();
  5858 
  5959       if ($Qcustomer->affectedRows() === 1) {
  6060         $customer_id = $osC_Database->nextID();
  6161 
<> 62 -        $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)');
  63 -        $Qci->bindTable(':table_customers_info', TABLE_CUSTOMERS_INFO);
  64 -        $Qci->bindInt(':customers_info_id', $customer_id);
  65 -        $Qci->bindInt(':customers_info_number_of_logons', 0);
  66 -        $Qci->bindRaw(':customers_info_date_account_created', 'now()');
  67 -        $Qci->execute();
   62+        if (SERVICE_SESSION_REGENERATE_ID == '1') {
   63+          $osC_Session->recreate();
   64+        }
6865 
<> 69 -        if ($Qci->affectedRows() === 1) {
  70 -          $osC_Database->commitTransaction();
   66+        $osC_Customer->setCustomerData($customer_id);
7167 
<> 72 -          if (SERVICE_SESSION_REGENERATE_ID == '1') {
  73 -            $osC_Session->recreate();
  74 -          }
  75 -
  76 -          $osC_Customer->setCustomerData($customer_id);
  77 -
7868 // restore cart contents
<> 79 -          $osC_ShoppingCart->synchronizeWithDatabase();
   69+        $osC_ShoppingCart->synchronizeWithDatabase();
8070 
<> 81 -          $osC_NavigationHistory->removeCurrentPage();
   71+        $osC_NavigationHistory->removeCurrentPage();
8272 
  8373 // build the message content
<> 84 -          if ((ACCOUNT_GENDER > -1) && isset($data['gender'])) {
  85 -             if ($data['gender'] == 'm') {
  86 -               $email_text = sprintf($osC_Language->get('email_addressing_gender_male'), $osC_Customer->getLastName()) . "\n\n";
  87 -             } else {
  88 -               $email_text = sprintf($osC_Language->get('email_addressing_gender_female'), $osC_Customer->getLastName()) . "\n\n";
  89 -             }
  90 -          } else {
  91 -            $email_text = sprintf($osC_Language->get('email_addressing_gender_unknown'), $osC_Customer->getName()) . "\n\n";
  92 -          }
   74+        if ((ACCOUNT_GENDER > -1) && isset($data['gender'])) {
   75+           if ($data['gender'] == 'm') {
   76+             $email_text = sprintf($osC_Language->get('email_addressing_gender_male'), $osC_Customer->getLastName()) . "\n\n";
   77+           } else {
   78+             $email_text = sprintf($osC_Language->get('email_addressing_gender_female'), $osC_Customer->getLastName()) . "\n\n";
   79+           }
   80+        } else {
   81+          $email_text = sprintf($osC_Language->get('email_addressing_gender_unknown'), $osC_Customer->getName()) . "\n\n";
   82+        }
9383 
<> 94 -          $email_text .= sprintf($osC_Language->get('email_create_account_body'), STORE_NAME, STORE_OWNER_EMAIL_ADDRESS);
   84+        $email_text .= sprintf($osC_Language->get('email_create_account_body'), STORE_NAME, STORE_OWNER_EMAIL_ADDRESS);
9585 
<> 96 -          osc_email($osC_Customer->getName(), $osC_Customer->getEmailAddress(), sprintf($osC_Language->get('email_create_account_subject'), STORE_NAME), $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
   86+        osc_email($osC_Customer->getName(), $osC_Customer->getEmailAddress(), sprintf($osC_Language->get('email_create_account_subject'), STORE_NAME), $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
9787 
<> 98 -          return true;
  99 -        } else {
  100 -          $osC_Database->rollbackTransaction();
  101 -        }
  102 -      } else {
  103 -        $osC_Database->rollbackTransaction();
   88+        return true;
10489       }
  10590 
  10691       return false;
     
 !
10994     function saveEntry($data) {
  11095       global $osC_Database, $osC_Customer;
  11196 
<> 112 -      $Qcustomer = $osC_Database->query('update :table_customers set customers_gender = :customers_gender, customers_firstname = :customers_firstname, customers_lastname = :customers_lastname, customers_email_address = :customers_email_address, customers_dob = :customers_dob where customers_id = :customers_id');
   97+      $Qcustomer = $osC_Database->query('update :table_customers set customers_gender = :customers_gender, customers_firstname = :customers_firstname, customers_lastname = :customers_lastname, customers_email_address = :customers_email_address, customers_dob = :customers_dob, date_account_last_modified = :date_account_last_modified where customers_id = :customers_id');
11398       $Qcustomer->bindTable(':table_customers', TABLE_CUSTOMERS);
  11499       $Qcustomer->bindValue(':customers_gender', ((ACCOUNT_GENDER > -1) && isset($data['gender']) && (($data['gender'] == 'm') || ($data['gender'] == 'f'))) ? $data['gender'] : '');
  115100       $Qcustomer->bindValue(':customers_firstname', $data['firstname']);
  116101       $Qcustomer->bindValue(':customers_lastname', $data['lastname']);
  117102       $Qcustomer->bindValue(':customers_email_address', $data['email_address']);
  118103       $Qcustomer->bindValue(':customers_dob', (ACCOUNT_DATE_OF_BIRTH == '1') ? date('Ymd', $data['dob']) : '');
<>  104+      $Qcustomer->bindRaw(':date_account_last_modified', 'now()');
119105       $Qcustomer->bindInt(':customers_id', $osC_Customer->getID());
  120106       $Qcustomer->execute();
  121107 
  122108       if ($Qcustomer->affectedRows() === 1) {
<> 123 -        $Qupdate = $osC_Database->query('update :table_customers_info set customers_info_date_account_last_modified = now() where customers_info_id = :customers_info_id');
  124 -        $Qupdate->bindTable(':table_customers_info', TABLE_CUSTOMERS_INFO);
  125 -        $Qupdate->bindInt(':customers_info_id', $osC_Customer->getID());
  126 -        $Qupdate->execute();
  127 -
128109         return true;
  129110       }
  130111 
     
 !
138119         $customer_id = $osC_Customer->getID();
  139120       }
  140121 
<> 141 -      $Qcustomer = $osC_Database->query('update :table_customers set customers_password = :customers_password where customers_id = :customers_id');
   122+      $Qcustomer = $osC_Database->query('update :table_customers set customers_password = :customers_password, date_account_last_modified = :date_account_last_modified where customers_id = :customers_id');
142123       $Qcustomer->bindTable(':table_customers', TABLE_CUSTOMERS);
  143124       $Qcustomer->bindValue(':customers_password', osc_encrypt_string($password));
<>  125+      $Qcustomer->bindRaw(':date_account_last_modified', 'now()');
144126       $Qcustomer->bindInt(':customers_id', $customer_id);
  145127       $Qcustomer->execute();
  146128 
  147129       if ($Qcustomer->affectedRows() === 1) {
<> 148 -        $Qupdate = $osC_Database->query('update :table_customers_info set customers_info_date_account_last_modified = now() where customers_info_id = :customers_info_id');
  149 -        $Qupdate->bindTable(':table_customers_info', TABLE_CUSTOMERS_INFO);
  150 -        $Qupdate->bindInt(':customers_info_id', $customer_id);
  151 -        $Qupdate->execute();
  152 -
<_ 153130         return true;
  154131       }
  155132