Source for file HardcodedAccounts.php

Documentation is available at HardcodedAccounts.php

  1. <?php
  2.  
  3. {
  4.     private $users;
  5.  
  6.     public function __construct()
  7.     {
  8.         $this->users new Users();
  9.     }
  10.     
  11.     public function login($user$password)
  12.     {
  13.         if (empty($user|| empty($password)) {
  14.             return false;
  15.         else {
  16.  
  17.             // both validation methods should work ...
  18.  
  19.             // user static method to validate account
  20.             $firstValidation Users::validate($user$password);
  21.  
  22.             // use magic method validate<username>($password)
  23.             $userLoginFunction 'validate' $user;
  24.             $secondValidation $this->users->$userLoginFunction($password);
  25.  
  26.             return ($firstValidation && $secondValidation);
  27.         }
  28.     }
  29. }
  30.  
  31. ?>

Documentation generated on Mon, 26 Jul 2010 21:52:59 +0100 by phpDocumentor 1.4.3