Zeile 99 | Zeile 99 |
---|
$cache->update_reportedcontent();
// Log admin action
|
$cache->update_reportedcontent();
// Log admin action
|
log_admin_action($user['uid'], $user['username']);
| log_admin_action($user['uid'], htmlspecialchars_uni($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 154 | Zeile 154 |
---|
$cache->update_moderators();
// Log admin action
|
$cache->update_moderators();
// Log admin action
|
log_admin_action($ban['uid'], $user['username']);
| log_admin_action($ban['uid'], htmlspecialchars_uni($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 241 | Zeile 241 |
---|
$cache->update_banned();
// Log admin action
|
$cache->update_banned();
// Log admin action
|
log_admin_action($ban['uid'], $user['username']);
| log_admin_action($ban['uid'], htmlspecialchars_uni($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");
|
Zeile 268 | Zeile 268 |
---|
}
$form_container = new FormContainer($lang->edit_ban);
|
}
$form_container = new FormContainer($lang->edit_ban);
|
$form_container->output_row($lang->ban_username, "", $user['username']);
| $form_container->output_row($lang->ban_username, "", htmlspecialchars_uni($user['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_reason, "", $form->generate_text_area('reason', $mybb->input['reason'], array('id' => 'reason', 'maxlength' => '255')), 'reason'); if(count($banned_groups) > 1) {
|
Zeile 285 | Zeile 285 |
---|
{ if($time != '---') {
|
{ if($time != '---') {
|
$friendly_time = my_date("D, jS M Y @ g:ia", ban_date2timestamp($time));
| $friendly_time = my_date("D, jS M Y @ {$mybb->settings['timeformat']}", ban_date2timestamp($time));
|
$period = "{$period} ({$friendly_time})"; } $length_list[$time] = $period;
| $period = "{$period} ({$friendly_time})"; } $length_list[$time] = $period;
|
Zeile 314 | Zeile 314 |
---|
);
$user = get_user_by_username($mybb->input['username'], $options);
|
);
$user = get_user_by_username($mybb->input['username'], $options);
|
|
|
// Are we searching a user?
|
// Are we searching a user?
|
if(isset($mybb->input['search']) && $mybb->get_input('search') != '')
| if(isset($mybb->input['search']))
|
{ $where_sql = 'uid=\''.(int)$user['uid'].'\''; $where_sql_full = 'WHERE b.uid=\''.(int)$user['uid'].'\'';
| { $where_sql = 'uid=\''.(int)$user['uid'].'\''; $where_sql_full = 'WHERE b.uid=\''.(int)$user['uid'].'\'';
|
Zeile 324 | Zeile 324 |
---|
else { if(!$user['uid'])
|
else { if(!$user['uid'])
|
{
| {
|
$errors[] = $lang->error_invalid_username; } // 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_invalid_username; } // 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
|
{
| {
|
$query = $db->simple_select("banned", "uid", "uid='{$user['uid']}'"); if($db->fetch_field($query, "uid"))
|
$query = $db->simple_select("banned", "uid", "uid='{$user['uid']}'"); if($db->fetch_field($query, "uid"))
|
{ $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 351 | Zeile 351 |
---|
if($user['uid'] == $mybb->user['uid']) { $errors[] = $lang->error_ban_self;
|
if($user['uid'] == $mybb->user['uid']) { $errors[] = $lang->error_ban_self;
|
}
| }
|
// No errors? Insert if(!$errors)
| // No errors? Insert if(!$errors)
|
Zeile 405 | Zeile 405 |
---|
$cache->update_banned();
// Log admin action
|
$cache->update_banned();
// Log admin action
|
log_admin_action($user['uid'], $user['username'], $lifted);
| log_admin_action($user['uid'], htmlspecialchars_uni($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");
|
Zeile 441 | Zeile 441 |
---|
}
$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]\').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 463 | Zeile 545 |
---|
// Get the banned users while($ban = $db->fetch_array($query)) {
|
// Get the banned users while($ban = $db->fetch_array($query)) {
|
$profile_link = build_profile_link($ban['username'], $ban['uid'], "_blank");
| $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_date = my_date($mybb->settings['dateformat'], $ban['dateline']); if($ban['lifted'] == 'perm' || $ban['lifted'] == '' || $ban['bantime'] == 'perm' || $ban['bantime'] == '---') {
|
Zeile 497 | Zeile 579 |
---|
{ if($ban['admin'] == 0) {
|
{ if($ban['admin'] == 0) {
|
$ban['adminuser'] = "MyBB System";
| $ban['adminuser'] = $lang->mybb_engine;
|
} else {
| } else {
|
Zeile 521 | Zeile 603 |
---|
} $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 @ g:ia", 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_user, array('name' => 'search')); $form->output_submit_wrapper($buttons); $form->end();
| |
$page->output_footer(); }
| $page->output_footer(); }
|