Zeile 40 | Zeile 40 |
---|
// Fetch banned groups $query = $db->simple_select("usergroups", "gid,title", "isbannedgroup=1", array('order_by' => 'title'));
|
// Fetch banned groups $query = $db->simple_select("usergroups", "gid,title", "isbannedgroup=1", array('order_by' => 'title'));
|
| $banned_groups = array();
|
while($group = $db->fetch_array($query)) { $banned_groups[$group['gid']] = $group['title'];
| while($group = $db->fetch_array($query)) { $banned_groups[$group['gid']] = $group['title'];
|
Zeile 99 | Zeile 100 |
---|
$cache->update_reportedcontent();
// Log admin action
|
$cache->update_reportedcontent();
// Log admin action
|
log_admin_action($user['uid'], htmlspecialchars_uni($user['username']));
| log_admin_action($user['uid'], $user['username']);
|
flash_message($lang->success_pruned, 'success'); admin_redirect("index.php?module=user-banning");
| flash_message($lang->success_pruned, 'success'); admin_redirect("index.php?module=user-banning");
|
Zeile 150 | Zeile 151 |
---|
$db->update_query("users", $updated_group, "uid='{$ban['uid']}'");
|
$db->update_query("users", $updated_group, "uid='{$ban['uid']}'");
|
$cache->update_banned();
| |
$cache->update_moderators();
// Log admin action
|
$cache->update_moderators();
// Log admin action
|
log_admin_action($ban['uid'], htmlspecialchars_uni($user['username']));
| log_admin_action($ban['uid'], $user['username']);
|
flash_message($lang->success_ban_lifted, 'success'); admin_redirect("index.php?module=user-banning");
| flash_message($lang->success_ban_lifted, 'success'); admin_redirect("index.php?module=user-banning");
|
Zeile 237 | Zeile 237 |
---|
$db->update_query('users', $update_array, "uid = {$ban['uid']}");
$plugins->run_hooks("admin_user_banning_edit_commit");
|
$db->update_query('users', $update_array, "uid = {$ban['uid']}");
$plugins->run_hooks("admin_user_banning_edit_commit");
|
$cache->update_banned();
| |
// Log admin action
|
// Log admin action
|
log_admin_action($ban['uid'], htmlspecialchars_uni($user['username']));
| log_admin_action($ban['uid'], $user['username']);
|
flash_message($lang->success_ban_updated, 'success'); admin_redirect("index.php?module=user-banning"); }
|
flash_message($lang->success_ban_updated, 'success'); admin_redirect("index.php?module=user-banning"); }
|
}
| }
|
$page->add_breadcrumb_item($lang->edit_ban); $page->output_header($lang->edit_ban);
| $page->add_breadcrumb_item($lang->edit_ban); $page->output_header($lang->edit_ban);
|
Zeile 273 | Zeile 271 |
---|
if(count($banned_groups) > 1) { $form_container->output_row($lang->ban_group, $lang->ban_group_desc, $form->generate_select_box('usergroup', $banned_groups, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup');
|
if(count($banned_groups) > 1) { $form_container->output_row($lang->ban_group, $lang->ban_group_desc, $form->generate_select_box('usergroup', $banned_groups, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup');
|
}
| }
|
if($mybb->input['bantime'] == 'perm' || $mybb->input['bantime'] == '' || $mybb->input['lifted'] == 'perm' ||$mybb->input['lifted'] == '') {
| if($mybb->input['bantime'] == 'perm' || $mybb->input['bantime'] == '' || $mybb->input['lifted'] == 'perm' ||$mybb->input['lifted'] == '') {
|
Zeile 284 | Zeile 282 |
---|
foreach($ban_times as $time => $period) { if($time != '---')
|
foreach($ban_times as $time => $period) { if($time != '---')
|
{
| {
|
$friendly_time = my_date("D, jS M Y @ {$mybb->settings['timeformat']}", ban_date2timestamp($time)); $period = "{$period} ({$friendly_time})"; }
| $friendly_time = my_date("D, jS M Y @ {$mybb->settings['timeformat']}", ban_date2timestamp($time)); $period = "{$period} ({$friendly_time})"; }
|
Zeile 306 | Zeile 304 |
---|
$where_sql_full = $where_sql = '';
$plugins->run_hooks("admin_user_banning_start");
|
$where_sql_full = $where_sql = '';
$plugins->run_hooks("admin_user_banning_start");
|
|
|
if($mybb->request_method == "post") { $options = array( 'fields' => array('username', 'usergroup', 'additionalgroups', 'displaygroup') );
|
if($mybb->request_method == "post") { $options = array( 'fields' => array('username', 'usergroup', 'additionalgroups', 'displaygroup') );
|
|
|
$user = get_user_by_username($mybb->input['username'], $options);
|
$user = get_user_by_username($mybb->input['username'], $options);
|
|
|
// Are we searching a user? if(isset($mybb->input['search'])) {
| // Are we searching a user? if(isset($mybb->input['search'])) {
|
Zeile 329 | Zeile 327 |
---|
} // Is the user we're trying to ban a super admin and we're not? else if(is_super_admin($user['uid']) && !is_super_admin($mybb->user['uid']))
|
} // Is the user we're trying to ban a super admin and we're not? else if(is_super_admin($user['uid']) && !is_super_admin($mybb->user['uid']))
|
{
| {
|
$errors[] = $lang->error_no_perm_to_ban; } else
| $errors[] = $lang->error_no_perm_to_ban; } else
|
Zeile 339 | Zeile 337 |
---|
{ $errors[] = $lang->error_already_banned; }
|
{ $errors[] = $lang->error_already_banned; }
|
|
|
// Get PRIMARY usergroup information $usergroups = $cache->read("usergroups"); if(!empty($usergroups[$user['usergroup']]) && $usergroups[$user['usergroup']]['isbannedgroup'] == 1)
| // Get PRIMARY usergroup information $usergroups = $cache->read("usergroups"); if(!empty($usergroups[$user['usergroup']]) && $usergroups[$user['usergroup']]['isbannedgroup'] == 1)
|
Zeile 401 | Zeile 399 |
---|
$plugins->run_hooks("admin_user_banning_start_commit");
$db->update_query('users', $update_array, "uid = '{$user['uid']}'");
|
$plugins->run_hooks("admin_user_banning_start_commit");
$db->update_query('users', $update_array, "uid = '{$user['uid']}'");
|
$cache->update_banned();
| |
// Log admin action
|
// Log admin action
|
log_admin_action($user['uid'], htmlspecialchars_uni($user['username']), $lifted);
| log_admin_action($user['uid'], $user['username'], $lifted);
|
flash_message($lang->success_banned, 'success'); admin_redirect("index.php?module=user-banning"); } } }
|
flash_message($lang->success_banned, 'success'); admin_redirect("index.php?module=user-banning"); } } }
|
|
|
$page->output_header($lang->banned_accounts);
|
$page->output_header($lang->banned_accounts);
|
|
|
$page->output_nav_tabs($sub_tabs, "bans");
|
$page->output_nav_tabs($sub_tabs, "bans");
|
|
|
$query = $db->simple_select("banned", "COUNT(*) AS ban_count", $where_sql); $ban_count = $db->fetch_field($query, "ban_count");
$per_page = 20;
|
$query = $db->simple_select("banned", "COUNT(*) AS ban_count", $where_sql); $ban_count = $db->fetch_field($query, "ban_count");
$per_page = 20;
|
|
|
if($mybb->input['page'] > 0) { $current_page = $mybb->get_input('page', MyBB::INPUT_INT);
| if($mybb->input['page'] > 0) { $current_page = $mybb->get_input('page', MyBB::INPUT_INT);
|
Zeile 432 | Zeile 428 |
---|
{ $start = 0; $current_page = 1;
|
{ $start = 0; $current_page = 1;
|
} }
| } }
|
else { $start = 0; $current_page = 1;
|
else { $start = 0; $current_page = 1;
|
}
| }
|
$pagination = draw_admin_pagination($current_page, $per_page, $ban_count, "index.php?module=user-banning&page={page}");
|
$pagination = draw_admin_pagination($current_page, $per_page, $ban_count, "index.php?module=user-banning&page={page}");
|
| $form = new Form("index.php?module=user-banning", "post"); if($errors) { $page->output_inline_error($errors); }
if($mybb->input['uid'] && !$mybb->input['username']) { $user = get_user($mybb->input['uid']); $mybb->input['username'] = $user['username']; }
$form_container = new FormContainer($lang->ban_a_user); $form_container->output_row($lang->ban_username, $lang->autocomplete_enabled, $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username'); $form_container->output_row($lang->ban_reason, "", $form->generate_text_area('reason', $mybb->input['reason'], array('id' => 'reason', 'maxlength' => '255')), 'reason'); if(count($banned_groups) > 1) { $form_container->output_row($lang->ban_group, $lang->add_ban_group_desc, $form->generate_select_box('usergroup', $banned_groups, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup'); } foreach($ban_times as $time => $period) { if($time != "---") { $friendly_time = my_date("D, jS M Y @ {$mybb->settings['timeformat']}", ban_date2timestamp($time)); $period = "{$period} ({$friendly_time})"; } $length_list[$time] = $period; } $form_container->output_row($lang->ban_time, "", $form->generate_select_box('bantime', $length_list, $mybb->input['bantime'], array('id' => 'bantime')), 'bantime');
$form_container->end();
// Autocompletion for usernames echo ' <link rel="stylesheet" href="../jscripts/select2/select2.css"> <script type="text/javascript" src="../jscripts/select2/select2.min.js?ver=1804"></script> <script type="text/javascript"> <!-- $("#username").select2({ placeholder: "'.$lang->search_for_a_user.'", minimumInputLength: 2, multiple: false, ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper url: "../xmlhttp.php?action=get_users", dataType: \'json\', data: function (term, page) { return { query: term, // search term }; }, results: function (data, page) { // parse the results into the format expected by Select2. // since we are using custom formatting functions we do not need to alter remote JSON data return {results: data}; } }, initSelection: function(element, callback) { var query = $(element).val(); if (query !== "") { $.ajax("../xmlhttp.php?action=get_users&getone=1", { data: { query: query }, dataType: "json" }).done(function(data) { callback(data); }); } }, });
$(\'[for=username]\').on(\'click\', function(){ $("#username").select2(\'open\'); return false; }); // --> </script>';
$buttons[] = $form->generate_submit_button($lang->ban_user); $buttons[] = $form->generate_submit_button($lang->search_for_a_user, array('name' => 'search')); $form->output_submit_wrapper($buttons); $form->end();
echo '<br />';
|
$table = new Table; $table->construct_header($lang->user);
| $table = new Table; $table->construct_header($lang->user);
|
Zeile 466 | Zeile 544 |
---|
$profile_link = build_profile_link(htmlspecialchars_uni($ban['username']), $ban['uid'], "_blank"); $ban_date = my_date($mybb->settings['dateformat'], $ban['dateline']); if($ban['lifted'] == 'perm' || $ban['lifted'] == '' || $ban['bantime'] == 'perm' || $ban['bantime'] == '---')
|
$profile_link = build_profile_link(htmlspecialchars_uni($ban['username']), $ban['uid'], "_blank"); $ban_date = my_date($mybb->settings['dateformat'], $ban['dateline']); if($ban['lifted'] == 'perm' || $ban['lifted'] == '' || $ban['bantime'] == 'perm' || $ban['bantime'] == '---')
|
{
| {
|
$ban_period = $lang->permenantly; $time_remaining = $lifts_on = $lang->na; }
| $ban_period = $lang->permenantly; $time_remaining = $lifts_on = $lang->na; }
|
Zeile 521 | Zeile 599 |
---|
} $table->output($lang->banned_accounts); echo $pagination;
|
} $table->output($lang->banned_accounts); echo $pagination;
|
$form = new Form("index.php?module=user-banning", "post"); if($errors) { $page->output_inline_error($errors); }
if($mybb->input['uid'] && !$mybb->input['username']) { $user = get_user($mybb->input['uid']); $mybb->input['username'] = $user['username']; }
$form_container = new FormContainer($lang->ban_a_user); $form_container->output_row($lang->ban_username, $lang->autocomplete_enabled, $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username'); $form_container->output_row($lang->ban_reason, "", $form->generate_text_area('reason', $mybb->input['reason'], array('id' => 'reason', 'maxlength' => '255')), 'reason'); if(count($banned_groups) > 1) { $form_container->output_row($lang->ban_group, $lang->add_ban_group_desc, $form->generate_select_box('usergroup', $banned_groups, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup'); } foreach($ban_times as $time => $period) { if($time != "---") { $friendly_time = my_date("D, jS M Y @ {$mybb->settings['timeformat']}", ban_date2timestamp($time)); $period = "{$period} ({$friendly_time})"; } $length_list[$time] = $period; } $form_container->output_row($lang->ban_time, "", $form->generate_select_box('bantime', $length_list, $mybb->input['bantime'], array('id' => 'bantime')), 'bantime');
$form_container->end();
// Autocompletion for usernames echo ' <link rel="stylesheet" href="../jscripts/select2/select2.css"> <script type="text/javascript" src="../jscripts/select2/select2.min.js?ver=1804"></script> <script type="text/javascript"> <!-- $("#username").select2({ placeholder: "'.$lang->search_for_a_user.'", minimumInputLength: 2, multiple: false, ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper url: "../xmlhttp.php?action=get_users", dataType: \'json\', data: function (term, page) { return { query: term, // search term }; }, results: function (data, page) { // parse the results into the format expected by Select2. // since we are using custom formatting functions we do not need to alter remote JSON data return {results: data}; } }, initSelection: function(element, callback) { var query = $(element).val(); if (query !== "") { $.ajax("../xmlhttp.php?action=get_users&getone=1", { data: { query: query }, dataType: "json" }).done(function(data) { callback(data); }); } }, });
$(\'[for=username]\').click(function(){ $("#username").select2(\'open\'); return false; }); // --> </script>';
$buttons[] = $form->generate_submit_button($lang->ban_user); $buttons[] = $form->generate_submit_button($lang->search_for_a_user, array('name' => 'search')); $form->output_submit_wrapper($buttons); $form->end();
| |
$page->output_footer(); }
| $page->output_footer(); }
|