From 20fc30595beeaae74c96d6f63e3200bf1a0716ca Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Thu, 9 Mar 2006 19:28:15 +0000 Subject: [PATCH] There is no point looking up the group moderator name when none exists git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@5613 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/admin_groups.php | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/phpBB/admin/admin_groups.php b/phpBB/admin/admin_groups.php index ad1cc33355..4bac6445d5 100644 --- a/phpBB/admin/admin_groups.php +++ b/phpBB/admin/admin_groups.php @@ -104,21 +104,28 @@ if ( isset($HTTP_POST_VARS['edit']) || isset($HTTP_POST_VARS['new']) ) // // Ok, now we know everything about them, let's show the page. // - $sql = "SELECT user_id, username - FROM " . USERS_TABLE . " - WHERE user_id = " . $group_info['group_moderator']; - if ( !($result = $db->sql_query($sql)) ) + if ($group_info['group_moderator'] != '') { - message_die(GENERAL_ERROR, 'Could not obtain user info for moderator list', '', __LINE__, __FILE__, $sql); - } + $sql = "SELECT user_id, username + FROM " . USERS_TABLE . " + WHERE user_id = " . $group_info['group_moderator']; + if ( !($result = $db->sql_query($sql)) ) + { + message_die(GENERAL_ERROR, 'Could not obtain user info for moderator list', '', __LINE__, __FILE__, $sql); + } - if ( !($row = $db->sql_fetchrow($result)) ) + if ( !($row = $db->sql_fetchrow($result)) ) + { + message_die(GENERAL_ERROR, 'Could not obtain user info for moderator list', '', __LINE__, __FILE__, $sql); + } + + $group_moderator = $row['username']; + } + else { - message_die(GENERAL_ERROR, 'Could not obtain user info for moderator list', '', __LINE__, __FILE__, $sql); + $group_moderator = $row['username']; } - $group_moderator = $row['username']; - $group_open = ( $group_info['group_type'] == GROUP_OPEN ) ? ' checked="checked"' : ''; $group_closed = ( $group_info['group_type'] == GROUP_CLOSED ) ? ' checked="checked"' : ''; $group_hidden = ( $group_info['group_type'] == GROUP_HIDDEN ) ? ' checked="checked"' : '';