Logo white

Administrator / test_6

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • test_6
  • common
  • components
  • Validator.php
  • first commit
    d87bdb77
    Administrator authored
    2015-11-02 11:08:23 +0200  
    Browse Code ยป
Validator.php 470 Bytes
Edit Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
<?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;
    }


}