Example #1
0
 /**
  * Set Password
  *
  * @param string $password
  * @param boolean $encode : encode the setted password using sha1 hash function
  * @return boolean
  * @access public
  */
 function setPassword($password, $encode = true)
 {
     // Check password validity
     if ($encode && !SensitiveIO::isValidPassword($password)) {
         $this->raiseError('Invalid password. Length must be > ' . MINIMUM_PASSWORD_LENGTH);
         return false;
     }
     $this->_password = $encode ? '{sha}' . sha1($password) : $password;
     return true;
 }