29 assert(is_array(
$info));
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];
55 throw new Exception(
'Invalid attributes for user ' . $username .
56 ' in authentication source ' . $this->authId .
': ' .
79 assert(is_string($username));
83 if (!array_key_exists($userpass, $this->users)) {
87 return $this->users[$userpass];
static normalizeAttributesArray($attributes)
Validate and normalize an array with attributes.
$users
Our users, stored in an associative array.
__construct($info, $config)
Constructor for this authentication source.
if(array_key_exists('yes', $_REQUEST)) $attributes
login($username, $password)
Attempt to log in using the given username and password.