diff options
author | Evan Prodromou <evan@status.net> | 2010-10-28 10:46:57 -0400 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-10-28 10:46:57 -0400 |
commit | b5206fe6ca455684af46bcf05153716749a611a9 (patch) | |
tree | 14cf1b15b85b4476fa702adfe9dbdc5a4aa312a7 | |
parent | 22a0cf6251cff6bc3c872d27ee5a6921665c7394 (diff) |
fall back to siteowner on bad nickname (Bug#2861)
-rw-r--r-- | classes/User.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/classes/User.php b/classes/User.php index f381ec607..7345dc7f9 100644 --- a/classes/User.php +++ b/classes/User.php @@ -889,13 +889,23 @@ class User extends Memcached_DataObject static function singleUser() { if (common_config('singleuser', 'enabled')) { + + $user = null; + $nickname = common_config('singleuser', 'nickname'); - if ($nickname) { + + if (!empty($nickname)) { $user = User::staticGet('nickname', $nickname); - } else { + } + + // if there was no nickname or no user by that nickname, + // try the site owner. + + if (empty($user)) { $user = User::siteOwner(); } - if ($user) { + + if (!empty($user)) { return $user; } else { // TRANS: Server exception. |