mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
code style
This commit is contained in:
parent
5fb1b71cb6
commit
ff210b04d7
1 changed files with 3 additions and 3 deletions
|
@ -82,11 +82,11 @@ class BasicAuthenticate extends BaseAuthenticate {
|
|||
* @return mixed Either false or an array of user information
|
||||
*/
|
||||
public function getUser(CakeRequest $request) {
|
||||
if(!isset($_SERVER['PHP_AUTH_USER'])) {
|
||||
if (!isset($_SERVER['PHP_AUTH_USER'])) {
|
||||
$httpAuthorization = $request->header('Authorization');
|
||||
if($httpAuthorization !== false && strlen($httpAuthorization) > 0 && strpos($httpAuthorization, 'basic') !== false) {
|
||||
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) {
|
||||
if (strlen($_SERVER['PHP_AUTH_USER']) === 0 || strlen($_SERVER['PHP_AUTH_PW']) === 0) {
|
||||
unset($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue