@@ -47,14 +47,14 @@ discard block |
||
| 47 | 47 | // Validate and parse our configuration |
| 48 | 48 | foreach ($config as $userpass => $attributes) { |
| 49 | 49 | if (!is_string($userpass)) { |
| 50 | - throw new Exception('Invalid <username>:<passwordhash> for authentication source ' . |
|
| 51 | - $this->authId . ': ' . $userpass); |
|
| 50 | + throw new Exception('Invalid <username>:<passwordhash> for authentication source '. |
|
| 51 | + $this->authId.': '.$userpass); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | $userpass = explode(':', $userpass, 2); |
| 55 | 55 | if (count($userpass) !== 2) { |
| 56 | - throw new Exception('Invalid <username>:<passwordhash> for authentication source ' . |
|
| 57 | - $this->authId . ': ' . $userpass[0]); |
|
| 56 | + throw new Exception('Invalid <username>:<passwordhash> for authentication source '. |
|
| 57 | + $this->authId.': '.$userpass[0]); |
|
| 58 | 58 | } |
| 59 | 59 | $username = $userpass[0]; |
| 60 | 60 | $passwordhash = $userpass[1]; |
@@ -62,12 +62,12 @@ discard block |
||
| 62 | 62 | try { |
| 63 | 63 | $attributes = Attributes::normalizeAttributesArray($attributes); |
| 64 | 64 | } catch (Exception $e) { |
| 65 | - throw new Exception('Invalid attributes for user ' . $username . |
|
| 66 | - ' in authentication source ' . $this->authId . ': ' . |
|
| 65 | + throw new Exception('Invalid attributes for user '.$username. |
|
| 66 | + ' in authentication source '.$this->authId.': '. |
|
| 67 | 67 | $e->getMessage()); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - $this->users[$username . ':' . $passwordhash] = $attributes; |
|
| 70 | + $this->users[$username.':'.$passwordhash] = $attributes; |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | if (Crypto::pwValid($matches[1], $password)) { |
| 97 | 97 | return $attrs; |
| 98 | 98 | } else { |
| 99 | - Logger::debug('Incorrect password "' . $password . '" for user ' . $username); |
|
| 99 | + Logger::debug('Incorrect password "'.$password.'" for user '.$username); |
|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $this->users = []; |
| 50 | 50 | |
| 51 | 51 | if (!$htpasswd = file_get_contents($config['htpasswd_file'])) { |
| 52 | - throw new Exception('Could not read ' . $config['htpasswd_file']); |
|
| 52 | + throw new Exception('Could not read '.$config['htpasswd_file']); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | $this->users = explode("\n", trim($htpasswd)); |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | try { |
| 58 | 58 | $this->attributes = Attributes::normalizeAttributesArray($config['static_attributes']); |
| 59 | 59 | } catch (Exception $e) { |
| 60 | - throw new Exception('Invalid static_attributes in authentication source ' . |
|
| 61 | - $this->authId . ': ' . $e->getMessage()); |
|
| 60 | + throw new Exception('Invalid static_attributes in authentication source '. |
|
| 61 | + $this->authId.': '.$e->getMessage()); |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | // Traditional crypt(3) |
| 93 | 93 | if (Crypto::secureCompare($crypted, crypt($password, $crypted))) { |
| 94 | - Logger::debug('User ' . $username . ' authenticated successfully'); |
|
| 94 | + Logger::debug('User '.$username.' authenticated successfully'); |
|
| 95 | 95 | Logger::warning( |
| 96 | 96 | 'CRYPT authentication is insecure. Please consider using something else.' |
| 97 | 97 | ); |
@@ -100,13 +100,13 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | // Apache's custom MD5 |
| 102 | 102 | if (APR1_MD5::check($password, $crypted)) { |
| 103 | - Logger::debug('User ' . $username . ' authenticated successfully'); |
|
| 103 | + Logger::debug('User '.$username.' authenticated successfully'); |
|
| 104 | 104 | return $attributes; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | // PASSWORD_BCRYPT |
| 108 | 108 | if (Crypto::pwValid($crypted, $password)) { |
| 109 | - Logger::debug('User ' . $username . ' authenticated successfully'); |
|
| 109 | + Logger::debug('User '.$username.' authenticated successfully'); |
|
| 110 | 110 | return $attributes; |
| 111 | 111 | } |
| 112 | 112 | throw new \SimpleSAML\Error\Error('WRONGUSERPASS'); |