diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-06-22 15:14:03 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-06-22 15:14:03 +0000 |
commit | 725b21f2d206efb4b34eb95ec3329bc81f66b805 (patch) | |
tree | 7de41ee058c21e1884bc5d2292f5e7014a587890 /phpBB/includes/acp/acp_users.php | |
parent | daa0435614af7bed95e71f3b11aa2c372df3958d (diff) | |
download | forums-725b21f2d206efb4b34eb95ec3329bc81f66b805.tar forums-725b21f2d206efb4b34eb95ec3329bc81f66b805.tar.gz forums-725b21f2d206efb4b34eb95ec3329bc81f66b805.tar.bz2 forums-725b21f2d206efb4b34eb95ec3329bc81f66b805.tar.xz forums-725b21f2d206efb4b34eb95ec3329bc81f66b805.zip |
time to squash some bugs
git-svn-id: file:///svn/phpbb/trunk@6114 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp/acp_users.php')
-rw-r--r-- | phpBB/includes/acp/acp_users.php | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index a30078d7bf..6875d19178 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -133,7 +133,7 @@ class acp_users // Prevent normal users/admins change/view founders if they are not a founder by themselves if ($user->data['user_type'] != USER_FOUNDER && $user_row['user_type'] == USER_FOUNDER) { - trigger_error($user->lang['NOT_MANAGE_FOUNDER'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NOT_MANAGE_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id)); } switch ($mode) @@ -657,9 +657,34 @@ class acp_users $sql_ary['user_warnings'] = $data['warnings']; } - if (($user_row['user_type'] == USER_FOUNDER && !$data['user_founder']) || ($user_row['user_type'] != USER_FOUNDER && $data['user_founder'])) + // Only allow founders updating the founder status... + if ($user->data['user_type'] == USER_FOUNDER) { - $sql_ary['user_type'] = ($data['user_founder']) ? USER_FOUNDER : USER_NORMAL; + // Setting a normal member to be a founder + if ($data['user_founder'] && $user_row['user_type'] != USER_FOUNDER) + { + $sql_ary['user_type'] = USER_FOUNDER; + } + else if (!$data['user_founder'] && $user_row['user_type'] == USER_FOUNDER) + { + // Check if at least one founder is present + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_FOUNDER . ' + AND user_id <> ' . $user_id; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $sql_ary['user_type'] = USER_NORMAL; + } + else + { + trigger_error($user->lang['AT_LEAST_ONE_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id)); + } + } } } @@ -1252,7 +1277,7 @@ class acp_users 'S_LANG_OPTIONS' => language_select($lang), 'S_STYLE_OPTIONS' => style_select($style), - 'S_TZ_OPTIONS' => tz_select($tz), + 'S_TZ_OPTIONS' => tz_select($tz, true), ) ); |