aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r--phpBB/includes/acp/acp_bots.php18
-rw-r--r--phpBB/includes/acp/acp_users.php13
2 files changed, 17 insertions, 14 deletions
diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php
index dbee5f6eed..93108c7fec 100644
--- a/phpBB/includes/acp/acp_bots.php
+++ b/phpBB/includes/acp/acp_bots.php
@@ -279,7 +279,7 @@ class acp_bots
$cache->destroy('_bots');
add_log('admin', 'LOG_BOT_' . $log, $bot_row['bot_name']);
- trigger_error($user->lang['BOT_' . $log] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"));
+ trigger_error($user->lang['BOT_' . $log] . adm_back_link($this->u_action));
}
}
@@ -376,14 +376,19 @@ class acp_bots
$db->sql_freeresult($result);
}
+ /**
+ * Validate bot name against username table
+ */
function validate_botname($newname, $oldname = false)
{
global $db;
+
if ($oldname && utf8_clean_string($newname) === $oldname)
{
return true;
}
- // Admins might want to use names otherwise forbidden, thus we only check for duplicates.
+
+ // Admins might want to use names otherwise forbidden, thus we only check for duplicates.
$sql = 'SELECT username
FROM ' . USERS_TABLE . "
WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($newname)) . "'";
@@ -391,14 +396,7 @@ class acp_bots
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- if ($row)
- {
- return false;
- }
- else
- {
- return true;
- }
+ return ($row) ? false : true;
}
}
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 077764ddbb..cab16af7b6 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -120,10 +120,10 @@ class acp_users
WHERE module_basename = 'users'
AND module_enabled = 1
AND module_class = 'acp'
- GROUP BY module_mode, module_auth
- ORDER BY MIN(left_id)";
+ ORDER BY left_id, module_mode";
$result = $db->sql_query($sql);
+ $dropdown_modes = array();
while ($row = $db->sql_fetchrow($result))
{
if (!$this->p_master->module_auth($row['module_auth']))
@@ -131,11 +131,16 @@ class acp_users
continue;
}
- $selected = ($mode == $row['module_mode']) ? ' selected="selected"' : '';
- $s_form_options .= '<option value="' . $row['module_mode'] . '"' . $selected . '>' . $user->lang['ACP_USER_' . strtoupper($row['module_mode'])] . '</option>';
+ $dropdown_modes[$row['module_mode']] = true;
}
$db->sql_freeresult($result);
+ foreach ($dropdown_modes as $module_mode => $null)
+ {
+ $selected = ($mode == $module_mode) ? ' selected="selected"' : '';
+ $s_form_options .= '<option value="' . $module_mode . '"' . $selected . '>' . $user->lang['ACP_USER_' . strtoupper($module_mode)] . '</option>';
+ }
+
$template->assign_vars(array(
'U_BACK' => $this->u_action,
'U_MODE_SELECT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&amp;u=$user_id"),