Files
awo-hamburg-intranet/mysyde/common/classes/StdMD5PasswordCheckerStrategy.php
2026-02-17 14:56:23 +01:00

35 lines
854 B
PHP

<?php
namespace DynCom\mysyde\common\classes;
use DynCom\mysyde\common\interfaces\PasswordCheckerInterface;
/**
* Created by PhpStorm.
* User: Bauer
* Date: 13.01.2015
* Time: 13:56
*/
class StdMD5PasswordCheckerStrategy implements PasswordCheckerInterface {
/**
* @param $storedPass
* @param $inputPass
*
* @return bool
*/
public function isValid( $storedPass, $inputPass ) {
return $this->_isValid($storedPass, $inputPass);
}
/**
* @param $storedPass
* @param $inputPass
*
* @return bool
*/
protected function _isValid( $storedPass, $inputPass ) {
$stored = trim((string)$storedPass);
$input = trim((string)$inputPass);
return (strlen($stored) > 0 && strlen($input) > 0 && $input === md5($stored));
}
}