  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: account.php 206 2005-09-25 22:28:21Z hpdl $ |
| |
| 3 | + | $Id: account.php 207 2005-09-25 23:29:31Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
130 | 130 | | return false; |
| |
131 | 131 | | } |
| |
132 | 132 | | |
  |
133 | | - | function savePassword($password) { |
| |
| 133 | + | function savePassword($password, $customer_id = null) { |
|
134 | 134 | | global $osC_Database, $osC_Customer; |
| |
135 | 135 | | |
  |
| 136 | + | if (is_numeric($customer_id) === false) { |
| |
| 137 | + | $customer_id = $osC_Customer->getID(); |
| |
| 138 | + | } |
| |
| 139 | + | |
|
136 | 140 | | $Qcustomer = $osC_Database->query('update :table_customers set customers_password = :customers_password where customers_id = :customers_id'); |
| |
137 | 141 | | $Qcustomer->bindTable(':table_customers', TABLE_CUSTOMERS); |
| |
138 | 142 | | $Qcustomer->bindValue(':customers_password', tep_encrypt_password($password)); |
  |
139 | | - | $Qcustomer->bindInt(':customers_id', $osC_Customer->getID()); |
| |
| 143 | + | $Qcustomer->bindInt(':customers_id', $customer_id); |
|
140 | 144 | | $Qcustomer->execute(); |
| |
141 | 145 | | |
| |
142 | 146 | | if ($Qcustomer->affectedRows() === 1) { |
| |
143 | 147 | | $Qupdate = $osC_Database->query('update :table_customers_info set customers_info_date_account_last_modified = now() where customers_info_id = :customers_info_id'); |
| |
144 | 148 | | $Qupdate->bindTable(':table_customers_info', TABLE_CUSTOMERS_INFO); |
  |
145 | | - | $Qupdate->bindInt(':customers_info_id', $osC_Customer->getID()); |
| |
| 149 | + | $Qupdate->bindInt(':customers_info_id', $customer_id); |
  |
146 | 150 | | $Qupdate->execute(); |
| |
147 | 151 | | |
| |
148 | 152 | | return true; |