summaryrefslogtreecommitdiff
path: root/lib/apiauth.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-03-08 12:36:03 -0500
committerEvan Prodromou <evan@status.net>2010-03-08 12:36:03 -0500
commit5f7aa6f2e3c82b9598e3405885eb455bed9b0edc (patch)
treedbba16221c0d8fa3753e48fe3af3358c4e0cfd09 /lib/apiauth.php
parente5541d09d0776e69cc276a3b3e93abcc42b15e55 (diff)
make API realm configurable
Diffstat (limited to 'lib/apiauth.php')
-rw-r--r--lib/apiauth.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/apiauth.php b/lib/apiauth.php
index 5090871cf..f63c84d8f 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 . '"');