Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

185
 
201
 
201
 
customer.php
_> 11 <?php
  22 /*
<> 3 -  $Id: customer.php 185 2005-09-13 20:30:24Z hpdl $
   3+  $Id: customer.php 201 2005-09-23 08:40:18Z hpdl $
44 
  55   osCommerce, Open Source E-Commerce Solutions
  66   http://www.oscommerce.com
     
 !
1717     var $_is_logged_on = false,
  1818         $_data = array();
  1919 
<>  20+/* Class constructor */
   21+
   22+    function osC_Customer() {
   23+      if (isset($_SESSION['osC_Customer_data']) && is_array($_SESSION['osC_Customer_data']) && (sizeof($_SESSION['osC_Customer_data']) > 0) && isset($_SESSION['osC_Customer_data']['id']) && is_numeric($_SESSION['osC_Customer_data']['id'])) {
   24+        $this->setIsLoggedOn(true);
   25+        $this->_data =& $_SESSION['osC_Customer_data'];
   26+      }
   27+    }
   28+
2029 /* Public methods */
  2130 
  2231     function getID() {
     
 !
132141     }
  133142 
  134143     function setCustomerData($customer_id = -1) {
<> 135 -      if (is_numeric($customer_id) && ($customer_id > 0)) {
  136 -        global $osC_Database;
   144+      global $osC_Database;
137145 
<>  146+      $this->_data = array();
   147+
   148+      if (is_numeric($customer_id) && ($customer_id > 0)) {
138149         $Qcustomer = $osC_Database->query('select customers_gender, customers_firstname, customers_lastname, customers_email_address, customers_default_address_id from :table_customers where customers_id = :customers_id');
<> 139 -        $Qcustomer->bindRaw(':table_customers', TABLE_CUSTOMERS);
   150+        $Qcustomer->bindTable(':table_customers', TABLE_CUSTOMERS);
140151         $Qcustomer->bindInt(':customers_id', $customer_id);
  141152         $Qcustomer->execute();
  142153 
     
 !
167178 
  168179         $Qcustomer->freeResult();
  169180       }
<>  181+
   182+      if (sizeof($this->_data) > 0) {
   183+        $_SESSION['osC_Customer_data'] = $this->_data;
   184+      } elseif (isset($_SESSION['osC_Customer_data'])) {
   185+        $this->reset();
   186+      }
170187     }
  171188 
  172189     function setIsLoggedOn($state) {
     
 !
236253     function setZoneID($id) {
  237254       $this->_data['zone_id'] = $id;
  238255     }
<>  256+
   257+    function reset() {
   258+      $this->_is_logged_on = false;
   259+      $this->_data = array();
   260+
   261+      unset($_SESSION['osC_Customer_data']);
   262+    }
<_ 239263   }
  240264 ?>