41 assert(
'is_array($info)');
42 assert(
'is_array($config)');
47 $this->users =
array();
49 if (!$htpasswd = file_get_contents(
$config[
'htpasswd_file'])) {
53 $this->users = explode(
"\n", trim($htpasswd));
58 throw new Exception(
'Invalid static_attributes in authentication source '.
59 $this->authId.
': '.$e->getMessage());
82 assert(
'is_string($username)');
83 assert(
'is_string($password)');
85 foreach ($this->users as $userpass) {
86 $matches = explode(
':', $userpass, 2);
87 if ($matches[0] == $username) {
88 $crypted = $matches[1];
97 'CRYPT authentication is insecure. Please consider using something else.' 103 if (APR1_MD5::check(
$password, $crypted)) {
112 'SHA1 and PLAIN TEXT authentication are insecure. Please consider using something else.' static normalizeAttributesArray($attributes)
Validate and normalize an array with attributes.
__construct($info, $config)
Constructor for this authentication source.
Attribute-related utility methods.
login($username, $password)
Attempt to log in using the given username and password.
Create styles array
The data for the language used.