fall back to siteowner on bad nickname (Bug#2861)

This commit is contained in:
Evan Prodromou 2010-10-28 10:46:57 -04:00
parent 22a0cf6251
commit b5206fe6ca

View File

@ -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.