]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
for single-user mode, retrieve either site owner or defined nickname
authorEvan Prodromou <evan@status.net>
Fri, 29 Jan 2010 20:15:52 +0000 (15:15 -0500)
committerEvan Prodromou <evan@status.net>
Fri, 29 Jan 2010 20:15:52 +0000 (15:15 -0500)
lib/router.php

index be9cfac0c29a38268f90ccd88a8ea67933487212..ca9f32812630f7817314cc97edee097860c0b68d 100644 (file)
@@ -649,7 +649,16 @@ class Router
 
             if (common_config('singleuser', 'enabled')) {
 
-                $nickname = common_config('singleuser', 'nickname');
+                $user = User::siteOwner();
+
+                if (!empty($user)) {
+                    $nickname = $user->nickname;
+                } else {
+                    $nickname = common_config('singleuser', 'nickname');
+                    if (empty($nickname)) {
+                        throw new ServerException(_("No single user defined for single-user mode."));
+                    }
+                }
 
                 foreach (array('subscriptions', 'subscribers',
                                'all', 'foaf', 'xrds',