Example #1
0
 public static function execute($data)
 {
     if (!empty($data['password'])) {
         $data['password'] = Hash::get(trim($data['password']));
     }
     return OSCOM::callDB('Admin\\Administrators\\Save', $data);
 }
Example #2
0
 /**
  * Updates the password in a customers account
  *
  * @param string $password The new password
  * @param integer $customer_id The ID of the customer account to update
  * @access public
  * @return boolean
  */
 public static function savePassword($password, $customer_id = null)
 {
     $OSCOM_PDO = Registry::get('PDO');
     $OSCOM_Customer = Registry::get('Customer');
     if (!is_numeric($customer_id)) {
         $customer_id = $OSCOM_Customer->getID();
     }
     $Qcustomer = $OSCOM_PDO->prepare('update :table_customers set customers_password = :customers_password, date_account_last_modified = now() where customers_id = :customers_id');
     $Qcustomer->bindValue(':customers_password', Hash::get($password));
     $Qcustomer->bindInt(':customers_id', $customer_id);
     $Qcustomer->execute();
     return $Qcustomer->rowCount() === 1;
 }