29                assert(
'is_array($info)');
 
   30                assert(
'is_array($config)');
 
   35                $this->users = array();
 
   39                        if (!is_string($userpass)) {
 
   40                                throw new Exception(
'Invalid <username>:<password> for authentication source ' .
 
   41                                        $this->authId . 
': ' . $userpass);
 
   44                        $userpass = explode(
':', $userpass, 2);
 
   45                        if (count($userpass) !== 2) {
 
   46                                throw new Exception(
'Invalid <username>:<password> for authentication source ' .
 
   47                                        $this->authId . 
': ' . $userpass[0]);
 
   49                        $username = $userpass[0];
 
   54                        } 
catch(Exception $e) {
 
   55                                throw new Exception(
'Invalid attributes for user ' . $username .
 
   56                                        ' in authentication source ' . $this->authId . 
': ' .
 
   79                assert(
'is_string($username)');
 
   80                assert(
'is_string($password)');
 
   83                if (!array_key_exists($userpass, $this->users)) {
 
   87                return $this->users[$userpass];
 
An exception for terminatinating execution or to throw for unit testing.
static normalizeAttributesArray($attributes)
Validate and normalize an array with attributes.
__construct($info, $config)
Constructor for this authentication source.
login($username, $password)
Attempt to log in using the given username and password.
$users
Our users, stored in an associative array.