/** * Update user * @access public * @param array $data * @return void */ public function updateUser($data) { $id = $data['id']; unset($data['id']); if (array_key_exists('password', $data)) { $user = $this->getUserBy('id', $id); // start the Password API object $passwordApi = new Dot_Password(); $data['password'] = $passwordApi->hashPassword($data['password'], PASSWORD_DEFAULT); } $this->db->update('admin', $data, 'id = ' . $id); }
/** * Private function to authenticate some user information against a provided password * @param object $userInfo * @param string $password * @return boolean */ private function _authenticate($userInfo, $password) { $passwordApi = new Dot_Password(); return $passwordApi->verifyPassword($password, $userInfo->password); }