forked from GNUsocial/gnu-social
Fix for ticket #2845: singleuser nickname configuration was being overridden by site owner in router setup.
I've consolidated the checks for which user to use for single-user mode into User::singleUser(), which now uses the configured nickname by preference, falling back to the site owner if it's unset. This is now called consistently from the places that needed to use the primary user's nickname in routing setup. Setting $config['singleuser']['nickname'] should now work again as expected.
This commit is contained in:
@@ -701,16 +701,8 @@ class Router
|
||||
|
||||
if (common_config('singleuser', 'enabled')) {
|
||||
|
||||
$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."));
|
||||
}
|
||||
}
|
||||
$user = User::singleUser();
|
||||
$nickname = $user->nickname;
|
||||
|
||||
foreach (array('subscriptions', 'subscribers',
|
||||
'all', 'foaf', 'xrds',
|
||||
|
||||
Reference in New Issue
Block a user