Skip to content
Permalink
Browse files

code style fix

  • Loading branch information...
nicolabeghin committed Mar 15, 2017
1 parent 74f7008 commit 5fb1b71cb62b12631a85b139668273b63dfc6f06
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/Cake/Controller/Component/Auth/BasicAuthenticate.php
@@ -84,12 +84,12 @@ public function authenticate(CakeRequest $request, CakeResponse $response) {
public function getUser(CakeRequest $request) {
if(!isset($_SERVER['PHP_AUTH_USER'])) {
$httpAuthorization = $request->header('Authorization');
if ($httpAuthorization !== false && strlen($httpAuthorization) > 0 && strpos($httpAuthorization, 'basic') !== false) {
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($httpAuthorization, 6)));
if(strlen($_SERVER['PHP_AUTH_USER']) === 0 || strlen($_SERVER['PHP_AUTH_PW']) === 0) {
unset($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
}
}
if($httpAuthorization !== false && strlen($httpAuthorization) > 0 && strpos($httpAuthorization, 'basic') !== false) {
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($httpAuthorization, 6)));
if(strlen($_SERVER['PHP_AUTH_USER']) === 0 || strlen($_SERVER['PHP_AUTH_PW']) === 0) {
unset($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
}
}
}
$username = env('PHP_AUTH_USER');
$pass = env('PHP_AUTH_PW');

0 comments on commit 5fb1b71

Please sign in to comment.
You can’t perform that action at this time.