Blame view

common/components/Validator.php 470 Bytes
fdc1c9de   Yarik   test
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;
      }
  
  
  }