mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
code style fix as requested
This commit is contained in:
parent
99d02a8698
commit
09a981ba38
1 changed files with 3 additions and 6 deletions
|
@ -82,12 +82,9 @@ class BasicAuthenticate extends BaseAuthenticate {
|
|||
* @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)));
|
||||
|
|
Loading…
Reference in a new issue