Skip to content

Commit 09a981b

Browse files
committed
code style fix as requested
1 parent 99d02a8 commit 09a981b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/Cake/Controller/Component/Auth/BasicAuthenticate.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,9 @@ public function authenticate(CakeRequest $request, CakeResponse $response) {
8282
* @return mixed Either false or an array of user information
8383
*/
8484
public function getUser(CakeRequest $request) {
85-
$username = '';
86-
$pass = '';
87-
if (isset($_SERVER['PHP_AUTH_USER'])) {
88-
$username = env('PHP_AUTH_USER');
89-
$pass = env('PHP_AUTH_PW');
90-
} else {
85+
$username = env('PHP_AUTH_USER');
86+
$pass = env('PHP_AUTH_PW');
87+
if (empty($username)) {
9188
$httpAuthorization = $request->header('Authorization');
9289
if ($httpAuthorization !== false && strlen($httpAuthorization) > 0 && strpos($httpAuthorization, 'Basic') !== false) {
9390
list($username, $pass) = explode(':', base64_decode(substr($httpAuthorization, 6)));

0 commit comments

Comments
 (0)