public static function execute($data) { $result = OSCOM::callDB('Admin\\Login\\GetAdmin', array('username' => $data['username'])); if (!empty($result)) { return Hash::validate($data['password'], $result['user_password']); } return false; }
/** * Checks if a password matches the current or provided customer account * * @param string $password The unencrypted password to confirm * @param string $email_address The email address of the customer account to check against * @access public * @return boolean */ public static function checkPassword($password, $email_address = null) { $OSCOM_PDO = Registry::get('PDO'); $OSCOM_Customer = Registry::get('Customer'); if (empty($email_address)) { $Qcheck = $OSCOM_PDO->prepare('select customers_password from :table_customers where customers_id = :customers_id'); $Qcheck->bindInt(':customers_id', $OSCOM_Customer->getID()); $Qcheck->execute(); } else { $Qcheck = $OSCOM_PDO->prepare('select customers_password from :table_customers where customers_email_address = :customers_email_address limit 1'); $Qcheck->bindValue(':customers_email_address', $email_address); $Qcheck->execute(); } $result = $Qcheck->fetch(); if ($result !== false) { return Hash::validate($password, $Qcheck->value('customers_password')); } return false; }