code style fix as requested

This commit is contained in:
Nicola Beghin 2017-04-23 18:44:42 +02:00
parent 99d02a8698
commit 09a981ba38

View file

@ -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)));