Validator.php
470 Bytes
<?php
namespace common\components;
class Validator {
private $store;
public function __construct(UserStore $store){
$this->store = $store;
}
public function validateUser($email, $pass){
if(!is_array($user = $this->store->getUser($email))){
return false;
}
if($user['pass'] == $pass){
return true;
}
$this->store->notifyPasswordFailure($email);
return false;
}
}