aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r--phpBB/includes/acp/acp_ban.php2
-rw-r--r--phpBB/includes/acp/acp_groups.php30
-rwxr-xr-xphpBB/includes/acp/acp_inactive.php2
-rw-r--r--phpBB/includes/acp/acp_logs.php6
-rw-r--r--phpBB/includes/acp/acp_main.php2
-rw-r--r--phpBB/includes/acp/acp_modules.php4
-rw-r--r--phpBB/includes/acp/acp_profile.php2
-rw-r--r--phpBB/includes/acp/acp_users.php27
-rw-r--r--phpBB/includes/acp/auth.php4
9 files changed, 58 insertions, 21 deletions
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php
index a4e860b7bc..44ab731072 100644
--- a/phpBB/includes/acp/acp_ban.php
+++ b/phpBB/includes/acp/acp_ban.php
@@ -126,7 +126,7 @@ class acp_ban
AND u.user_id = b.ban_userid
AND b.ban_userid <> 0
AND u.user_id <> ' . ANONYMOUS . '
- ORDER BY u.username ASC';
+ ORDER BY u.username_clean ASC';
break;
case 'ip':
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index fb58c33897..a418f279e8 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -54,6 +54,12 @@ class acp_groups
{
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
+
+ // Check if the user is allowed to manage this group if set to founder only.
+ if ($user->data['user_type'] != USER_FOUNDER && $group_row['group_founder_manage'])
+ {
+ trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
}
// Which page?
@@ -263,13 +269,22 @@ class acp_groups
$delete = request_var('delete', '');
$submit_ary = array(
- 'colour' => request_var('group_colour', ''),
- 'rank' => request_var('group_rank', 0),
- 'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0,
- 'legend' => isset($_REQUEST['group_legend']) ? 1 : 0,
- 'message_limit' => request_var('group_message_limit', 0)
+ 'colour' => request_var('group_colour', ''),
+ 'rank' => request_var('group_rank', 0),
+ 'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0,
+ 'legend' => isset($_REQUEST['group_legend']) ? 1 : 0,
+ 'message_limit' => request_var('group_message_limit', 0),
);
+ if ($user->data['user_type'] == USER_FOUNDER)
+ {
+ $submit_ary['founder_manage'] = isset($_REQUEST['group_founder_manage']) ? 1 : 0;
+ }
+ else
+ {
+ $submit_ary['founder_manage'] = 0;
+ }
+
if (!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl'] || $data['remotelink'])
{
$data['width'] = request_var('width', '');
@@ -329,7 +344,7 @@ class acp_groups
// were made.
$group_attributes = array();
- $test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit');
+ $test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'founder_manage');
foreach ($test_variables as $test)
{
if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test]))
@@ -483,16 +498,19 @@ class acp_groups
'S_SPECIAL_GROUP' => ($group_type == GROUP_SPECIAL) ? true : false,
'S_DISPLAY_GALLERY' => ($config['allow_avatar_local'] && !$display_gallery) ? true : false,
'S_IN_GALLERY' => ($config['allow_avatar_local'] && $display_gallery) ? true : false,
+ 'S_USER_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
'GROUP_NAME' => ($group_type == GROUP_SPECIAL) ? $user->lang['G_' . $group_name] : $group_name,
'GROUP_INTERNAL_NAME' => $group_name,
'GROUP_DESC' => $group_desc_data['text'],
'GROUP_RECEIVE_PM' => (isset($group_row['group_receive_pm']) && $group_row['group_receive_pm']) ? ' checked="checked"' : '',
+ 'GROUP_FOUNDER_MANAGE' => (isset($group_row['group_founder_manage']) && $group_row['group_founder_manage']) ? ' checked="checked"' : '',
'GROUP_LEGEND' => (isset($group_row['group_legend']) && $group_row['group_legend']) ? ' checked="checked"' : '',
'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0,
'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '',
+
'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'],
'S_DESC_URLS_CHECKED' => $group_desc_data['allow_urls'],
'S_DESC_SMILIES_CHECKED'=> $group_desc_data['allow_smilies'],
diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php
index 2834d25181..68eeaab5b4 100755
--- a/phpBB/includes/acp/acp_inactive.php
+++ b/phpBB/includes/acp/acp_inactive.php
@@ -132,7 +132,7 @@ class acp_inactive
// Sorting
$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('i' => $user->lang['SORT_INACTIVE'], 'j' => $user->lang['SORT_REG_DATE'], 'l' => $user->lang['SORT_LAST_VISIT'], 'r' => $user->lang['SORT_REASON'], 'u' => $user->lang['SORT_USERNAME']);
- $sort_by_sql = array('i' => 'user_inactive_time', 'j' => 'user_regdate', 'l' => 'user_lastvisit', 'r' => 'user_inactive_reason', 'u' => 'username');
+ $sort_by_sql = array('i' => 'user_inactive_time', 'j' => 'user_regdate', 'l' => 'user_lastvisit', 'r' => 'user_inactive_reason', 'u' => 'username_clean');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php
index d233d7c885..211b932115 100644
--- a/phpBB/includes/acp/acp_logs.php
+++ b/phpBB/includes/acp/acp_logs.php
@@ -68,7 +68,7 @@ class acp_logs
// Sorting
$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']);
- $sort_by_sql = array('u' => 'u.username', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
+ $sort_by_sql = array('u' => 'u.username_clean', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
@@ -127,8 +127,8 @@ class acp_logs
}
$template->assign_block_vars('log', array(
- 'USERNAME' => $row['username'],
- 'REPORTEE_USERNAME' => ($row['reportee_username'] && $row['user_id'] != $row['reportee_id']) ? $row['reportee_username'] : '',
+ 'USERNAME' => $row['username_full'],
+ 'REPORTEE_USERNAME' => ($row['reportee_username'] && $row['user_id'] != $row['reportee_id']) ? $row['reportee_username_full'] : '',
'IP' => $row['ip'],
'DATE' => $user->format_date($row['time']),
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index a321057fa2..d7e327e4d3 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -324,7 +324,7 @@ class acp_main
foreach ($log_data as $row)
{
$template->assign_block_vars('log', array(
- 'USERNAME' => $row['username'],
+ 'USERNAME' => $row['username_full'],
'IP' => $row['ip'],
'DATE' => $user->format_date($row['time']),
'ACTION' => $row['action'])
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php
index 72b87c3b92..c426e4607d 100644
--- a/phpBB/includes/acp/acp_modules.php
+++ b/phpBB/includes/acp/acp_modules.php
@@ -265,7 +265,7 @@ class acp_modules
// Category/not category?
$is_cat = (!$module_data['module_basename']) ? true : false;
- // Get module informations
+ // Get module information
$module_infos = $this->get_module_infos();
// Build name options
@@ -488,7 +488,7 @@ class acp_modules
}
/**
- * Get available module informations from module files
+ * Get available module information from module files
*/
function get_module_infos($module = '', $module_class = false)
{
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 9ce7f3ed92..8bfe2b8b36 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -936,7 +936,7 @@ class acp_profile
$field_id = request_var('field_id', 0);
- // Collect all informations, if something is going wrong, abort the operation
+ // Collect all information, if something is going wrong, abort the operation
$profile_sql = $profile_lang = $empty_lang = $profile_lang_fields = array();
$default_lang_id = $lang_defs['iso'][$config['default_lang']];
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index b4103da463..314514b8e2 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -949,7 +949,7 @@ class acp_users
// Sorting
$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']);
- $sort_by_sql = array('u' => 'l.username', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
+ $sort_by_sql = array('u' => 'u.username_clean', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
@@ -977,7 +977,7 @@ class acp_users
foreach ($log_data as $row)
{
$template->assign_block_vars('log', array(
- 'USERNAME' => $row['username'],
+ 'USERNAME' => $row['username_full'],
'IP' => $row['ip'],
'DATE' => $user->format_date($row['time']),
'ACTION' => nl2br($row['action']),
@@ -1185,7 +1185,7 @@ class acp_users
case 'prefs':
$data = array(
- 'dateformat' => request_var('dateformat', $user_row['user_dateformat']),
+ 'dateformat' => request_var('dateformat', $user_row['user_dateformat'], true),
'lang' => request_var('lang', $user_row['user_lang']),
'tz' => request_var('tz', (float) $user_row['user_timezone']),
'style' => request_var('style', $user_row['user_style']),
@@ -1843,6 +1843,19 @@ class acp_users
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
+ // Check the founder only entry for this group to make sure everything is well
+ $sql = 'SELECT group_founder_manage
+ FROM ' . GROUPS_TABLE . '
+ WHERE group_id = ' . $group_id;
+ $result = $db->sql_query($sql);
+ $founder_manage = (int) $db->sql_fetchfield('group_founder_manage');
+ $db->sql_freeresult($result);
+
+ if ($user->data['user_type'] != USER_FOUNDER && $founder_manage)
+ {
+ trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
+ }
+
// Add user/s to group
if ($error = group_user_add($group_id, $user_id))
{
@@ -1877,7 +1890,7 @@ class acp_users
$db->sql_freeresult($result);
// Select box for other groups
- $sql = 'SELECT group_id, group_name, group_type
+ $sql = 'SELECT group_id, group_name, group_type, group_founder_manage
FROM ' . GROUPS_TABLE . '
' . ((sizeof($id_ary)) ? 'WHERE ' . $db->sql_in_set('group_id', $id_ary, true) : '') . '
ORDER BY group_type DESC, group_name ASC';
@@ -1891,6 +1904,12 @@ class acp_users
continue;
}
+ // Do not display those groups not allowed to be managed
+ if ($user->data['user_type'] != USER_FOUNDER && $row['group_founder_manage'])
+ {
+ continue;
+ }
+
$s_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
}
$db->sql_freeresult($result);
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index bc17e4b4ae..35b0cd29e2 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -293,7 +293,7 @@ class auth_admin extends auth
$sql = 'SELECT user_id as ug_id, username as ug_name
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_id', array_keys($hold_ary)) . '
- ORDER BY username ASC';
+ ORDER BY username_clean ASC';
}
else
{
@@ -606,7 +606,7 @@ class auth_admin extends auth
$sql = 'SELECT user_id, username
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_id', $auth_ary['users']) . '
- ORDER BY username';
+ ORDER BY username_clean ASC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))