@@ -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)); |
@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | $attrUtils = new Utils\Attributes(); |
| 58 | 58 | $this->attributes = $attrUtils->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 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | // Traditional crypt(3) |
| 94 | 94 | if ($cryptoUtils->secureCompare($crypted, crypt($password, $crypted))) { |
| 95 | - Logger::debug('User ' . $username . ' authenticated successfully'); |
|
| 95 | + Logger::debug('User '.$username.' authenticated successfully'); |
|
| 96 | 96 | Logger::warning( |
| 97 | 97 | 'CRYPT authentication is insecure. Please consider using something else.' |
| 98 | 98 | ); |
@@ -101,13 +101,13 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | // Apache's custom MD5 |
| 103 | 103 | if (APR1_MD5::check($password, $crypted)) { |
| 104 | - Logger::debug('User ' . $username . ' authenticated successfully'); |
|
| 104 | + Logger::debug('User '.$username.' authenticated successfully'); |
|
| 105 | 105 | return $attributes; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | // PASSWORD_BCRYPT |
| 109 | 109 | if ($cryptoUtils->pwValid($crypted, $password)) { |
| 110 | - Logger::debug('User ' . $username . ' authenticated successfully'); |
|
| 110 | + Logger::debug('User '.$username.' authenticated successfully'); |
|
| 111 | 111 | return $attributes; |
| 112 | 112 | } |
| 113 | 113 | throw new 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]; |
@@ -62,12 +62,12 @@ discard block |
||
| 62 | 62 | $attrUtils = new Utils\Attributes(); |
| 63 | 63 | $attributes = $attrUtils->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 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | if ($cryptoUtils->pwValid($matches[1], $password)) { |
| 98 | 98 | return $attrs; |
| 99 | 99 | } else { |
| 100 | - Logger::debug('Incorrect password "' . $password . '" for user ' . $username); |
|
| 100 | + Logger::debug('Incorrect password "'.$password.'" for user '.$username); |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | } |