Zeile 62 | Zeile 62 |
---|
$query = $db->simple_select("banned", "*", "uid='{$mybb->input['uid']}'"); $ban = $db->fetch_array($query);
|
$query = $db->simple_select("banned", "*", "uid='{$mybb->input['uid']}'"); $ban = $db->fetch_array($query);
|
if(!$ban['uid'])
| if(!$ban)
|
{ flash_message($lang->error_invalid_ban, 'error'); admin_redirect("index.php?module=user-banning");
| { flash_message($lang->error_invalid_ban, 'error'); admin_redirect("index.php?module=user-banning");
|
Zeile 70 | Zeile 70 |
---|
$user = get_user($ban['uid']);
|
$user = get_user($ban['uid']);
|
if(is_super_admin($user['uid']) && ($mybb->user['uid'] != $user['uid'] && !is_super_admin($mybb->user['uid'])))
| if(!$user || (is_super_admin($user['uid']) && ($mybb->user['uid'] != $user['uid'] && !is_super_admin($mybb->user['uid']))))
|
{ flash_message($lang->cannot_perform_action_super_admin_general, 'error'); admin_redirect("index.php?module=user-banning");
| { flash_message($lang->cannot_perform_action_super_admin_general, 'error'); admin_redirect("index.php?module=user-banning");
|
Zeile 122 | Zeile 122 |
---|
$query = $db->simple_select("banned", "*", "uid='{$mybb->input['uid']}'"); $ban = $db->fetch_array($query);
|
$query = $db->simple_select("banned", "*", "uid='{$mybb->input['uid']}'"); $ban = $db->fetch_array($query);
|
if(!$ban['uid'])
| if(!$ban)
|
{ flash_message($lang->error_invalid_ban, 'error'); admin_redirect("index.php?module=user-banning");
| { flash_message($lang->error_invalid_ban, 'error'); admin_redirect("index.php?module=user-banning");
|
Zeile 130 | Zeile 130 |
---|
$user = get_user($ban['uid']);
|
$user = get_user($ban['uid']);
|
if(is_super_admin($user['uid']) && ($mybb->user['uid'] != $user['uid'] && !is_super_admin($mybb->user['uid'])))
| if(!$user || (is_super_admin($user['uid']) && ($mybb->user['uid'] != $user['uid'] && !is_super_admin($mybb->user['uid']))))
|
{ flash_message($lang->cannot_perform_action_super_admin_general, 'error'); admin_redirect("index.php?module=user-banning");
| { flash_message($lang->cannot_perform_action_super_admin_general, 'error'); admin_redirect("index.php?module=user-banning");
|
Zeile 170 | Zeile 170 |
---|
$query = $db->simple_select("banned", "*", "uid='{$mybb->input['uid']}'"); $ban = $db->fetch_array($query);
|
$query = $db->simple_select("banned", "*", "uid='{$mybb->input['uid']}'"); $ban = $db->fetch_array($query);
|
if(empty($ban['uid']))
| if(!$ban)
|
{ flash_message($lang->error_invalid_ban, 'error'); admin_redirect("index.php?module=user-banning");
| { flash_message($lang->error_invalid_ban, 'error'); admin_redirect("index.php?module=user-banning");
|
Zeile 182 | Zeile 182 |
---|
if($mybb->request_method == "post") {
|
if($mybb->request_method == "post") {
|
if(!$ban['uid'])
| if(empty($ban['uid']))
|
{ $errors[] = $lang->error_invalid_username; }
| { $errors[] = $lang->error_invalid_username; }
|
Zeile 263 | Zeile 263 |
---|
else { $mybb->input = array_merge($mybb->input, $ban);
|
else { $mybb->input = array_merge($mybb->input, $ban);
|
| }
if(!empty($ban['gid'])) { $mybb->input['usergroup'] = $ban['gid']; } else if(!empty($user['usergroup'])) { $mybb->input['usergroup'] = $user['usergroup']; } else { $mybb->input['usergroup'] = 0;
|
}
$form_container = new FormContainer($lang->edit_ban);
| }
$form_container = new FormContainer($lang->edit_ban);
|
Zeile 271 | Zeile 284 |
---|
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'] == '')
|
{
| {
|
$mybb->input['bantime'] = '---'; $mybb->input['lifted'] = '---';
|
$mybb->input['bantime'] = '---'; $mybb->input['lifted'] = '---';
|
}
| }
|
foreach($ban_times as $time => $period) {
| foreach($ban_times as $time => $period) {
|
Zeile 289 | Zeile 302 |
---|
$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');
|
$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();
$buttons[] = $form->generate_submit_button($lang->update_ban);
| $form_container->end();
$buttons[] = $form->generate_submit_button($lang->update_ban);
|
Zeile 321 | Zeile 334 |
---|
} else {
|
} else {
|
if(empty($user['uid']))
| if(!$user)
|
{ $errors[] = $lang->error_invalid_username; }
| { $errors[] = $lang->error_invalid_username; }
|
Zeile 362 | Zeile 375 |
---|
else { $lifted = ban_date2timestamp($mybb->input['bantime']);
|
else { $lifted = ban_date2timestamp($mybb->input['bantime']);
|
}
| }
|
$reason = my_substr($mybb->input['reason'], 0, 255);
| $reason = my_substr($mybb->input['reason'], 0, 255);
|
Zeile 435 | Zeile 448 |
---|
{ $start = 0; $current_page = 1;
|
{ $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)
|
$form = new Form("index.php?module=user-banning", "post"); if($errors)
|
{
| {
|
$page->output_inline_error($errors);
|
$page->output_inline_error($errors);
|
}
| }
|
$mybb->input['username'] = $mybb->get_input('username'); $mybb->input['reason'] = $mybb->get_input('reason'); $mybb->input['bantime'] = $mybb->get_input('bantime');
if(isset($mybb->input['uid']) && empty($mybb->input['username']))
|
$mybb->input['username'] = $mybb->get_input('username'); $mybb->input['reason'] = $mybb->get_input('reason'); $mybb->input['bantime'] = $mybb->get_input('bantime');
if(isset($mybb->input['uid']) && empty($mybb->input['username']))
|
{
| {
|
$user = get_user($mybb->input['uid']); $mybb->input['username'] = $user['username'];
|
$user = get_user($mybb->input['uid']); $mybb->input['username'] = $user['username'];
|
| }
if(empty($mybb->input['usergroup'])) { if(!empty($mybb->settings['purgespammerbangroup'])) { $mybb->input['usergroup'] = $mybb->settings['purgespammerbangroup']; } else if(count($banned_groups)) { $group = array_keys($banned_groups); $mybb->input['usergroup'] = $group[0]; } else { $mybb->input['usergroup'] = 0; }
|
}
$form_container = new FormContainer($lang->ban_a_user);
| }
$form_container = new FormContainer($lang->ban_a_user);
|
Zeile 460 | Zeile 490 |
---|
$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) {
|
$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');
| $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');
|
} foreach($ban_times as $time => $period) {
| } foreach($ban_times as $time => $period) {
|