/**
  * Checks encryption type for given string. We need this for the MD5
  * migration of passwords from old phpMyFAQ installations to new ones
  * with a salt.
  *
  * @param string $encryptedPassword Encrypted password
  * @param string $clearPassword     Clear Password
  *
  * @return boolean
  */
 public function checkEncryptedPassword($encryptedPassword, $clearPassword)
 {
     $encTypes = array('crypt', 'md5', 'sha');
     foreach ($encTypes as $encType) {
         if ($encryptedPassword === PMF_Enc::selectEnc($encType, $this->_config)->encrypt($clearPassword)) {
             return true;
         }
     }
     return false;
 }
예제 #2
0
파일: Auth.php 프로젝트: noon/phpMyFAQ
 /**
  * Short description of method encrypt
  *
  * @param  string $str string
  * @return string
  */
 public function encrypt($str)
 {
     return $this->enc_container->encrypt($str);
 }