From: Evan Prodromou Date: Mon, 8 Mar 2010 17:36:03 +0000 (-0500) Subject: make API realm configurable X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5f7aa6f2e3c82b9598e3405885eb455bed9b0edc;p=quix0rs-gnu-social.git make API realm configurable --- diff --git a/lib/apiauth.php b/lib/apiauth.php index 5090871cfe..f63c84d8f3 100644 --- a/lib/apiauth.php +++ b/lib/apiauth.php @@ -235,7 +235,11 @@ class ApiAuthAction extends ApiAction { $this->basicAuthProcessHeader(); - $realm = common_config('site', 'name') . ' API'; + $realm = common_config('api', 'realm'); + + if (empty($realm)) { + $realm = common_config('site', 'name') . ' API'; + } if (!isset($this->auth_user_nickname) && $required) { header('WWW-Authenticate: Basic realm="' . $realm . '"'); diff --git a/lib/default.php b/lib/default.php index bdd78d4d86..46d3d4774f 100644 --- a/lib/default.php +++ b/lib/default.php @@ -293,4 +293,6 @@ $default = array('crawldelay' => 0, 'disallow' => array('main', 'settings', 'admin', 'search', 'message') ), + 'api' => + array('realm' => null), );