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