Esempio n. 1
0
 /**
  * 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);
 }
Esempio n. 2
0
 /**
  * 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);
 }