X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FSecurity%2FBasicAuth.php;h=51da7a98ad472429d7f21b0d106b2129b8eb16f9;hb=cab469621d173015ade7846344f5051b600d640d;hp=7b6a6b082502d982e0827141434a7c31df437b84;hpb=dbcaf5192315d00f73c88d54e413c827fd31759b;p=friendica.git diff --git a/src/Security/BasicAuth.php b/src/Security/BasicAuth.php index 7b6a6b0825..51da7a98ad 100644 --- a/src/Security/BasicAuth.php +++ b/src/Security/BasicAuth.php @@ -1,6 +1,6 @@ $_SERVER]); // Checking for commandline for the tests, we have to avoid to send a header - if (php_sapi_name() !== 'cli') { + if (DI::config()->get('system', 'basicauth') && (php_sapi_name() !== 'cli')) { header('WWW-Authenticate: Basic realm="Friendica"'); } throw new UnauthorizedException("This API requires login"); @@ -191,7 +190,7 @@ class BasicAuth Hook::callAll('logged_in', $record); - self::$current_user_id = local_user(); + self::$current_user_id = DI::userSession()->getLocalUserId(); return self::$current_user_id; }