diff --git a/src/Adapter/DbTable/AbstractAdapter.php b/src/Adapter/DbTable/AbstractAdapter.php index 7144ae9..6e8bba8 100644 --- a/src/Adapter/DbTable/AbstractAdapter.php +++ b/src/Adapter/DbTable/AbstractAdapter.php @@ -334,8 +334,10 @@ protected function authenticateQuerySelect(Sql\Select $dbSelect) } catch (\Exception $e) { throw new Exception\RuntimeException( 'The supplied parameters to DbTable failed to ' - . 'produce a valid sql statement, please check table and column names ' - . 'for validity.', 0, $e + . 'produce a valid sql statement, please check table and column names ' + . 'for validity.', + 0, + $e ); } return $resultIdentities; diff --git a/src/Adapter/DbTable/Exception/ExceptionInterface.php b/src/Adapter/DbTable/Exception/ExceptionInterface.php index 6156457..5365808 100644 --- a/src/Adapter/DbTable/Exception/ExceptionInterface.php +++ b/src/Adapter/DbTable/Exception/ExceptionInterface.php @@ -12,4 +12,5 @@ use Zend\Authentication\Adapter\Exception\ExceptionInterface as Exception; interface ExceptionInterface extends Exception -{} +{ +} diff --git a/src/Adapter/DbTable/Exception/InvalidArgumentException.php b/src/Adapter/DbTable/Exception/InvalidArgumentException.php index 87bf014..dfda938 100644 --- a/src/Adapter/DbTable/Exception/InvalidArgumentException.php +++ b/src/Adapter/DbTable/Exception/InvalidArgumentException.php @@ -11,8 +11,6 @@ use Zend\Authentication\Adapter\Exception; -class InvalidArgumentException - extends Exception\InvalidArgumentException - implements ExceptionInterface +class InvalidArgumentException extends Exception\InvalidArgumentException implements ExceptionInterface { } diff --git a/src/Adapter/Exception/ExceptionInterface.php b/src/Adapter/Exception/ExceptionInterface.php index b8da27f..4c9b9d4 100644 --- a/src/Adapter/Exception/ExceptionInterface.php +++ b/src/Adapter/Exception/ExceptionInterface.php @@ -12,4 +12,5 @@ use Zend\Authentication\Exception\ExceptionInterface as Exception; interface ExceptionInterface extends Exception -{} +{ +} diff --git a/src/Adapter/Exception/InvalidArgumentException.php b/src/Adapter/Exception/InvalidArgumentException.php index c2f0105..6c315ae 100644 --- a/src/Adapter/Exception/InvalidArgumentException.php +++ b/src/Adapter/Exception/InvalidArgumentException.php @@ -11,8 +11,6 @@ use Zend\Authentication\Exception; -class InvalidArgumentException - extends Exception\InvalidArgumentException - implements ExceptionInterface +class InvalidArgumentException extends Exception\InvalidArgumentException implements ExceptionInterface { } diff --git a/src/Adapter/Http.php b/src/Adapter/Http.php index 2cc3db5..bde60a2 100644 --- a/src/Adapter/Http.php +++ b/src/Adapter/Http.php @@ -324,8 +324,9 @@ public function getResponse() public function authenticate() { if (empty($this->request) || empty($this->response)) { - throw new Exception\RuntimeException('Request and Response objects must be set before calling ' - . 'authenticate()'); + throw new Exception\RuntimeException( + 'Request and Response objects must be set before calling authenticate()' + ); } if ($this->imaProxy) { @@ -476,8 +477,8 @@ protected function _basicAuth($header) } if (empty($this->basicResolver)) { throw new Exception\RuntimeException( - 'A basicResolver object must be set before doing Basic ' - . 'authentication'); + 'A basicResolver object must be set before doing Basic authentication' + ); } // Decode the Authorization header @@ -592,7 +593,6 @@ protected function _digestAuth($header) // easier $ha2 = hash('md5', $a2); - // Calculate the server's version of the request-digest. This must // match $data['response']. See RFC 2617, section 3.2.2.1 $message = $data['nonce'] . ':' . $data['nc'] . ':' . $data['cnonce'] . ':' . $data['qop'] . ':' . $ha2; diff --git a/src/Adapter/Http/Exception/ExceptionInterface.php b/src/Adapter/Http/Exception/ExceptionInterface.php index 0bfa484..4ec6a3f 100644 --- a/src/Adapter/Http/Exception/ExceptionInterface.php +++ b/src/Adapter/Http/Exception/ExceptionInterface.php @@ -15,4 +15,5 @@ * HTTP Auth Resolver Exception */ interface ExceptionInterface extends Exception -{} +{ +} diff --git a/src/Adapter/Http/FileResolver.php b/src/Adapter/Http/FileResolver.php index 2bb5856..947027a 100644 --- a/src/Adapter/Http/FileResolver.php +++ b/src/Adapter/Http/FileResolver.php @@ -88,14 +88,16 @@ public function resolve($username, $realm, $password = null) if (empty($username)) { throw new Exception\InvalidArgumentException('Username is required'); } elseif (!ctype_print($username) || strpos($username, ':') !== false) { - throw new Exception\InvalidArgumentException('Username must consist only of printable characters, ' - . 'excluding the colon'); + throw new Exception\InvalidArgumentException( + 'Username must consist only of printable characters, excluding the colon' + ); } if (empty($realm)) { throw new Exception\InvalidArgumentException('Realm is required'); } elseif (!ctype_print($realm) || strpos($realm, ':') !== false) { - throw new Exception\InvalidArgumentException('Realm must consist only of printable characters, ' - . 'excluding the colon.'); + throw new Exception\InvalidArgumentException( + 'Realm must consist only of printable characters, excluding the colon.' + ); } // Open file, read through looking for matching credentials diff --git a/src/Adapter/Ldap.php b/src/Adapter/Ldap.php index 320e6c5..2b17e33 100644 --- a/src/Adapter/Ldap.php +++ b/src/Adapter/Ldap.php @@ -168,8 +168,10 @@ protected function getAuthorityName() { $options = $this->getLdap()->getOptions(); $name = $options['accountDomainName']; - if (!$name) + if (!$name) { $name = $options['accountDomainNameShort']; + } + return $name ? $name : ''; } @@ -220,8 +222,10 @@ public function authenticate() $dname = ''; try { - if ($messages[1]) + if ($messages[1]) { $messages[] = $messages[1]; + } + $messages[1] = ''; $messages[] = $this->optionsToString($options); @@ -341,9 +345,16 @@ protected function prepareOptions(ZendLdap\Ldap $ldap, array $options) switch ($key) { case 'groupScope': $value = (int) $value; - if (in_array($value, array(ZendLdap\Ldap::SEARCH_SCOPE_BASE, - ZendLdap\Ldap::SEARCH_SCOPE_ONE, ZendLdap\Ldap::SEARCH_SCOPE_SUB), true)) { - $adapterOptions[$key] = $value; + if (in_array( + $value, + array( + ZendLdap\Ldap::SEARCH_SCOPE_BASE, + ZendLdap\Ldap::SEARCH_SCOPE_ONE, + ZendLdap\Ldap::SEARCH_SCOPE_SUB, + ), + true + )) { + $adapterOptions[$key] = $value; } break; case 'memberIsDn': diff --git a/src/Exception/ExceptionInterface.php b/src/Exception/ExceptionInterface.php index d995a64..ed122ba 100644 --- a/src/Exception/ExceptionInterface.php +++ b/src/Exception/ExceptionInterface.php @@ -10,4 +10,5 @@ namespace Zend\Authentication\Exception; interface ExceptionInterface -{} +{ +}