From: Zach Copley Date: Mon, 12 Oct 2009 22:12:20 +0000 (-0700) Subject: Use site's name for basic auth realm X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4efbe32f6ae2d0300299b1103294f881a03f929d;p=quix0rs-gnu-social.git Use site's name for basic auth realm --- diff --git a/lib/apiauth.php b/lib/apiauth.php index 25bbae24e5..4e5e0ccd99 100644 --- a/lib/apiauth.php +++ b/lib/apiauth.php @@ -31,7 +31,7 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR.'/lib/api.php'; +require_once INSTALLDIR . '/lib/api.php'; /** * Actions extending this class will require auth @@ -90,8 +90,10 @@ class ApiAuthAction extends ApiAction { $this->basicAuthProcessHeader(); + $realm = common_config('site', 'name') . ' API'; + if (!isset($this->auth_user)) { - header('WWW-Authenticate: Basic realm="StatusNet API"'); + header('WWW-Authenticate: Basic realm="' . $realm . '"'); // show error if the user clicks 'cancel'