From: Evan Prodromou Date: Fri, 29 Jan 2010 20:15:52 +0000 (-0500) Subject: for single-user mode, retrieve either site owner or defined nickname X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a7b2a08c42347d7beac43980a673b434a9c0331a;p=quix0rs-gnu-social.git for single-user mode, retrieve either site owner or defined nickname --- diff --git a/lib/router.php b/lib/router.php index be9cfac0c2..ca9f328126 100644 --- a/lib/router.php +++ b/lib/router.php @@ -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',