Skip to content

Commit

Permalink
code style fix as requested
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolabeghin committed Apr 23, 2017
1 parent 99d02a8 commit 09a981b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/Cake/Controller/Component/Auth/BasicAuthenticate.php
Expand Up @@ -82,12 +82,9 @@ public function authenticate(CakeRequest $request, CakeResponse $response) {
* @return mixed Either false or an array of user information
*/
public function getUser(CakeRequest $request) {
$username = '';
$pass = '';
if (isset($_SERVER['PHP_AUTH_USER'])) {
$username = env('PHP_AUTH_USER');
$pass = env('PHP_AUTH_PW');
} else {
$username = env('PHP_AUTH_USER');
$pass = env('PHP_AUTH_PW');
if (empty($username)) {
$httpAuthorization = $request->header('Authorization');
if ($httpAuthorization !== false && strlen($httpAuthorization) > 0 && strpos($httpAuthorization, 'Basic') !== false) {
list($username, $pass) = explode(':', base64_decode(substr($httpAuthorization, 6)));
Expand Down

0 comments on commit 09a981b

Please sign in to comment.