Zeile 254 | Zeile 254 |
---|
my_mail($user['email'], $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']), $message);
// Log admin action
|
my_mail($user['email'], $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']), $message);
// Log admin action
|
log_admin_action($user['uid'], $user['username']);
| log_admin_action($user['uid'], htmlspecialchars_uni($user['username']));
|
if($mybb->input['from'] == "home") {
| if($mybb->input['from'] == "home") {
|
Zeile 359 | Zeile 359 |
---|
$plugins->run_hooks("admin_user_users_add_commit");
// Log admin action
|
$plugins->run_hooks("admin_user_users_add_commit");
// Log admin action
|
log_admin_action($user_info['uid'], $user_info['username']);
| log_admin_action($user_info['uid'], htmlspecialchars_uni($user_info['username']));
|
flash_message($lang->success_user_created, 'success'); admin_redirect("index.php?module=user-users&action=edit&uid={$user_info['uid']}");
| flash_message($lang->success_user_created, 'success'); admin_redirect("index.php?module=user-users&action=edit&uid={$user_info['uid']}");
|
Zeile 393 | Zeile 393 |
---|
}
$form_container = new FormContainer($lang->required_profile_info);
|
}
$form_container = new FormContainer($lang->required_profile_info);
|
$form_container->output_row($lang->username." <em>*</em>", "", $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username');
| $form_container->output_row($lang->username." <em>*</em>", "", $form->generate_text_box('username', htmlspecialchars_uni($mybb->get_input('username')), array('id' => 'username')), 'username');
|
$form_container->output_row($lang->password." <em>*</em>", "", $form->generate_password_box('password', $mybb->input['password'], array('id' => 'password', 'autocomplete' => 'off')), 'password'); $form_container->output_row($lang->confirm_password." <em>*</em>", "", $form->generate_password_box('confirm_password', $mybb->input['confirm_password'], array('id' => 'confirm_new_password')), 'confirm_new_password'); $form_container->output_row($lang->email_address." <em>*</em>", "", $form->generate_text_box('email', $mybb->input['email'], array('id' => 'email')), 'email');
| $form_container->output_row($lang->password." <em>*</em>", "", $form->generate_password_box('password', $mybb->input['password'], array('id' => 'password', 'autocomplete' => 'off')), 'password'); $form_container->output_row($lang->confirm_password." <em>*</em>", "", $form->generate_password_box('confirm_password', $mybb->input['confirm_password'], array('id' => 'confirm_new_password')), 'confirm_new_password'); $form_container->output_row($lang->email_address." <em>*</em>", "", $form->generate_text_box('email', $mybb->input['email'], array('id' => 'email')), 'email');
|
Zeile 462 | Zeile 462 |
---|
$returndate = ""; if(!empty($mybb->input['away_day']))
|
$returndate = ""; if(!empty($mybb->input['away_day']))
|
{
| {
|
$awaydate = TIME_NOW; // If the user has indicated that they will return on a specific day, but not month or year, assume it is current month and year if(!$mybb->input['away_month'])
| $awaydate = TIME_NOW; // If the user has indicated that they will return on a specific day, but not month or year, assume it is current month and year if(!$mybb->input['away_month'])
|
Zeile 524 | Zeile 524 |
---|
"signature" => $mybb->input['signature'], "dateformat" => $mybb->get_input('dateformat', MyBB::INPUT_INT), "timeformat" => $mybb->get_input('timeformat', MyBB::INPUT_INT),
|
"signature" => $mybb->input['signature'], "dateformat" => $mybb->get_input('dateformat', MyBB::INPUT_INT), "timeformat" => $mybb->get_input('timeformat', MyBB::INPUT_INT),
|
"language" => $mybb->input['language'],
| |
"usernotes" => $mybb->input['usernotes'], "away" => array( "away" => $mybb->input['away'],
| "usernotes" => $mybb->input['usernotes'], "away" => array( "away" => $mybb->input['away'],
|
Zeile 628 | Zeile 627 |
---|
// Are we setting a new avatar from a URL? else if($mybb->input['avatar_url'] && $mybb->input['avatar_url'] != $user['avatar']) {
|
// Are we setting a new avatar from a URL? else if($mybb->input['avatar_url'] && $mybb->input['avatar_url'] != $user['avatar']) {
|
if(filter_var($mybb->input['avatar_url'], FILTER_VALIDATE_EMAIL) !== false) { // Gravatar $email = md5(strtolower(trim($mybb->input['avatar_url'])));
$s = ''; if(!$mybb->settings['maxavatardims']) { $mybb->settings['maxavatardims'] = '100x100'; // Hard limit of 100 if there are no limits }
// Because Gravatars are square, hijack the width list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));
$s = "?s={$maxwidth}"; $maxheight = (int)$maxwidth;
$extra_user_updates = array( "avatar" => "http://www.gravatar.com/avatar/{$email}{$s}", "avatardimensions" => "{$maxheight}|{$maxheight}", "avatartype" => "gravatar" );
| if(!$mybb->settings['allowremoteavatars']) { $errors = array($lang->error_remote_avatar_not_allowed);
|
} else {
|
} else {
|
$mybb->input['avatar_url'] = preg_replace("#script:#i", "", $mybb->input['avatar_url']); $ext = get_extension($mybb->input['avatar_url']);
// Copy the avatar to the local server (work around remote URL access disabled for getimagesize) $file = fetch_remote_file($mybb->input['avatar_url']); if(!$file) { $avatar_error = $lang->error_invalidavatarurl;
| if(filter_var($mybb->input['avatar_url'], FILTER_VALIDATE_EMAIL) !== false) { // Gravatar $email = md5(strtolower(trim($mybb->input['avatar_url'])));
$s = ''; if(!$mybb->settings['maxavatardims']) { $mybb->settings['maxavatardims'] = '100x100'; // Hard limit of 100 if there are no limits }
// Because Gravatars are square, hijack the width list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));
$s = "?s={$maxwidth}"; $maxheight = (int)$maxwidth;
$extra_user_updates = array( "avatar" => "https://www.gravatar.com/avatar/{$email}{$s}", "avatardimensions" => "{$maxheight}|{$maxheight}", "avatartype" => "gravatar" );
|
} else {
|
} else {
|
$tmp_name = "../".$mybb->settings['avataruploadpath']."/remote_".md5(random_str()); $fp = @fopen($tmp_name, "wb"); if(!$fp) {
| $mybb->input['avatar_url'] = preg_replace("#script:#i", "", $mybb->input['avatar_url']); $ext = get_extension($mybb->input['avatar_url']);
// Copy the avatar to the local server (work around remote URL access disabled for getimagesize) $file = fetch_remote_file($mybb->input['avatar_url']); if(!$file) {
|
$avatar_error = $lang->error_invalidavatarurl;
|
$avatar_error = $lang->error_invalidavatarurl;
|
} else { fwrite($fp, $file); fclose($fp); list($width, $height, $type) = @getimagesize($tmp_name); @unlink($tmp_name); echo $type; if(!$type)
| } else { $tmp_name = "../".$mybb->settings['avataruploadpath']."/remote_".md5(random_str()); $fp = @fopen($tmp_name, "wb"); if(!$fp)
|
{ $avatar_error = $lang->error_invalidavatarurl;
|
{ $avatar_error = $lang->error_invalidavatarurl;
|
} } }
| } else { fwrite($fp, $file); fclose($fp); list($width, $height, $type) = @getimagesize($tmp_name); @unlink($tmp_name); echo $type; if(!$type) { $avatar_error = $lang->error_invalidavatarurl; } } }
if(empty($avatar_error)) { if($width && $height && $mybb->settings['maxavatardims'] != "") { list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims'])); if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight)) { $lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight); $avatar_error = $lang->error_avatartoobig; } } }
|
|
|
if(empty($avatar_error)) { if($width && $height && $mybb->settings['maxavatardims'] != "")
| if(empty($avatar_error))
|
{
|
{
|
list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims'])); if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight))
| if($width > 0 && $height > 0)
|
{
|
{
|
$lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight); $avatar_error = $lang->error_avatartoobig;
| $avatar_dimensions = (int)$width."|".(int)$height;
|
}
|
}
|
} }
if(empty($avatar_error)) { if($width > 0 && $height > 0)
| $extra_user_updates = array( "avatar" => $db->escape_string($mybb->input['avatar_url'].'?dateline='.TIME_NOW), "avatardimensions" => $avatar_dimensions, "avatartype" => "remote" ); remove_avatars($user['uid']); } else
|
{
|
{
|
$avatar_dimensions = (int)$width."|".(int)$height;
| $errors = array($avatar_error);
|
}
|
}
|
$extra_user_updates = array( "avatar" => $db->escape_string($mybb->input['avatar_url'].'?dateline='.TIME_NOW), "avatardimensions" => $avatar_dimensions, "avatartype" => "remote" ); remove_avatars($user['uid']); } else { $errors = array($avatar_error);
| |
} } }
| } } }
|
Zeile 830 | Zeile 836 |
---|
}
$plugins->run_hooks("admin_user_users_edit_commit");
|
}
$plugins->run_hooks("admin_user_users_edit_commit");
|
| if($user['usergroup'] == 5 && $mybb->input['usergroup'] != 5) { $cache->update_awaitingactivation(); }
|
// Log admin action
|
// Log admin action
|
log_admin_action($user['uid'], $mybb->input['username']);
| log_admin_action($user['uid'], htmlspecialchars_uni($mybb->input['username']));
|
flash_message($lang->success_user_updated, 'success'); admin_redirect("index.php?module=user-users");
|
flash_message($lang->success_user_updated, 'success'); admin_redirect("index.php?module=user-users");
|
} }
| } }
|
}
if(!$errors)
| }
if(!$errors)
|
Zeile 878 | Zeile 889 |
---|
if($user['birthday']) { $mybb->input['bday'] = explode('-', $user['birthday']);
|
if($user['birthday']) { $mybb->input['bday'] = explode('-', $user['birthday']);
|
} }
| } }
|
if($mybb->input['away_day'] || $mybb->input['away_month'] || $mybb->input['away_year']) {
| if($mybb->input['away_day'] || $mybb->input['away_month'] || $mybb->input['away_year']) {
|
Zeile 919 | Zeile 930 |
---|
<link rel="stylesheet" href="../jscripts/sceditor/editor_themes/mybb.css" type="text/css" media="all" /> <script type="text/javascript" src="../jscripts/sceditor/jquery.sceditor.bbcode.min.js?ver=1805"></script>
|
<link rel="stylesheet" href="../jscripts/sceditor/editor_themes/mybb.css" type="text/css" media="all" /> <script type="text/javascript" src="../jscripts/sceditor/jquery.sceditor.bbcode.min.js?ver=1805"></script>
|
<script type="text/javascript" src="../jscripts/bbcodes_sceditor.js?ver=1804"></script>
| <script type="text/javascript" src="../jscripts/bbcodes_sceditor.js?ver=1808"></script>
|
<script type="text/javascript" src="../jscripts/sceditor/editor_plugins/undo.js?ver=1805"></script> EOF; $page->output_header($lang->edit_user);
| <script type="text/javascript" src="../jscripts/sceditor/editor_plugins/undo.js?ver=1805"></script> EOF; $page->output_header($lang->edit_user);
|
Zeile 927 | Zeile 938 |
---|
$sub_tabs['edit_user'] = array( 'title' => $lang->edit_user, 'description' => $lang->edit_user_desc
|
$sub_tabs['edit_user'] = array( 'title' => $lang->edit_user, 'description' => $lang->edit_user_desc
|
);
| );
|
$form = new Form("index.php?module=user-users&action=edit&uid={$user['uid']}", "post", "", 1);
|
$form = new Form("index.php?module=user-users&action=edit&uid={$user['uid']}", "post", "", 1);
|
|
|
$page->output_nav_tabs($sub_tabs, 'edit_user');
|
$page->output_nav_tabs($sub_tabs, 'edit_user');
|
|
|
// If we have any error messages, show them if($errors) { $page->output_inline_error($errors);
|
// If we have any error messages, show them if($errors) { $page->output_inline_error($errors);
|
}
| }
|
// Is this user a COPPA user? We show a warning & activate link if($user['coppauser']) {
| // Is this user a COPPA user? We show a warning & activate link if($user['coppauser']) {
|
Zeile 955 | Zeile 966 |
---|
); $tabs = $plugins->run_hooks("admin_user_users_edit_graph_tabs", $tabs); $page->output_tab_control($tabs);
|
); $tabs = $plugins->run_hooks("admin_user_users_edit_graph_tabs", $tabs); $page->output_tab_control($tabs);
|
|
|
// // OVERVIEW //
| // // OVERVIEW //
|
Zeile 966 | Zeile 977 |
---|
// Avatar $avatar_dimensions = explode("|", $user['avatardimensions']);
|
// Avatar $avatar_dimensions = explode("|", $user['avatardimensions']);
|
if($user['avatar'])
| if($user['avatar'] && (my_strpos($user['avatar'], '://') === false || $mybb->settings['allowremoteavatars']))
|
{ if($user['avatardimensions']) { require_once MYBB_ROOT."inc/functions_image.php"; list($width, $height) = explode("|", $user['avatardimensions']); $scaled_dimensions = scale_image($width, $height, 120, 120);
|
{ if($user['avatardimensions']) { require_once MYBB_ROOT."inc/functions_image.php"; list($width, $height) = explode("|", $user['avatardimensions']); $scaled_dimensions = scale_image($width, $height, 120, 120);
|
} else {
| } else {
|
$scaled_dimensions = array( "width" => 120, "height" => 120 );
|
$scaled_dimensions = array( "width" => 120, "height" => 120 );
|
} if(my_substr($user['avatar'], 0, 7) !== 'http://' && my_substr($user['avatar'], 0, 8) !== 'https://') {
| } if(!my_validate_url($user['avatar'])) {
|
$user['avatar'] = "../{$user['avatar']}\n";
|
$user['avatar'] = "../{$user['avatar']}\n";
|
}
| }
|
} else {
|
} else {
|
$user['avatar'] = "../".$mybb->settings['useravatar'];
| if(my_validate_url($mybb->settings['useravatar'])) { $user['avatar'] = str_replace('{theme}', 'images', $mybb->settings['useravatar']); } else { $user['avatar'] = "../".str_replace('{theme}', 'images', $mybb->settings['useravatar']); }
|
$scaled_dimensions = array( "width" => 120, "height" => 120
| $scaled_dimensions = array( "width" => 120, "height" => 120
|
Zeile 1007 | Zeile 1025 |
---|
if($user['dst'] == 1) { $timezone = $user['timezone']+1;
|
if($user['dst'] == 1) { $timezone = $user['timezone']+1;
|
}
| }
|
else { $timezone = $user['timezone'];
| else { $timezone = $user['timezone'];
|
Zeile 1024 | Zeile 1042 |
---|
if($posts_per_day > $user['postnum']) { $posts_per_day = $user['postnum'];
|
if($posts_per_day > $user['postnum']) { $posts_per_day = $user['postnum'];
|
}
| }
|
} $posts_per_day = my_number_format($posts_per_day);
| } $posts_per_day = my_number_format($posts_per_day);
|
Zeile 1094 | Zeile 1112 |
---|
$table->construct_cell("<strong>{$lang->last_known_ip}:</strong> ".my_inet_ntop($db->unescape_binary($user['lastip']))); $table->construct_row();
|
$table->construct_cell("<strong>{$lang->last_known_ip}:</strong> ".my_inet_ntop($db->unescape_binary($user['lastip']))); $table->construct_row();
|
$table->output("{$lang->user_overview}: {$user['username']}");
| $username = htmlspecialchars_uni($user['username']); $table->output("{$lang->user_overview}: {$username}");
|
echo "</div>\n";
//
| echo "</div>\n";
//
|
Zeile 1102 | Zeile 1121 |
---|
// echo "<div id=\"tab_profile\">\n";
|
// echo "<div id=\"tab_profile\">\n";
|
$form_container = new FormContainer($lang->required_profile_info.": {$user['username']}");
| $form_container = new FormContainer($lang->required_profile_info.": ".htmlspecialchars_uni($user['username']));
|
$form_container->output_row($lang->username." <em>*</em>", "", $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username'); $form_container->output_row($lang->new_password, $lang->new_password_desc, $form->generate_password_box('new_password', $mybb->input['new_password'], array('id' => 'new_password', 'autocomplete' => 'off')), 'new_password'); $form_container->output_row($lang->confirm_new_password, $lang->new_password_desc, $form->generate_password_box('confirm_new_password', $mybb->input['confirm_new_password'], array('id' => 'confirm_new_password')), 'confirm_new_password');
| $form_container->output_row($lang->username." <em>*</em>", "", $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username'); $form_container->output_row($lang->new_password, $lang->new_password_desc, $form->generate_password_box('new_password', $mybb->input['new_password'], array('id' => 'new_password', 'autocomplete' => 'off')), 'new_password'); $form_container->output_row($lang->confirm_new_password, $lang->new_password_desc, $form->generate_password_box('confirm_new_password', $mybb->input['confirm_new_password'], array('id' => 'confirm_new_password')), 'confirm_new_password');
|
Zeile 1120 | Zeile 1139 |
---|
if(!is_array($mybb->input['additionalgroups'])) { $mybb->input['additionalgroups'] = explode(',', $mybb->input['additionalgroups']);
|
if(!is_array($mybb->input['additionalgroups'])) { $mybb->input['additionalgroups'] = explode(',', $mybb->input['additionalgroups']);
|
}
| }
|
$form_container->output_row($lang->primary_user_group." <em>*</em>", "", $form->generate_select_box('usergroup', $options, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup'); $form_container->output_row($lang->additional_user_groups, $lang->additional_user_groups_desc, $form->generate_select_box('additionalgroups[]', $options, $mybb->input['additionalgroups'], array('id' => 'additionalgroups', 'multiple' => true, 'size' => 5)), 'additionalgroups'); $form_container->output_row($lang->display_user_group." <em>*</em>", "", $form->generate_select_box('displaygroup', $display_group_options, $mybb->input['displaygroup'], array('id' => 'displaygroup')), 'displaygroup');
| $form_container->output_row($lang->primary_user_group." <em>*</em>", "", $form->generate_select_box('usergroup', $options, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup'); $form_container->output_row($lang->additional_user_groups, $lang->additional_user_groups_desc, $form->generate_select_box('additionalgroups[]', $options, $mybb->input['additionalgroups'], array('id' => 'additionalgroups', 'multiple' => true, 'size' => 5)), 'additionalgroups'); $form_container->output_row($lang->display_user_group." <em>*</em>", "", $form->generate_select_box('displaygroup', $display_group_options, $mybb->input['displaygroup'], array('id' => 'displaygroup')), 'displaygroup');
|
Zeile 1137 | Zeile 1156 |
---|
$form_container->end();
|
$form_container->end();
|
$form_container = new FormContainer($lang->optional_profile_info.": {$user['username']}");
| $form_container = new FormContainer($lang->optional_profile_info.': '.htmlspecialchars_uni($user['username']));
|
$form_container->output_row($lang->custom_user_title, $lang->custom_user_title_desc, $form->generate_text_box('usertitle', $mybb->input['usertitle'], array('id' => 'usertitle')), 'usertitle'); $form_container->output_row($lang->website, "", $form->generate_text_box('website', $mybb->input['website'], array('id' => 'website')), 'website'); $form_container->output_row($lang->icq_number, "", $form->generate_numeric_field('icq', $mybb->input['icq'], array('id' => 'icq', 'min' => 0)), 'icq');
| $form_container->output_row($lang->custom_user_title, $lang->custom_user_title_desc, $form->generate_text_box('usertitle', $mybb->input['usertitle'], array('id' => 'usertitle')), 'usertitle'); $form_container->output_row($lang->website, "", $form->generate_text_box('website', $mybb->input['website'], array('id' => 'website')), 'website'); $form_container->output_row($lang->icq_number, "", $form->generate_numeric_field('icq', $mybb->input['icq'], array('id' => 'icq', 'min' => 0)), 'icq');
|
Zeile 1183 | Zeile 1202 |
---|
if($mybb->settings['allowaway'] != 0) {
|
if($mybb->settings['allowaway'] != 0) {
|
$form_container = new FormContainer($lang->away_information.": {$user['username']}");
| $form_container = new FormContainer($lang->away_information.': '.htmlspecialchars_uni($user['username']));
|
$awaycheck = array(false, true); if($mybb->input['away'] == 1) {
| $awaycheck = array(false, true); if($mybb->input['away'] == 1) {
|
Zeile 1211 | Zeile 1230 |
---|
// Plugin hook note - we should add hooks in above each output_row for the below so users can add their own options to each group :>
echo "<div id=\"tab_settings\">\n";
|
// Plugin hook note - we should add hooks in above each output_row for the below so users can add their own options to each group :>
echo "<div id=\"tab_settings\">\n";
|
$form_container = new FormContainer($lang->account_settings.": {$user['username']}");
| $form_container = new FormContainer($lang->account_settings.': '.htmlspecialchars_uni($user['username']));
|
$login_options = array( $form->generate_check_box("invisible", 1, $lang->hide_from_whos_online, array("checked" => $mybb->input['invisible'])), );
| $login_options = array( $form->generate_check_box("invisible", 1, $lang->hide_from_whos_online, array("checked" => $mybb->input['invisible'])), );
|
Zeile 1220 | Zeile 1239 |
---|
if($mybb->input['pmnotice'] > 1) { $mybb->input['pmnotice'] = 1;
|
if($mybb->input['pmnotice'] > 1) { $mybb->input['pmnotice'] = 1;
|
}
| }
|
$messaging_options = array( $form->generate_check_box("allownotices", 1, $lang->recieve_admin_emails, array("checked" => $mybb->input['allownotices'])),
| $messaging_options = array( $form->generate_check_box("allownotices", 1, $lang->recieve_admin_emails, array("checked" => $mybb->input['allownotices'])),
|
Zeile 1232 | Zeile 1251 |
---|
$form->generate_check_box("buddyrequestspm", 1, $lang->buddy_requests_pm, array("checked" => $mybb->input['buddyrequestspm'])), $form->generate_check_box("buddyrequestsauto", 1, $lang->buddy_requests_auto, array("checked" => $mybb->input['buddyrequestsauto'])), "<label for=\"subscriptionmethod\">{$lang->default_thread_subscription_mode}:</label><br />".$form->generate_select_box("subscriptionmethod", array($lang->do_not_subscribe, $lang->no_email_notification, $lang->instant_email_notification), $mybb->input['subscriptionmethod'], array('id' => 'subscriptionmethod'))
|
$form->generate_check_box("buddyrequestspm", 1, $lang->buddy_requests_pm, array("checked" => $mybb->input['buddyrequestspm'])), $form->generate_check_box("buddyrequestsauto", 1, $lang->buddy_requests_auto, array("checked" => $mybb->input['buddyrequestsauto'])), "<label for=\"subscriptionmethod\">{$lang->default_thread_subscription_mode}:</label><br />".$form->generate_select_box("subscriptionmethod", array($lang->do_not_subscribe, $lang->no_email_notification, $lang->instant_email_notification), $mybb->input['subscriptionmethod'], array('id' => 'subscriptionmethod'))
|
);
| );
|
$form_container->output_row($lang->messaging_and_notification, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $messaging_options)."</div>");
$date_format_options = array($lang->use_default); foreach($date_formats as $key => $format)
|
$form_container->output_row($lang->messaging_and_notification, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $messaging_options)."</div>");
$date_format_options = array($lang->use_default); foreach($date_formats as $key => $format)
|
{
| {
|
$date_format_options[$key] = my_date($format, TIME_NOW, "", 0); }
$time_format_options = array($lang->use_default); foreach($time_formats as $key => $format)
|
$date_format_options[$key] = my_date($format, TIME_NOW, "", 0); }
$time_format_options = array($lang->use_default); foreach($time_formats as $key => $format)
|
{
| {
|
$time_format_options[$key] = my_date($format, TIME_NOW, "", 0); }
| $time_format_options[$key] = my_date($format, TIME_NOW, "", 0); }
|
Zeile 1254 | Zeile 1273 |
---|
"<label for=\"dstcorrection\">{$lang->daylight_savings_time_correction}:</label><br />".$form->generate_select_box("dstcorrection", array(2 => $lang->automatically_detect, 1 => $lang->always_use_dst_correction, 0 => $lang->never_use_dst_correction), $mybb->input['dstcorrection'], array('id' => 'dstcorrection')) ); $form_container->output_row($lang->date_and_time_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $date_options)."</div>");
|
"<label for=\"dstcorrection\">{$lang->daylight_savings_time_correction}:</label><br />".$form->generate_select_box("dstcorrection", array(2 => $lang->automatically_detect, 1 => $lang->always_use_dst_correction, 0 => $lang->never_use_dst_correction), $mybb->input['dstcorrection'], array('id' => 'dstcorrection')) ); $form_container->output_row($lang->date_and_time_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $date_options)."</div>");
|
|
|
$tpp_options = array($lang->use_default); if($mybb->settings['usertppoptions'])
| $tpp_options = array($lang->use_default); if($mybb->settings['usertppoptions'])
|
Zeile 1266 | Zeile 1285 |
---|
{ if($tpp <= 0) continue; $tpp_options[$tpp] = $tpp;
|
{ if($tpp <= 0) continue; $tpp_options[$tpp] = $tpp;
|
} } }
| } } }
|
$thread_age_options = array( 0 => $lang->use_default,
| $thread_age_options = array( 0 => $lang->use_default,
|
Zeile 1355 | Zeile 1374 |
---|
$sig_imgcode = $lang->on; } echo "<div id=\"tab_signature\">\n";
|
$sig_imgcode = $lang->on; } echo "<div id=\"tab_signature\">\n";
|
$form_container = new FormContainer("{$lang->signature}: {$user['username']}");
| $form_container = new FormContainer($lang->signature.': '.htmlspecialchars_uni($user['username']));
|
$form_container->output_row($lang->signature, $lang->sprintf($lang->signature_desc, $sig_mycode, $sig_smilies, $sig_imgcode, $sig_html), $signature_editor, 'signature');
$periods = array(
| $form_container->output_row($lang->signature, $lang->sprintf($lang->signature_desc, $sig_mycode, $sig_smilies, $sig_imgcode, $sig_html), $signature_editor, 'signature');
$periods = array(
|
Zeile 1416 | Zeile 1435 |
---|
var sig_checked = "'.$sig_checked.'";
function toggleAction()
|
var sig_checked = "'.$sig_checked.'";
function toggleAction()
|
{
| {
|
if($("#suspend_action").is(\':visible\')) { $("#suspend_action").hide();
|
if($("#suspend_action").is(\':visible\')) { $("#suspend_action").hide();
|
}
| }
|
else { $("#suspend_action").show(); }
|
else { $("#suspend_action").show(); }
|
}
| }
|
// --> </script>
| // --> </script>
|
Zeile 1440 | Zeile 1459 |
---|
</table> </dd> </dl>
|
</table> </dd> </dl>
|
|
|
<script type="text/javascript"> <!-- if(sig_checked == 0)
| <script type="text/javascript"> <!-- if(sig_checked == 0)
|
Zeile 1456 | Zeile 1475 |
---|
$form->generate_radio_button("update_posts", "enable", $lang->enable_sig_in_all_posts, array("checked" => 0)), $form->generate_radio_button("update_posts", "disable", $lang->disable_sig_in_all_posts, array("checked" => 0)), $form->generate_radio_button("update_posts", "no", $lang->do_nothing, array("checked" => 1))
|
$form->generate_radio_button("update_posts", "enable", $lang->enable_sig_in_all_posts, array("checked" => 0)), $form->generate_radio_button("update_posts", "disable", $lang->disable_sig_in_all_posts, array("checked" => 0)), $form->generate_radio_button("update_posts", "no", $lang->do_nothing, array("checked" => 1))
|
);
$form_container->output_row($lang->signature_preferences, "", implode("<br />", $signature_options));
$form_container->end(); echo "</div>\n";
// // AVATAR MANAGER //
| );
$form_container->output_row($lang->signature_preferences, "", implode("<br />", $signature_options));
$form_container->end(); echo "</div>\n";
// // AVATAR MANAGER //
|
echo "<div id=\"tab_avatar\">\n"; $table = new Table; $table->construct_header($lang->current_avatar, array('colspan' => 2));
| echo "<div id=\"tab_avatar\">\n"; $table = new Table; $table->construct_header($lang->current_avatar, array('colspan' => 2));
|
Zeile 1477 | Zeile 1496 |
---|
{ $current_avatar_msg = "<br /><strong>{$lang->user_current_using_uploaded_avatar}</strong>"; }
|
{ $current_avatar_msg = "<br /><strong>{$lang->user_current_using_uploaded_avatar}</strong>"; }
|
elseif($user['avatartype'] == "remote" || my_strpos(my_strtolower($user['avatar']), "http://") !== false)
| elseif($user['avatartype'] == "remote" || my_validate_url($user['avatar']))
|
{ $current_avatar_msg = "<br /><strong>{$lang->user_current_using_remote_avatar}</strong>"; $avatar_url = $user['avatar'];
| { $current_avatar_msg = "<br /><strong>{$lang->user_current_using_remote_avatar}</strong>"; $avatar_url = $user['avatar'];
|
Zeile 1503 | Zeile 1522 |
---|
if($user['avatar']) { $remove_avatar = "<br /><br />".$form->generate_check_box("remove_avatar", 1, "<strong>{$lang->remove_avatar}</strong>");
|
if($user['avatar']) { $remove_avatar = "<br /><br />".$form->generate_check_box("remove_avatar", 1, "<strong>{$lang->remove_avatar}</strong>");
|
}
| }
|
$table->construct_cell($lang->avatar_desc."{$remove_avatar}<br /><small>{$max_size}</small>"); $table->construct_row();
|
$table->construct_cell($lang->avatar_desc."{$remove_avatar}<br /><small>{$max_size}</small>"); $table->construct_row();
|
$table->output($lang->avatar.": {$user['username']}");
| $table->output($lang->avatar.': '.htmlspecialchars_uni($user['username']));
|
// Custom avatar if($mybb->settings['avatarresizing'] == "auto")
| // Custom avatar if($mybb->settings['avatarresizing'] == "auto")
|
Zeile 1516 | Zeile 1535 |
---|
$auto_resize = $lang->avatar_auto_resize; } else if($mybb->settings['avatarresizing'] == "user")
|
$auto_resize = $lang->avatar_auto_resize; } else if($mybb->settings['avatarresizing'] == "user")
|
{
| {
|
$auto_resize = "<input type=\"checkbox\" name=\"auto_resize\" value=\"1\" checked=\"checked\" id=\"auto_resize\" /> <label for=\"auto_resize\">{$lang->attempt_to_auto_resize}</label></span>"; } $form_container = new FormContainer($lang->specify_custom_avatar); $form_container->output_row($lang->upload_avatar, $auto_resize, $form->generate_file_upload_box('avatar_upload', array('id' => 'avatar_upload')), 'avatar_upload');
|
$auto_resize = "<input type=\"checkbox\" name=\"auto_resize\" value=\"1\" checked=\"checked\" id=\"auto_resize\" /> <label for=\"auto_resize\">{$lang->attempt_to_auto_resize}</label></span>"; } $form_container = new FormContainer($lang->specify_custom_avatar); $form_container->output_row($lang->upload_avatar, $auto_resize, $form->generate_file_upload_box('avatar_upload', array('id' => 'avatar_upload')), 'avatar_upload');
|
$form_container->output_row($lang->or_specify_avatar_url, "", $form->generate_text_box('avatar_url', $avatar_url, array('id' => 'avatar_url')), 'avatar_url');
| if($mybb->settings['allowremoteavatars']) { $form_container->output_row($lang->or_specify_avatar_url, "", $form->generate_text_box('avatar_url', $avatar_url, array('id' => 'avatar_url')), 'avatar_url'); }
|
$form_container->end(); echo "</div>\n";
|
$form_container->end(); echo "</div>\n";
|
|
|
// // MODERATOR OPTIONS //
| // // MODERATOR OPTIONS //
|
Zeile 1537 | Zeile 1559 |
---|
);
echo "<div id=\"tab_modoptions\">\n";
|
);
echo "<div id=\"tab_modoptions\">\n";
|
$form_container = new FormContainer($lang->mod_options.": {$user['username']}");
| $form_container = new FormContainer($lang->mod_options.': '.htmlspecialchars_uni($user['username']));
|
$form_container->output_row($lang->user_notes, '', $form->generate_text_area('usernotes', $mybb->input['usernotes'], array('id' => 'usernotes')), 'usernotes');
|
$form_container->output_row($lang->user_notes, '', $form->generate_text_area('usernotes', $mybb->input['usernotes'], array('id' => 'usernotes')), 'usernotes');
|
|
|
// Mod posts // Generate check box $modpost_options = $form->generate_select_box('modpost_period', $periods, $mybb->input['modpost_period'], array('id' => 'modpost_period'));
|
// Mod posts // Generate check box $modpost_options = $form->generate_select_box('modpost_period', $periods, $mybb->input['modpost_period'], array('id' => 'modpost_period'));
|
|
|
// Do we have any existing suspensions here? $existing_info = ''; if($user['moderateposts'] || ($mybb->input['moderateposting'] && !empty($errors)))
| // Do we have any existing suspensions here? $existing_info = ''; if($user['moderateposts'] || ($mybb->input['moderateposting'] && !empty($errors)))
|
Zeile 1553 | Zeile 1575 |
---|
{ $remaining = $user['moderationtime']-TIME_NOW; $expired = nice_time($remaining, array('seconds' => false));
|
{ $remaining = $user['moderationtime']-TIME_NOW; $expired = nice_time($remaining, array('seconds' => false));
|
$color = 'inherit'; if($remaining < 3600) { $color = 'red'; } elseif($remaining < 86400) { $color = 'maroon'; } elseif($remaining < 604800) { $color = 'green'; }
| $color = 'inherit'; if($remaining < 3600) { $color = 'red'; } elseif($remaining < 86400) { $color = 'maroon'; } elseif($remaining < 604800) { $color = 'green'; }
|
$existing_info = $lang->sprintf($lang->moderate_length, $expired, $color); } else { $existing_info = $lang->moderated_perm;
|
$existing_info = $lang->sprintf($lang->moderate_length, $expired, $color); } else { $existing_info = $lang->moderated_perm;
|
}
| }
|
}
$modpost_div = '<div id="modpost">'.$existing_info.''.$lang->moderate_for.' '.$form->generate_numeric_field("modpost_time", $mybb->input['modpost_time'], array('style' => 'width: 3em;', 'min' => 0)).' '.$modpost_options.'</div>';
|
}
$modpost_div = '<div id="modpost">'.$existing_info.''.$lang->moderate_for.' '.$form->generate_numeric_field("modpost_time", $mybb->input['modpost_time'], array('style' => 'width: 3em;', 'min' => 0)).' '.$modpost_options.'</div>';
|
$lang->moderate_posts_info = $lang->sprintf($lang->moderate_posts_info, $user['username']);
| $lang->moderate_posts_info = $lang->sprintf($lang->moderate_posts_info, htmlspecialchars_uni($user['username']));
|
$form_container->output_row($form->generate_check_box("moderateposting", 1, $lang->moderate_posts, array("id" => "moderateposting", "onclick" => "toggleBox('modpost');", "checked" => $mybb->input['moderateposting'])), $lang->moderate_posts_info, $modpost_div);
// Suspend posts
| $form_container->output_row($form->generate_check_box("moderateposting", 1, $lang->moderate_posts, array("id" => "moderateposting", "onclick" => "toggleBox('modpost');", "checked" => $mybb->input['moderateposting'])), $lang->moderate_posts_info, $modpost_div);
// Suspend posts
|
Zeile 1592 | Zeile 1614 |
---|
if($user['suspensiontime'] == 0 || $mybb->input['suspost_period'] == "never") { $existing_info = $lang->suspended_perm;
|
if($user['suspensiontime'] == 0 || $mybb->input['suspost_period'] == "never") { $existing_info = $lang->suspended_perm;
|
}
| }
|
else { $remaining = $user['suspensiontime']-TIME_NOW;
| else { $remaining = $user['suspensiontime']-TIME_NOW;
|
Zeile 1604 | Zeile 1626 |
---|
$color = 'red'; } elseif($remaining < 86400)
|
$color = 'red'; } elseif($remaining < 86400)
|
{
| {
|
$color = 'maroon'; } elseif($remaining < 604800)
| $color = 'maroon'; } elseif($remaining < 604800)
|
Zeile 1617 | Zeile 1639 |
---|
}
$suspost_div = '<div id="suspost">'.$existing_info.''.$lang->suspend_for.' '.$form->generate_numeric_field("suspost_time", $mybb->input['suspost_time'], array('style' => 'width: 3em;', 'min' => 0)).' '.$suspost_options.'</div>';
|
}
$suspost_div = '<div id="suspost">'.$existing_info.''.$lang->suspend_for.' '.$form->generate_numeric_field("suspost_time", $mybb->input['suspost_time'], array('style' => 'width: 3em;', 'min' => 0)).' '.$suspost_options.'</div>';
|
$lang->suspend_posts_info = $lang->sprintf($lang->suspend_posts_info, $user['username']); $form_container->output_row($form->generate_check_box("suspendposting", 1, $lang->suspend_posts, array("id" => "suspendposting", "onclick" => "toggleBox('suspost');", "checked" => $mybb->input['suspendposting'])), $lang->suspend_posts_info, $suspost_div);
| $lang->suspend_posts_info = $lang->sprintf($lang->suspend_posts_info, htmlspecialchars_uni($user['username'])); $form_container->output_row($form->generate_check_box("suspendposting", 1, $lang->suspend_posts, array("id" => "suspendposting", "onclick" => "toggleBox('suspost');", "checked" => $mybb->input['suspendposting'])), $lang->suspend_posts_info, $suspost_div);
|
$form_container->end(); echo "</div>\n";
| $form_container->end(); echo "</div>\n";
|
Zeile 1734 | Zeile 1756 |
---|
$plugins->run_hooks("admin_user_users_delete_commit_end");
|
$plugins->run_hooks("admin_user_users_delete_commit_end");
|
log_admin_action($user['uid'], $user['username']);
| log_admin_action($user['uid'], htmlspecialchars_uni($user['username']));
|
flash_message($lang->success_user_deleted, 'success'); admin_redirect("index.php?module=user-users");
| flash_message($lang->success_user_deleted, 'success'); admin_redirect("index.php?module=user-users");
|
Zeile 1814 | Zeile 1836 |
---|
$user = $db->fetch_array($query);
// Log admin action
|
$user = $db->fetch_array($query);
// Log admin action
|
log_admin_action($user['uid'], $user['username']);
| log_admin_action($user['uid'], htmlspecialchars_uni($user['username']));
|
$table = new Table;
| $table = new Table;
|
Zeile 1879 | Zeile 1901 |
---|
$table->construct_row(); }
|
$table->construct_row(); }
|
$table->output($lang->ip_address_for." {$user['username']}");
| $table->output($lang->ip_address_for.' '.htmlspecialchars_uni($user['username']));
|
$page->output_footer(); }
| $page->output_footer(); }
|
Zeile 2109 | Zeile 2131 |
---|
$cache->update_awaitingactivation();
// Log admin action
|
$cache->update_awaitingactivation();
// Log admin action
|
log_admin_action($source_user['uid'], $source_user['username'], $destination_user['uid'], $destination_user['username']);
| log_admin_action($source_user['uid'], htmlspecialchars_uni($source_user['username']), $destination_user['uid'], htmlspecialchars_uni($destination_user['username']));
|
// Redirect!
|
// Redirect!
|
flash_message("<strong>{$source_user['username']}</strong> {$lang->success_merged} {$destination_user['username']}", "success");
| $username = htmlspecialchars_uni($source_user['username']); $destination_username = htmlspecialchars_uni($destination_user['username']); flash_message("<strong>{$username}</strong> {$lang->success_merged} {$destination_username}", "success");
|
admin_redirect("index.php?module=user-users"); exit; }
| admin_redirect("index.php?module=user-users"); exit; }
|
Zeile 2144 | Zeile 2168 |
---|
<!-- $("#source_username").select2({ placeholder: "'.$lang->search_for_a_user.'",
|
<!-- $("#source_username").select2({ placeholder: "'.$lang->search_for_a_user.'",
|
minimumInputLength: 3, maximumSelectionSize: 3,
| 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",
| multiple: false, ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper url: "../xmlhttp.php?action=get_users",
|
Zeile 2174 | Zeile 2197 |
---|
}); $("#destination_username").select2({ placeholder: "'.$lang->search_for_a_user.'",
|
}); $("#destination_username").select2({ placeholder: "'.$lang->search_for_a_user.'",
|
minimumInputLength: 3, maximumSelectionSize: 3,
| 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",
| multiple: false, ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper url: "../xmlhttp.php?action=get_users",
|
Zeile 2380 | Zeile 2402 |
---|
if($id != '') { $selected[] = (int)$id;
|
if($id != '') { $selected[] = (int)$id;
|
} }
// If there isn't anything to select, then output an error if(!is_array($selected)) { if($mybb->input['inline_action'] != "multilift" && $mybb->request_method != "post") { $errors[] = $lang->error_inline_no_users_selected; } }
if($errors) { // Don't show views, but show the user list if there's errors $inline = true; $mybb->input['action'] = ''; } else { // Let's continue! // Verify incoming POST request if(!verify_post_check($mybb->input['my_post_key'])) { flash_message($lang->invalid_post_verify_key2, 'error'); admin_redirect("index.php?module=user-user"); } $sub_tabs['manage_users'] = array( "title" => $lang->manage_users, "link" => "./", "description" => $lang->manage_users_desc ); $page->add_breadcrumb_item($lang->manage_users);
if(!is_array($selected)) { // Not selected any users, show error flash_message($lang->error_inline_no_users_selected, 'error'); admin_redirect("index.php?module=user-users".$vid_url); }
switch($mybb->input['inline_action']) { case 'multiactivate': // Run through the activating users, so that users already registered (but have been selected) aren't affected if(is_array($selected)) { $sql_array = implode(",", $selected); $query = $db->simple_select("users", "uid", "usergroup = '5' AND uid IN (".$sql_array.")"); while($user = $db->fetch_array($query)) { $to_update[] = $user['uid']; } }
if(is_array($to_update))
| } }
// Verify incoming POST request if(!verify_post_check($mybb->input['my_post_key'])) { flash_message($lang->invalid_post_verify_key2, 'error'); admin_redirect("index.php?module=user-user"); } $sub_tabs['manage_users'] = array( "title" => $lang->manage_users, "link" => "./", "description" => $lang->manage_users_desc ); $page->add_breadcrumb_item($lang->manage_users);
if(!is_array($selected)) { // Not selected any users, show error flash_message($lang->error_inline_no_users_selected, 'error'); admin_redirect("index.php?module=user-users".$vid_url); }
switch($mybb->input['inline_action']) { case 'multiactivate': // Run through the activating users, so that users already registered (but have been selected) aren't affected if(is_array($selected)) { $sql_array = implode(",", $selected); $query = $db->simple_select("users", "uid, username, email", "usergroup = '5' AND uid IN (".$sql_array.")"); $user_mail_data = array(); while($user = $db->fetch_array($query)) { $to_update[] = $user['uid']; $user_mail_data[] = array('username' => $user['username'], 'email' => $user['email']); } }
if(is_array($to_update)) { $sql_array = implode(",", $to_update); $db->write_query("UPDATE ".TABLE_PREFIX."users SET usergroup = '2' WHERE uid IN (".$sql_array.")");
$cache->update_awaitingactivation();
// send activation mail foreach($user_mail_data as $mail_data) { $message = $lang->sprintf($lang->email_adminactivateaccount, $mail_data['username'], $mybb->settings['bbname'], $mybb->settings['bburl']); my_mail($mail_data['email'], $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']), $message); }
// Action complete, grab stats and show success message - redirect user $to_update_count = count($to_update); $lang->inline_activated = $lang->sprintf($lang->inline_activated, my_number_format($to_update_count));
if($to_update_count != count($selected)) { // The update count is different to how many we selected! $not_updated_count = count($selected) - $to_update_count; $lang->inline_activated_more = $lang->sprintf($lang->inline_activated_more, my_number_format($not_updated_count)); $lang->inline_activated = $lang->inline_activated."<br />".$lang->inline_activated_more; // Add these stats to the message }
$mybb->input['action'] = "inline_activated"; // Force a change to the action so we can add it to the adminlog log_admin_action($to_update_count); // Add to adminlog my_unsetcookie("inlinemod_useracp"); // Unset the cookie, so that the users aren't still selected when we're redirected
flash_message($lang->inline_activated, 'success'); admin_redirect("index.php?module=user-users".$vid_url); } else { // Nothing was updated, show an error flash_message($lang->inline_activated_failed, 'error'); admin_redirect("index.php?module=user-users".$vid_url); } break; case 'multilift': // Get the users that are banned, and check that they have been selected if($mybb->input['no']) { admin_redirect("index.php?module=user-users".$vid_url); // User clicked on 'No' }
if($mybb->request_method == "post") { $sql_array = implode(",", $selected); $query = $db->simple_select("banned", "*", "uid IN (".$sql_array.")"); $to_be_unbanned = $db->num_rows($query); while($ban = $db->fetch_array($query)) { $updated_group = array( "usergroup" => $ban['oldgroup'], "additionalgroups" => $ban['oldadditionalgroups'], "displaygroup" => $ban['olddisplaygroup'] ); $db->update_query("users", $updated_group, "uid = '".$ban['uid']."'"); $db->delete_query("banned", "uid = '".$ban['uid']."'"); }
$cache->update_banned(); $cache->update_moderators();
$mybb->input['action'] = "inline_lift"; log_admin_action($to_be_unbanned); my_unsetcookie("inlinemod_useracp");
$lang->success_ban_lifted = $lang->sprintf($lang->success_ban_lifted, my_number_format($to_be_unbanned)); flash_message($lang->success_ban_lifted, 'success'); admin_redirect("index.php?module=user-users".$vid_url); } else { $page->output_confirm_action("index.php?module=user-users&action=inline_edit&inline_action=multilift", $lang->confirm_multilift); }
break; case 'multiban': if($mybb->input['processed'] == 1) { // We've posted ban information! // Build an array of users to ban, =D $sql_array = implode(",", $selected); // Build a cache array for this users that have been banned already $query = $db->simple_select("banned", "uid", "uid IN (".$sql_array.")"); while($user = $db->fetch_array($query))
|
{
|
{
|
$sql_array = implode(",", $to_update); $db->write_query("UPDATE ".TABLE_PREFIX."users SET usergroup = '2' WHERE uid IN (".$sql_array.")");
$cache->update_awaitingactivation();
// Action complete, grab stats and show success message - redirect user $to_update_count = count($to_update); $lang->inline_activated = $lang->sprintf($lang->inline_activated, my_number_format($to_update_count));
if($to_update_count != count($selected)) { // The update count is different to how many we selected! $not_updated_count = count($selected) - $to_update_count; $lang->inline_activated_more = $lang->sprintf($lang->inline_activated_more, my_number_format($not_updated_count)); $lang->inline_activated = $lang->inline_activated."<br />".$lang->inline_activated_more; // Add these stats to the message }
$mybb->input['action'] = "inline_activated"; // Force a change to the action so we can add it to the adminlog log_admin_action($to_update_count); // Add to adminlog my_unsetcookie("inlinemod_useracp"); // Unset the cookie, so that the users aren't still selected when we're redirected
flash_message($lang->inline_activated, 'success'); admin_redirect("index.php?module=user-users".$vid_url); } else { // Nothing was updated, show an error flash_message($lang->inline_activated_failed, 'error'); admin_redirect("index.php?module=user-users".$vid_url); } break; case 'multilift': // Get the users that are banned, and check that they have been selected if($mybb->input['no']) { admin_redirect("index.php?module=user-users".$vid_url); // User clicked on 'No'
| $bannedcache[] = "u_".$user['uid']; }
// Collect the users $query = $db->simple_select("users", "uid, username, usergroup, additionalgroups, displaygroup", "uid IN (".$sql_array.")");
if($mybb->input['bantime'] == '---') { $lifted = 0; } else { $lifted = ban_date2timestamp($mybb->input['bantime']);
|
}
|
}
|
if($mybb->request_method == "post")
| $reason = my_substr($mybb->input['reason'], 0, 255);
$banned_count = 0; while($user = $db->fetch_array($query))
|
{
|
{
|
$sql_array = implode(",", $selected); $query = $db->simple_select("banned", "*", "uid IN (".$sql_array.")"); $to_be_unbanned = $db->num_rows($query); while($ban = $db->fetch_array($query))
| if($user['uid'] == $mybb->user['uid'] || is_super_admin($user['uid']))
|
{
|
{
|
$updated_group = array( "usergroup" => $ban['oldgroup'], "additionalgroups" => $ban['oldadditionalgroups'], "displaygroup" => $ban['olddisplaygroup']
| // We remove ourselves and Super Admins from the mix continue; }
if(is_array($bannedcache) && in_array("u_".$user['uid'], $bannedcache)) { // User already has a ban, update it! $update_array = array( "admin" => (int)$mybb->user['uid'], "dateline" => TIME_NOW, "bantime" => $db->escape_string($mybb->input['bantime']), "lifted" => $db->escape_string($lifted), "reason" => $db->escape_string($reason)
|
);
|
);
|
$db->update_query("users", $updated_group, "uid = '".$ban['uid']."'"); $db->delete_query("banned", "uid = '".$ban['uid']."'");
| $db->update_query("banned", $update_array, "uid = '".$user['uid']."'"); } else { // Not currently banned - insert the ban $insert_array = array( 'uid' => $user['uid'], 'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT), 'oldgroup' => $user['usergroup'], 'oldadditionalgroups' => $user['additionalgroups'], 'olddisplaygroup' => $user['displaygroup'], 'admin' => (int)$mybb->user['uid'], 'dateline' => TIME_NOW, 'bantime' => $db->escape_string($mybb->input['bantime']), 'lifted' => $db->escape_string($lifted), 'reason' => $db->escape_string($reason) ); $db->insert_query('banned', $insert_array);
|
}
|
}
|
| // Moved the user to the 'Banned' Group $update_array = array( 'usergroup' => 7, 'displaygroup' => 0, 'additionalgroups' => '', ); $db->update_query('users', $update_array, "uid = '{$user['uid']}'");
$db->delete_query("forumsubscriptions", "uid = '{$user['uid']}'"); $db->delete_query("threadsubscriptions", "uid = '{$user['uid']}'");
|
$cache->update_banned();
|
$cache->update_banned();
|
$cache->update_moderators();
| ++$banned_count; } $mybb->input['action'] = "inline_banned"; log_admin_action($banned_count, $lifted); my_unsetcookie("inlinemod_useracp"); // Remove the cookie of selected users as we've finished with them
$lang->users_banned = $lang->sprintf($lang->users_banned, $banned_count); flash_message($lang->users_banned, 'success'); admin_redirect("index.php?module=user-users".$vid_url); }
$page->output_header($lang->manage_users); $page->output_nav_tabs($sub_tabs, 'manage_users');
// Provide the user with a warning of what they're about to do $table = new Table; $lang->mass_ban_info = $lang->sprintf($lang->mass_ban_info, count($selected)); $table->construct_cell($lang->mass_ban_info); $table->construct_row(); $table->output($lang->important);
// If there's any errors, display inline if($errors) { $page->output_inline_error($errors); }
$form = new Form("index.php?module=user-users", "post"); echo $form->generate_hidden_field('action', 'inline_edit'); echo $form->generate_hidden_field('inline_action', 'multiban'); echo $form->generate_hidden_field('processed', '1');
$form_container = new FormContainer('<div class="float_right"><a href="index.php?module=user-users&action=inline_edit&inline_action=multilift&my_post_key='.$mybb->post_code.'">'.$lang->lift_bans.'</a></div>'.$lang->mass_ban); $form_container->output_row($lang->ban_reason, "", $form->generate_text_area('reason', $mybb->input['reason'], array('id' => 'reason', 'maxlength' => '255')), 'reason'); $ban_times = fetch_ban_times(); 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();
$buttons[] = $form->generate_submit_button($lang->ban_users); $form->output_submit_wrapper($buttons); $form->end(); $page->output_footer(); break; case 'multidelete': if($mybb->input['no']) { admin_redirect("index.php?module=user-users".$vid_url); // User clicked on 'No } else { if($mybb->input['processed'] == 1) { // Set up user handler. require_once MYBB_ROOT.'inc/datahandlers/user.php'; $userhandler = new UserDataHandler('delete');
// Delete users $deleted = $userhandler->delete_user($selected); $to_be_deleted = $deleted['deleted_users']; // Get the correct number of deleted users
// Update forum stats, remove the cookie and redirect the user my_unsetcookie("inlinemod_useracp"); $mybb->input['action'] = "inline_delete"; log_admin_action($to_be_deleted);
$lang->users_deleted = $lang->sprintf($lang->users_deleted, $to_be_deleted);
$cache->update_awaitingactivation();
flash_message($lang->users_deleted, 'success'); admin_redirect("index.php?module=user-users".$vid_url); }
$to_be_deleted = count($selected); $lang->confirm_multidelete = $lang->sprintf($lang->confirm_multidelete, my_number_format($to_be_deleted)); $page->output_confirm_action("index.php?module=user-users&action=inline_edit&inline_action=multidelete&my_post_key={$mybb->post_code}&processed=1", $lang->confirm_multidelete); } break; case 'multiprune': if($mybb->input['processed'] == 1) { if(($mybb->input['day'] || $mybb->input['month'] || $mybb->input['year']) && $mybb->input['set']) { $errors[] = $lang->multi_selected_dates; }
$day = $mybb->get_input('day', MyBB::INPUT_INT); $month = $mybb->get_input('month', MyBB::INPUT_INT); $year = $mybb->get_input('year', MyBB::INPUT_INT);
// Selected a date - check if the date the user entered is valid if($mybb->input['day'] || $mybb->input['month'] || $mybb->input['year']) { // Is the date sort of valid? if($day < 1 || $day > 31 || $month < 1 || $month > 12 || ($month == 2 && $day > 29)) { $errors[] = $lang->incorrect_date; }
// Check the month $months = get_bdays($year); if($day > $months[$month-1]) { $errors[] = $lang->incorrect_date; }
// Check the year if($year != 0 && ($year < (date("Y")-100)) || $year > date("Y")) { $errors[] = $lang->incorrect_date; }
if(!$errors) { // No errors, so let's continue and set the date to delete from $date = mktime(date('H'), date('i'), date('s'), $month, $day, $year); // Generate a unix time stamp } } elseif($mybb->input['set'] > 0) { // Set options // For this purpose, 1 month = 31 days $base_time = 24 * 60 * 60;
switch($mybb->input['set']) { case '1': $threshold = $base_time * 31; // 1 month = 31 days, in the standard terms break; case '2': $threshold = $base_time * 93; // 3 months = 31 days * 3 break; case '3': $threshold = $base_time * 183; // 6 months = 365 days / 2 break; case '4': $threshold = $base_time * 365; // 1 year = 365 days break; case '5': $threshold = $base_time * 548; // 18 months = 365 + 183 break; case '6': $threshold = $base_time * 730; // 2 years = 365 * 2 break; }
|
|
|
$mybb->input['action'] = "inline_lift"; log_admin_action($to_be_unbanned); my_unsetcookie("inlinemod_useracp");
$lang->success_ban_lifted = $lang->sprintf($lang->success_ban_lifted, my_number_format($to_be_unbanned)); flash_message($lang->success_ban_lifted, 'success'); admin_redirect("index.php?module=user-users".$vid_url); }
| if(!$threshold) { // An option was entered that isn't in the dropdown box $errors[] = $lang->no_set_option; } else { $date = TIME_NOW - $threshold; } }
|
else {
|
else {
|
$page->output_confirm_action("index.php?module=user-users&action=inline_edit&inline_action=multilift", $lang->confirm_multilift);
| $errors[] = $lang->no_prune_option;
|
}
|
}
|
break; case 'multiban': if($mybb->input['processed'] == 1)
| if(!$errors)
|
{
|
{
|
// We've posted ban information! // Build an array of users to ban, =D
| |
$sql_array = implode(",", $selected);
|
$sql_array = implode(",", $selected);
|
// Build a cache array for this users that have been banned already $query = $db->simple_select("banned", "uid", "uid IN (".$sql_array.")");
| $prune_array = array(); $query = $db->simple_select("users", "uid", "uid IN (".$sql_array.")");
|
while($user = $db->fetch_array($query)) {
|
while($user = $db->fetch_array($query)) {
|
$bannedcache[] = "u_".$user['uid']; }
// Collect the users $query = $db->simple_select("users", "uid, username, usergroup, additionalgroups, displaygroup", "uid IN (".$sql_array.")");
if($mybb->input['bantime'] == '---') { $lifted = 0; } else { $lifted = ban_date2timestamp($mybb->input['bantime']); }
$reason = my_substr($mybb->input['reason'], 0, 255);
$banned_count = 0; while($user = $db->fetch_array($query)) { if($user['uid'] == $mybb->user['uid'] || is_super_admin($user['uid']))
| // Protect Super Admins if(is_super_admin($user['uid']) && !is_super_admin($mybb->user['uid']))
|
{
|
{
|
// We remove ourselves and Super Admins from the mix
| |
continue;
|
continue;
|
}
if(is_array($bannedcache) && in_array("u_".$user['uid'], $bannedcache)) { // User already has a ban, update it! $update_array = array( "admin" => (int)$mybb->user['uid'], "dateline" => TIME_NOW, "bantime" => $db->escape_string($mybb->input['bantime']), "lifted" => $db->escape_string($lifted), "reason" => $db->escape_string($reason) ); $db->update_query("banned", $update_array, "uid = '".$user['uid']."'"); } else { // Not currently banned - insert the ban $insert_array = array( 'uid' => $user['uid'], 'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT), 'oldgroup' => $user['usergroup'], 'oldadditionalgroups' => $user['additionalgroups'], 'olddisplaygroup' => $user['displaygroup'], 'admin' => (int)$mybb->user['uid'], 'dateline' => TIME_NOW, 'bantime' => $db->escape_string($mybb->input['bantime']), 'lifted' => $db->escape_string($lifted), 'reason' => $db->escape_string($reason) ); $db->insert_query('banned', $insert_array); }
// Moved the user to the 'Banned' Group $update_array = array( 'usergroup' => 7, 'displaygroup' => 0, 'additionalgroups' => '', ); $db->update_query('users', $update_array, "uid = '{$user['uid']}'");
$db->delete_query("forumsubscriptions", "uid = '{$user['uid']}'"); $db->delete_query("threadsubscriptions", "uid = '{$user['uid']}'");
$cache->update_banned(); ++$banned_count; } $mybb->input['action'] = "inline_banned"; log_admin_action($banned_count, $lifted); my_unsetcookie("inlinemod_useracp"); // Remove the cookie of selected users as we've finished with them
$lang->users_banned = $lang->sprintf($lang->users_banned, $banned_count); flash_message($lang->users_banned, 'success'); admin_redirect("index.php?module=user-users".$vid_url); }
$page->output_header($lang->manage_users); $page->output_nav_tabs($sub_tabs, 'manage_users');
// Provide the user with a warning of what they're about to do $table = new Table; $lang->mass_ban_info = $lang->sprintf($lang->mass_ban_info, count($selected)); $table->construct_cell($lang->mass_ban_info); $table->construct_row(); $table->output($lang->important);
// If there's any errors, display inline if($errors) { $page->output_inline_error($errors); }
$form = new Form("index.php?module=user-users", "post"); echo $form->generate_hidden_field('action', 'inline_edit'); echo $form->generate_hidden_field('inline_action', 'multiban'); echo $form->generate_hidden_field('processed', '1');
$form_container = new FormContainer('<div class="float_right"><a href="index.php?module=user-users&action=inline_edit&inline_action=multilift&my_post_key='.$mybb->post_code.'">'.$lang->lift_bans.'</a></div>'.$lang->mass_ban); $form_container->output_row($lang->ban_reason, "", $form->generate_text_area('reason', $mybb->input['reason'], array('id' => 'reason', 'maxlength' => '255')), 'reason'); $ban_times = fetch_ban_times(); 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();
$buttons[] = $form->generate_submit_button($lang->ban_users); $form->output_submit_wrapper($buttons); $form->end(); $page->output_footer(); break; case 'multidelete': if($mybb->input['no']) { admin_redirect("index.php?module=user-users".$vid_url); // User clicked on 'No } else { if($mybb->input['processed'] == 1) { // Set up user handler. require_once MYBB_ROOT.'inc/datahandlers/user.php'; $userhandler = new UserDataHandler('delete');
// Delete users $deleted = $userhandler->delete_user($selected); $to_be_deleted = $deleted['deleted_users']; // Get the correct number of deleted users
// Update forum stats, remove the cookie and redirect the user my_unsetcookie("inlinemod_useracp"); $mybb->input['action'] = "inline_delete"; log_admin_action($to_be_deleted);
$lang->users_deleted = $lang->sprintf($lang->users_deleted, $to_be_deleted);
$cache->update_awaitingactivation();
flash_message($lang->users_deleted, 'success'); admin_redirect("index.php?module=user-users".$vid_url); }
$to_be_deleted = count($selected); $lang->confirm_multidelete = $lang->sprintf($lang->confirm_multidelete, my_number_format($to_be_deleted)); $page->output_confirm_action("index.php?module=user-users&action=inline_edit&inline_action=multidelete&my_post_key={$mybb->post_code}&processed=1", $lang->confirm_multidelete); } break; case 'multiprune': if($mybb->input['processed'] == 1) { if(($mybb->input['day'] || $mybb->input['month'] || $mybb->input['year']) && $mybb->input['set']) { $errors[] = $lang->multi_selected_dates; }
$day = $mybb->get_input('day', MyBB::INPUT_INT); $month = $mybb->get_input('month', MyBB::INPUT_INT); $year = $mybb->get_input('year', MyBB::INPUT_INT);
// Selected a date - check if the date the user entered is valid if($mybb->input['day'] || $mybb->input['month'] || $mybb->input['year']) { // Is the date sort of valid? if($day < 1 || $day > 31 || $month < 1 || $month > 12 || ($month == 2 && $day > 29)) { $errors[] = $lang->incorrect_date; }
// Check the month $months = get_bdays($year); if($day > $months[$month-1]) { $errors[] = $lang->incorrect_date; }
// Check the year if($year != 0 && ($year < (date("Y")-100)) || $year > date("Y")) { $errors[] = $lang->incorrect_date; }
if(!$errors) { // No errors, so let's continue and set the date to delete from $date = mktime(date('H'), date('i'), date('s'), $month, $day, $year); // Generate a unix time stamp } } elseif($mybb->input['set'] > 0) { // Set options // For this purpose, 1 month = 31 days $base_time = 24 * 60 * 60;
switch($mybb->input['set']) { case '1': $threshold = $base_time * 31; // 1 month = 31 days, in the standard terms break; case '2': $threshold = $base_time * 93; // 3 months = 31 days * 3 break; case '3': $threshold = $base_time * 183; // 6 months = 365 days / 2 break; case '4': $threshold = $base_time * 365; // 1 year = 365 days break; case '5': $threshold = $base_time * 548; // 18 months = 365 + 183 break; case '6': $threshold = $base_time * 730; // 2 years = 365 * 2 break; }
if(!$threshold) { // An option was entered that isn't in the dropdown box $errors[] = $lang->no_set_option; } else { $date = TIME_NOW - $threshold; } } else { $errors[] = $lang->no_prune_option; }
if(!$errors) { $sql_array = implode(",", $selected); $prune_array = array(); $query = $db->simple_select("users", "uid", "uid IN (".$sql_array.")"); while($user = $db->fetch_array($query)) { // Protect Super Admins if(is_super_admin($user['uid']) && !is_super_admin($mybb->user['uid'])) { continue; }
$return_array = delete_user_posts($user['uid'], $date); // Delete user posts, and grab a list of threads to delete if($return_array && is_array($return_array)) { $prune_array = array_merge_recursive($prune_array, $return_array); } }
// No posts were found for the user, return error if(!is_array($prune_array) || count($prune_array) == 0) { flash_message($lang->prune_fail, 'error'); admin_redirect("index.php?module=user-users".$vid_url); }
// Require the rebuild functions require_once MYBB_ROOT.'/inc/functions.php'; require_once MYBB_ROOT.'/inc/functions_rebuild.php';
// We've finished deleting user's posts, so let's delete the threads if(is_array($prune_array['to_delete']) && count($prune_array['to_delete']) > 0) { foreach($prune_array['to_delete'] as $tid) { $db->delete_query("threads", "tid='$tid'"); $db->delete_query("threads", "closed='moved|$tid'"); $db->delete_query("threadsubscriptions", "tid='$tid'"); $db->delete_query("polls", "tid='$tid'"); $db->delete_query("threadsread", "tid='$tid'"); $db->delete_query("threadratings", "tid='$tid'"); } }
// After deleting threads, rebuild the thread counters for the affected threads if(is_array($prune_array['thread_update']) && count($prune_array['thread_update']) > 0) { $sql_array = implode(",", $prune_array['thread_update']); $query = $db->simple_select("threads", "tid", "tid IN (".$sql_array.")", array('order_by' => 'tid', 'order_dir' => 'asc')); while($thread = $db->fetch_array($query)) { rebuild_thread_counters($thread['tid']); } }
// After updating thread counters, update the affected forum counters if(is_array($prune_array['forum_update']) && count($prune_array['forum_update']) > 0)
| }
$return_array = delete_user_posts($user['uid'], $date); // Delete user posts, and grab a list of threads to delete if($return_array && is_array($return_array))
|
{
|
{
|
$sql_array = implode(",", $prune_array['forum_update']); $query = $db->simple_select("forums", "fid", "fid IN (".$sql_array.")", array('order_by' => 'fid', 'order_dir' => 'asc')); while($forum = $db->fetch_array($query)) { // Because we have a recursive array merge, check to see if there isn't a duplicated forum to update if($looped_forum == $forum['fid']) { continue; } $looped_forum = $forum['fid']; rebuild_forum_counters($forum['fid']); }
| $prune_array = array_merge_recursive($prune_array, $return_array);
|
}
|
}
|
| }
|
|
|
//log_admin_action(); my_unsetcookie("inlinemod_useracp"); // We've got our users, remove the cookie flash_message($lang->prune_complete, 'success');
| // No posts were found for the user, return error if(!is_array($prune_array) || count($prune_array) == 0) { flash_message($lang->prune_fail, 'error');
|
admin_redirect("index.php?module=user-users".$vid_url); }
|
admin_redirect("index.php?module=user-users".$vid_url); }
|
}
$page->output_header($lang->manage_users); $page->output_nav_tabs($sub_tabs, 'manage_users');
// Display a table warning $table = new Table; $lang->mass_prune_info = $lang->sprintf($lang->mass_prune_info, count($selected)); $table->construct_cell($lang->mass_prune_info); $table->construct_row(); $table->output($lang->important);
if($errors) { $page->output_inline_error($errors); }
// Display the prune options $form = new Form("index.php?module=user-users", "post"); echo $form->generate_hidden_field('action', 'inline_edit'); echo $form->generate_hidden_field('inline_action', 'multiprune'); echo $form->generate_hidden_field('processed', '1');
$form_container = new FormContainer($lang->mass_prune_posts);
// Generate a list of days (1 - 31) $day_options = array(); $day_options[] = " "; for($i = 1; $i <= 31; ++$i) { $day_options[] = $i; }
// Generate a list of months (1 - 12) $month_options = array(); $month_options[] = " "; for($i = 1; $i <= 12; ++$i) { $string = "month_{$i}"; $month_options[] = $lang->$string; } $date_box = $form->generate_select_box('day', $day_options, $mybb->input['day']); $month_box = $form->generate_select_box('month', $month_options, $mybb->input['month']); $year_box = $form->generate_numeric_field('year', $mybb->input['year'], array('id' => 'year', 'style' => 'width: 50px;', 'min' => 0));
$prune_select = $date_box.$month_box.$year_box; $form_container->output_row($lang->manual_date, "", $prune_select, 'date');
| |
|
|
// Generate the set date box $set_options = array(); $set_options[] = $lang->set_an_option; for($i = 1; $i <= 6; ++$i) { $string = "option_{$i}"; $set_options[] = $lang->$string; }
$form_container->output_row($lang->relative_date, "", $lang->delete_posts." ".$form->generate_select_box('set', $set_options, $mybb->input['set']), 'set'); $form_container->end();
| // Require the rebuild functions require_once MYBB_ROOT.'/inc/functions.php'; require_once MYBB_ROOT.'/inc/functions_rebuild.php';
// We've finished deleting user's posts, so let's delete the threads if(is_array($prune_array['to_delete']) && count($prune_array['to_delete']) > 0) { foreach($prune_array['to_delete'] as $tid) { $db->delete_query("threads", "tid='$tid'"); $db->delete_query("threads", "closed='moved|$tid'"); $db->delete_query("threadsubscriptions", "tid='$tid'"); $db->delete_query("polls", "tid='$tid'"); $db->delete_query("threadsread", "tid='$tid'"); $db->delete_query("threadratings", "tid='$tid'"); } }
|
|
|
$buttons[] = $form->generate_submit_button($lang->prune_posts); $form->output_submit_wrapper($buttons); $form->end(); $page->output_footer(); break; case 'multiusergroup': if($mybb->input['processed'] == 1) { // Determine additional usergroups if(is_array($mybb->input['additionalgroups']))
| // After deleting threads, rebuild the thread counters for the affected threads if(is_array($prune_array['thread_update']) && count($prune_array['thread_update']) > 0)
|
{
|
{
|
foreach($mybb->input['additionalgroups'] as $key => $gid)
| $sql_array = implode(",", $prune_array['thread_update']); $query = $db->simple_select("threads", "tid", "tid IN (".$sql_array.")", array('order_by' => 'tid', 'order_dir' => 'asc')); while($thread = $db->fetch_array($query))
|
{
|
{
|
if($gid == $mybb->input['usergroup'])
| rebuild_thread_counters($thread['tid']); } }
// After updating thread counters, update the affected forum counters if(is_array($prune_array['forum_update']) && count($prune_array['forum_update']) > 0) { $sql_array = implode(",", $prune_array['forum_update']); $query = $db->simple_select("forums", "fid", "fid IN (".$sql_array.")", array('order_by' => 'fid', 'order_dir' => 'asc')); while($forum = $db->fetch_array($query)) { // Because we have a recursive array merge, check to see if there isn't a duplicated forum to update if($looped_forum == $forum['fid'])
|
{
|
{
|
unset($mybb->input['additionalgroups'][$key]);
| continue;
|
}
|
}
|
}
$additionalgroups = implode(",", array_map('intval', $mybb->input['additionalgroups'])); } else { $additionalgroups = ''; }
// Create an update array $update_array = array( "usergroup" => $mybb->get_input('usergroup', MyBB::INPUT_INT), "additionalgroups" => $additionalgroups, "displaygroup" => $mybb->get_input('displaygroup', MyBB::INPUT_INT) );
// Do the usergroup update for all those selected // If the a selected user is a super admin, don't update that user foreach($selected as $user)
| $looped_forum = $forum['fid']; rebuild_forum_counters($forum['fid']); } }
//log_admin_action(); my_unsetcookie("inlinemod_useracp"); // We've got our users, remove the cookie flash_message($lang->prune_complete, 'success'); admin_redirect("index.php?module=user-users".$vid_url); } }
$page->output_header($lang->manage_users); $page->output_nav_tabs($sub_tabs, 'manage_users');
// Display a table warning $table = new Table; $lang->mass_prune_info = $lang->sprintf($lang->mass_prune_info, count($selected)); $table->construct_cell($lang->mass_prune_info); $table->construct_row(); $table->output($lang->important);
if($errors) { $page->output_inline_error($errors); }
// Display the prune options $form = new Form("index.php?module=user-users", "post"); echo $form->generate_hidden_field('action', 'inline_edit'); echo $form->generate_hidden_field('inline_action', 'multiprune'); echo $form->generate_hidden_field('processed', '1');
$form_container = new FormContainer($lang->mass_prune_posts);
// Generate a list of days (1 - 31) $day_options = array(); $day_options[] = " "; for($i = 1; $i <= 31; ++$i) { $day_options[] = $i; }
// Generate a list of months (1 - 12) $month_options = array(); $month_options[] = " "; for($i = 1; $i <= 12; ++$i) { $string = "month_{$i}"; $month_options[] = $lang->$string; } $date_box = $form->generate_select_box('day', $day_options, $mybb->input['day']); $month_box = $form->generate_select_box('month', $month_options, $mybb->input['month']); $year_box = $form->generate_numeric_field('year', $mybb->input['year'], array('id' => 'year', 'style' => 'width: 50px;', 'min' => 0));
$prune_select = $date_box.$month_box.$year_box; $form_container->output_row($lang->manual_date, "", $prune_select, 'date');
// Generate the set date box $set_options = array(); $set_options[] = $lang->set_an_option; for($i = 1; $i <= 6; ++$i) { $string = "option_{$i}"; $set_options[] = $lang->$string; }
$form_container->output_row($lang->relative_date, "", $lang->delete_posts." ".$form->generate_select_box('set', $set_options, $mybb->input['set']), 'set'); $form_container->end();
$buttons[] = $form->generate_submit_button($lang->prune_posts); $form->output_submit_wrapper($buttons); $form->end(); $page->output_footer(); break; case 'multiusergroup': if($mybb->input['processed'] == 1) { // Determine additional usergroups if(is_array($mybb->input['additionalgroups'])) { foreach($mybb->input['additionalgroups'] as $key => $gid)
|
{
|
{
|
if(!is_super_admin($user))
| if($gid == $mybb->input['usergroup'])
|
{
|
{
|
$users_to_update[] = $user;
| unset($mybb->input['additionalgroups'][$key]);
|
}
|
}
|
}
$to_update_count = count($users_to_update); if($to_update_count > 0 && is_array($users_to_update)) { // Update the users in the database $sql = implode(",", $users_to_update); $db->update_query("users", $update_array, "uid IN (".$sql.")");
// Redirect the admin... $mybb->input['action'] = "inline_usergroup"; log_admin_action($to_update_count); my_unsetcookie("inlinemod_useracp"); flash_message($lang->success_mass_usergroups, 'success'); admin_redirect("index.php?module=user-users".$vid_url); } else { // They tried to edit super admins! Uh-oh! $errors[] = $lang->no_usergroup_changed; }
| }
$additionalgroups = implode(",", array_map('intval', $mybb->input['additionalgroups'])); } else { $additionalgroups = '';
|
}
|
}
|
$page->output_header($lang->manage_users); $page->output_nav_tabs($sub_tabs, 'manage_users');
| // Create an update array $update_array = array( "usergroup" => $mybb->get_input('usergroup', MyBB::INPUT_INT), "additionalgroups" => $additionalgroups, "displaygroup" => $mybb->get_input('displaygroup', MyBB::INPUT_INT) );
// Do the usergroup update for all those selected // If the a selected user is a super admin, don't update that user foreach($selected as $user) { if(!is_super_admin($user)) { $users_to_update[] = $user; } }
|
|
|
// Display a table warning $table = new Table; $lang->usergroup_info = $lang->sprintf($lang->usergroup_info, count($selected)); $table->construct_cell($lang->usergroup_info); $table->construct_row(); $table->output($lang->important);
if($errors) { $page->output_inline_error($errors); }
// Display the usergroup options $form = new Form("index.php?module=user-users", "post"); echo $form->generate_hidden_field('action', 'inline_edit'); echo $form->generate_hidden_field('inline_action', 'multiusergroup'); echo $form->generate_hidden_field('processed', '1');
$form_container = new FormContainer($lang->mass_usergroups);
// Usergroups $display_group_options[0] = $lang->use_primary_user_group; $options = array(); $query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title')); while($usergroup = $db->fetch_array($query)) { $options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']); $display_group_options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']); }
| $to_update_count = count($users_to_update); if($to_update_count > 0 && is_array($users_to_update)) { // Update the users in the database $sql = implode(",", $users_to_update); $db->update_query("users", $update_array, "uid IN (".$sql.")");
|
|
|
if(!is_array($mybb->input['additionalgroups']))
| // Redirect the admin... $mybb->input['action'] = "inline_usergroup"; log_admin_action($to_update_count); my_unsetcookie("inlinemod_useracp"); flash_message($lang->success_mass_usergroups, 'success'); admin_redirect("index.php?module=user-users".$vid_url); } else
|
{
|
{
|
$mybb->input['additionalgroups'] = explode(',', $mybb->input['additionalgroups']);
| // They tried to edit super admins! Uh-oh! $errors[] = $lang->no_usergroup_changed;
|
}
|
}
|
| }
|
|
|
$form_container->output_row($lang->primary_user_group, "", $form->generate_select_box('usergroup', $options, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup'); $form_container->output_row($lang->additional_user_groups, $lang->additional_user_groups_desc, $form->generate_select_box('additionalgroups[]', $options, $mybb->input['additionalgroups'], array('id' => 'additionalgroups', 'multiple' => true, 'size' => 5)), 'additionalgroups'); $form_container->output_row($lang->display_user_group, "", $form->generate_select_box('displaygroup', $display_group_options, $mybb->input['displaygroup'], array('id' => 'displaygroup')), 'displaygroup');
| $page->output_header($lang->manage_users); $page->output_nav_tabs($sub_tabs, 'manage_users');
|
|
|
$form_container->end();
$buttons[] = $form->generate_submit_button($lang->alter_usergroups); $form->output_submit_wrapper($buttons); $form->end(); $page->output_footer(); break; } }
| // Display a table warning $table = new Table; $lang->usergroup_info = $lang->sprintf($lang->usergroup_info, count($selected)); $table->construct_cell($lang->usergroup_info); $table->construct_row(); $table->output($lang->important);
if($errors) { $page->output_inline_error($errors); }
// Display the usergroup options $form = new Form("index.php?module=user-users", "post"); echo $form->generate_hidden_field('action', 'inline_edit'); echo $form->generate_hidden_field('inline_action', 'multiusergroup'); echo $form->generate_hidden_field('processed', '1');
$form_container = new FormContainer($lang->mass_usergroups);
// Usergroups $display_group_options[0] = $lang->use_primary_user_group; $options = array(); $query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title')); while($usergroup = $db->fetch_array($query)) { $options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']); $display_group_options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']); }
if(!is_array($mybb->input['additionalgroups'])) { $mybb->input['additionalgroups'] = explode(',', $mybb->input['additionalgroups']); }
$form_container->output_row($lang->primary_user_group, "", $form->generate_select_box('usergroup', $options, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup'); $form_container->output_row($lang->additional_user_groups, $lang->additional_user_groups_desc, $form->generate_select_box('additionalgroups[]', $options, $mybb->input['additionalgroups'], array('id' => 'additionalgroups', 'multiple' => true, 'size' => 5)), 'additionalgroups'); $form_container->output_row($lang->display_user_group, "", $form->generate_select_box('displaygroup', $display_group_options, $mybb->input['displaygroup'], array('id' => 'displaygroup')), 'displaygroup');
$form_container->end();
$buttons[] = $form->generate_submit_button($lang->alter_usergroups); $form->output_submit_wrapper($buttons); $form->end(); $page->output_footer(); break; }
|
}
if(!$mybb->input['action'])
| }
if(!$mybb->input['action'])
|
Zeile 3036 | Zeile 3048 |
---|
if(!$admin_view['vid'] || ($admin_view['visibility'] == 1 && $admin_view['uid'] != $mybb->user['uid'])) { unset($admin_view);
|
if(!$admin_view['vid'] || ($admin_view['visibility'] == 1 && $admin_view['uid'] != $mybb->user['uid'])) { unset($admin_view);
|
} }
| } }
|
// Don't have a view? Fetch the default if(!isset($admin_view)) {
| // Don't have a view? Fetch the default if(!isset($admin_view)) {
|
Zeile 3102 | Zeile 3114 |
---|
$page->output_footer(); }
|
$page->output_footer(); }
|
| /** * @param array $view * * @return string */
|
function build_users_view($view) { global $mybb, $db, $cache, $lang, $user_view_fields, $page;
|
function build_users_view($view) { global $mybb, $db, $cache, $lang, $user_view_fields, $page;
|
| if($view['view_type'] != 'card') { $view['view_type'] = 'table'; }
|
$view_title = ''; if($view['title'])
| $view_title = ''; if($view['title'])
|
Zeile 3129 | Zeile 3151 |
---|
$view['conditions'] = my_unserialize($view['conditions']); } if(!is_array($view['fields']))
|
$view['conditions'] = my_unserialize($view['conditions']); } if(!is_array($view['fields']))
|
{
| {
|
$view['fields'] = my_unserialize($view['fields']); } if(!is_array($view['custom_profile_fields']))
|
$view['fields'] = my_unserialize($view['fields']); } if(!is_array($view['custom_profile_fields']))
|
{
| {
|
$view['custom_profile_fields'] = my_unserialize($view['custom_profile_fields']);
|
$view['custom_profile_fields'] = my_unserialize($view['custom_profile_fields']);
|
}
| }
|
if(isset($mybb->input['username'])) { $view['conditions']['username'] = $mybb->input['username'];
|
if(isset($mybb->input['username'])) { $view['conditions']['username'] = $mybb->input['username'];
|
}
| $view['url'] .= "&username=".urlencode(htmlspecialchars_uni($mybb->input['username'])); }
|
if($view['vid'])
|
if($view['vid'])
|
{
| {
|
$view['url'] .= "&vid={$view['vid']}"; } else
|
$view['url'] .= "&vid={$view['vid']}"; } else
|
{
| {
|
// If this is a custom view we need to save everything ready to pass it on from page to page global $admin_session; if(!$mybb->input['search_id'])
| // If this is a custom view we need to save everything ready to pass it on from page to page global $admin_session; if(!$mybb->input['search_id'])
|
Zeile 3156 | Zeile 3179 |
---|
$mybb->input['search_id'] = $search_id; } $view['url'] .= "&search_id=".htmlspecialchars_uni($mybb->input['search_id']);
|
$mybb->input['search_id'] = $search_id; } $view['url'] .= "&search_id=".htmlspecialchars_uni($mybb->input['search_id']);
|
}
if(isset($mybb->input['username'])) { $view['url'] .= "&username=".urlencode(htmlspecialchars_uni($mybb->input['username'])); }
| }
|
if(!isset($admin_session['data']['last_users_view']) || $admin_session['data']['last_users_view'] != str_replace("&", "&", $view['url'])) { update_admin_session('last_users_url', str_replace("&", "&", $view['url']));
| if(!isset($admin_session['data']['last_users_view']) || $admin_session['data']['last_users_view'] != str_replace("&", "&", $view['url'])) { update_admin_session('last_users_url', str_replace("&", "&", $view['url']));
|
Zeile 3174 | Zeile 3192 |
---|
// Do we not have any views? if(empty($view))
|
// Do we not have any views? if(empty($view))
|
{
| {
|
return false; }
| return false; }
|
Zeile 3186 | Zeile 3204 |
---|
foreach($view['fields'] as $field) { if(!$user_view_fields[$field])
|
foreach($view['fields'] as $field) { if(!$user_view_fields[$field])
|
{
| {
|
continue; } $view_field = $user_view_fields[$field];
| continue; } $view_field = $user_view_fields[$field];
|
Zeile 3352 | Zeile 3370 |
---|
} else {
|
} else {
|
$userfield_sql .= ' AND '.$db->escape_string($column)." LIKE '%".$db->escape_string($input)."%'";
| $userfield_sql .= ' AND '.$db->escape_string($column)." LIKE '%".$db->escape_string_like($input)."%'";
|
} } }
| } } }
|
Zeile 3503 | Zeile 3521 |
---|
while($user = $db->fetch_array($query)) { $comma = $groups_list = '';
|
while($user = $db->fetch_array($query)) { $comma = $groups_list = '';
|
| $user['username'] = htmlspecialchars_uni($user['username']);
|
$user['view']['username'] = "<a href=\"index.php?module=user-users&action=edit&uid={$user['uid']}\">".format_name($user['username'], $user['usergroup'], $user['displaygroup'])."</a>"; $user['view']['usergroup'] = htmlspecialchars_uni($usergroups[$user['usergroup']]['title']); if($user['additionalgroups'])
| $user['view']['username'] = "<a href=\"index.php?module=user-users&action=edit&uid={$user['uid']}\">".format_name($user['username'], $user['usergroup'], $user['displaygroup'])."</a>"; $user['view']['usergroup'] = htmlspecialchars_uni($usergroups[$user['usergroup']]['title']); if($user['additionalgroups'])
|
Zeile 3557 | Zeile 3576 |
---|
$popup->add_item($lang->delete_user, "index.php?module=user-users&action=delete&uid={$user['uid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->user_deletion_confirmation}')"); $popup->add_item($lang->show_referred_users, "index.php?module=user-users&action=referrers&uid={$user['uid']}"); $popup->add_item($lang->show_ip_addresses, "index.php?module=user-users&action=ipaddresses&uid={$user['uid']}");
|
$popup->add_item($lang->delete_user, "index.php?module=user-users&action=delete&uid={$user['uid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->user_deletion_confirmation}')"); $popup->add_item($lang->show_referred_users, "index.php?module=user-users&action=referrers&uid={$user['uid']}"); $popup->add_item($lang->show_ip_addresses, "index.php?module=user-users&action=ipaddresses&uid={$user['uid']}");
|
$popup->add_item($lang->show_attachments, "index.php?module=forum-attachments&results=1&username=".urlencode(htmlspecialchars_uni($user['username'])));
| $popup->add_item($lang->show_attachments, "index.php?module=forum-attachments&results=1&username=".urlencode($user['username']));
|
$user['view']['controls'] = $popup->fetch();
// Fetch the reputation for this user
| $user['view']['controls'] = $popup->fetch();
// Fetch the reputation for this user
|
Zeile 3585 | Zeile 3604 |
---|
$user['view']['warninglevel'] = get_colored_warning_level($warning_level); }
|
$user['view']['warninglevel'] = get_colored_warning_level($warning_level); }
|
if($user['avatar'] && my_substr($user['avatar'], 0, 7) !== 'http://' && my_substr($user['avatar'], 0, 8) !== 'https://')
| if($user['avatar'] && !my_validate_url($user['avatar']))
|
{ $user['avatar'] = "../{$user['avatar']}"; }
| { $user['avatar'] = "../{$user['avatar']}"; }
|
Zeile 3597 | Zeile 3616 |
---|
{ $scaled_avatar = fetch_scaled_avatar($user, 34, 34); }
|
{ $scaled_avatar = fetch_scaled_avatar($user, 34, 34); }
|
if(!$user['avatar'])
| if(!$user['avatar'] || (my_strpos($user['avatar'], '://') !== false && !$mybb->settings['allowremoteavatars']))
|
{
|
{
|
$user['avatar'] = "../".$mybb->settings['useravatar'];
| if(my_validate_url($mybb->settings['useravatar'])) { $user['avatar'] = str_replace('{theme}', 'images', $mybb->settings['useravatar']); } else { $user['avatar'] = "../".str_replace('{theme}', 'images', $mybb->settings['useravatar']); }
|
} $user['view']['avatar'] = "<img src=\"".htmlspecialchars_uni($user['avatar'])."\" alt=\"\" width=\"{$scaled_avatar['width']}\" height=\"{$scaled_avatar['height']}\" />";
| } $user['view']['avatar'] = "<img src=\"".htmlspecialchars_uni($user['avatar'])."\" alt=\"\" width=\"{$scaled_avatar['width']}\" height=\"{$scaled_avatar['height']}\" />";
|
Zeile 3649 | Zeile 3675 |
---|
// Do we need to construct the pagination? if($num_results > $view['perpage']) {
|
// Do we need to construct the pagination? if($num_results > $view['perpage']) {
|
$pagination = draw_admin_pagination($mybb->input['page'], $view['perpage'], $num_results, $view['url']."&type={$view['view_type']}");
| $view_type = htmlspecialchars_uni($view['view_type']); $pagination = draw_admin_pagination($mybb->input['page'], $view['perpage'], $num_results, $view['url']."&type={$view_type}");
|
$search_class = "float_right"; $search_style = ""; }
| $search_class = "float_right"; $search_style = ""; }
|
Zeile 3680 | Zeile 3707 |
---|
$default_class = "search_default"; $value = $lang->search_for_user; }
|
$default_class = "search_default"; $value = $lang->search_for_user; }
|
$built_view .= $search->generate_text_box('username', $value, array('id' => 'search_keywords', 'class' => "{$default_class} field150 field_small"))."\n";
| $built_view .= $search->generate_text_box('username', htmlspecialchars_uni($value), array('id' => 'search_keywords', 'class' => "{$default_class} field150 field_small"))."\n";
|
$built_view .= "<input type=\"submit\" class=\"search_button\" value=\"{$lang->search}\" />\n"; if($view['popup']) {
| $built_view .= "<input type=\"submit\" class=\"search_button\" value=\"{$lang->search}\" />\n"; if($view['popup']) {
|
Zeile 3694 | Zeile 3721 |
---|
{ search.focus(); return false;
|
{ search.focus(); return false;
|
} });
| } });
|
var search = $(\"#search_keywords\"); search.focus(function() {
| var search = $(\"#search_keywords\"); search.focus(function() {
|
Zeile 3779 | Zeile 3806 |
---|
return $built_view; }
|
return $built_view; }
|
| /** * @param array $user * @param array $view * @param int $i * * @return string */
|
function build_user_view_card($user, $view, &$i) { global $user_view_fields;
| function build_user_view_card($user, $view, &$i) { global $user_view_fields;
|
Zeile 3790 | Zeile 3824 |
---|
}
// Loop through fields user wants to show
|
}
// Loop through fields user wants to show
|
foreach($view['fields'] as $field)
| foreach($view['fields'] as $field)
|
{ if(!$user_view_fields[$field]) { continue;
|
{ if(!$user_view_fields[$field]) { continue;
|
}
| }
|
$view_field = $user_view_fields[$field];
// Special conditions for avatar
| $view_field = $user_view_fields[$field];
// Special conditions for avatar
|
Zeile 3814 | Zeile 3848 |
---|
if(isset($user['view'][$field])) { $value = $user['view'][$field];
|
if(isset($user['view'][$field])) { $value = $user['view'][$field];
|
}
| }
|
else { $value = $user[$field];
| else { $value = $user[$field];
|
Zeile 3837 | Zeile 3871 |
---|
else { $float = "right";
|
else { $float = "right";
|
}
| }
|
// And build the final card $card = "<fieldset id=\"uid_{$user['uid']}\" style=\"width: 47%; float: {$float};\">\n";
| // And build the final card $card = "<fieldset id=\"uid_{$user['uid']}\" style=\"width: 47%; float: {$float};\">\n";
|
Zeile 3859 | Zeile 3893 |
---|
}
|
}
|
| /** * @param array $user * @param array $view * @param DefaultTable $table */
|
function build_user_view_table($user, $view, &$table) { global $user_view_fields;
| function build_user_view_table($user, $view, &$table) { global $user_view_fields;
|
Zeile 3896 | Zeile 3935 |
---|
$table->construct_row(); }
|
$table->construct_row(); }
|
| /** * @param array $user * @param int $max_width * @param int $max_height * * @return array */
|
function fetch_scaled_avatar($user, $max_width=80, $max_height=80) { $scaled_dimensions = array(
| function fetch_scaled_avatar($user, $max_width=80, $max_height=80) { $scaled_dimensions = array(
|
Zeile 3903 | Zeile 3949 |
---|
"height" => $max_height, );
|
"height" => $max_height, );
|
if($user['avatar'])
| global $mybb;
if($user['avatar'] && (my_strpos($user['avatar'], '://') === false || $mybb->settings['allowremoteavatars']))
|
{ if($user['avatardimensions']) {
| { if($user['avatardimensions']) {
|
Zeile 3916 | Zeile 3964 |
---|
return array("width" => $scaled_dimensions['width'], "height" => $scaled_dimensions['height']); }
|
return array("width" => $scaled_dimensions['width'], "height" => $scaled_dimensions['height']); }
|
| /** * @param array $fields * @param array $values * @param DefaultFormContainer $form_container * @param DefaultForm $form * @param bool $search */
|
function output_custom_profile_fields($fields, $values, &$form_container, &$form, $search=false) { global $lang;
| function output_custom_profile_fields($fields, $values, &$form_container, &$form, $search=false) { global $lang;
|
Zeile 3928 | Zeile 3983 |
---|
{ $profile_field['name'] = htmlspecialchars_uni($profile_field['name']); $profile_field['description'] = htmlspecialchars_uni($profile_field['description']);
|
{ $profile_field['name'] = htmlspecialchars_uni($profile_field['name']); $profile_field['description'] = htmlspecialchars_uni($profile_field['description']);
|
$profile_field['type'] = htmlspecialchars_uni($profile_field['type']);
| |
list($type, $options) = explode("\n", $profile_field['type'], 2); $type = trim($type); $field_name = "fid{$profile_field['fid']}";
|
list($type, $options) = explode("\n", $profile_field['type'], 2); $type = trim($type); $field_name = "fid{$profile_field['fid']}";
|
|
|
switch($type) { case "multiselect": if(!is_array($values[$field_name]))
|
switch($type) { case "multiselect": if(!is_array($values[$field_name]))
|
{
| {
|
$user_options = explode("\n", $values[$field_name]);
|
$user_options = explode("\n", $values[$field_name]);
|
}
| }
|
else { $user_options = $values[$field_name];
|
else { $user_options = $values[$field_name];
|
}
| }
|
$selected_options = array(); foreach($user_options as $val)
|
$selected_options = array(); foreach($user_options as $val)
|
{ $selected_options[$val] = $val; }
| { $selected_options[$val] = htmlspecialchars_uni($val); }
|
$select_options = explode("\n", $options);
|
$select_options = explode("\n", $options);
|
$options = array(); if($search == true)
| $options = array(); if($search == true) { $select_options[''] = $lang->na; }
foreach($select_options as $val)
|
{
|
{
|
$select_options[''] = $lang->na; }
foreach($select_options as $val) { $val = trim($val); $options[$val] = $val;
| $val = htmlspecialchars_uni(trim($val)); $options[$val] = $val;
|
} if(!$profile_field['length']) {
| } if(!$profile_field['length']) {
|
Zeile 3979 | Zeile 4033 |
---|
$options = array(); foreach($select_options as $val) {
|
$options = array(); foreach($select_options as $val) {
|
$val = trim($val);
| $val = htmlspecialchars_uni(trim($val));
|
$options[$val] = $val; } if(!$profile_field['length'])
| $options[$val] = $val; } if(!$profile_field['length'])
|
Zeile 3988 | Zeile 4042 |
---|
} if($search == true) {
|
} if($search == true) {
|
$code = $form->generate_select_box("profile_fields[{$field_name}][{$field_name}]", $options, $values[$field_name], array('id' => "profile_field_{$field_name}", 'size' => $profile_field['length']));
| $code = $form->generate_select_box("profile_fields[{$field_name}][{$field_name}]", $options, htmlspecialchars_uni($values[$field_name]), array('id' => "profile_field_{$field_name}", 'size' => $profile_field['length']));
|
} else {
|
} else {
|
$code = $form->generate_select_box("profile_fields[{$field_name}]", $options, $values[$field_name], array('id' => "profile_field_{$field_name}", 'size' => $profile_field['length']));
| $code = $form->generate_select_box("profile_fields[{$field_name}]", $options, htmlspecialchars_uni($values[$field_name]), array('id' => "profile_field_{$field_name}", 'size' => $profile_field['length']));
|
} break; case "radio":
| } break; case "radio":
|
Zeile 4006 | Zeile 4060 |
---|
foreach($radio_options as $val) { $val = trim($val);
|
foreach($radio_options as $val) { $val = trim($val);
|
$code .= $form->generate_radio_button("profile_fields[{$field_name}]", $val, $val, array('id' => "profile_field_{$field_name}", 'checked' => ($val == $values[$field_name] ? true : false)))."<br />";
| $code .= $form->generate_radio_button("profile_fields[{$field_name}]", $val, htmlspecialchars_uni($val), array('id' => "profile_field_{$field_name}", 'checked' => ($val == $values[$field_name] ? true : false)))."<br />";
|
} break; case "checkbox":
| } break; case "checkbox":
|
Zeile 4032 | Zeile 4086 |
---|
foreach($select_options as $val) { $val = trim($val);
|
foreach($select_options as $val) { $val = trim($val);
|
$code .= $form->generate_check_box("profile_fields[{$field_name}][]", $val, $val, array('id' => "profile_field_{$field_name}", 'checked' => ($val == $selected_options[$val] ? true : false)))."<br />";
| $code .= $form->generate_check_box("profile_fields[{$field_name}][]", $val, htmlspecialchars_uni($val), array('id' => "profile_field_{$field_name}", 'checked' => ($val == $selected_options[$val] ? true : false)))."<br />";
|
} break; case "textarea":
| } break; case "textarea":
|
Zeile 4060 | Zeile 4114 |
---|
} }
|
} }
|
| /** * @param array $input * @param DefaultForm $form */
|
function user_search_conditions($input=array(), &$form) { global $mybb, $db, $lang;
| function user_search_conditions($input=array(), &$form) { global $mybb, $db, $lang;
|
Zeile 4085 | Zeile 4143 |
---|
}
$form_container = new FormContainer($lang->find_users_where);
|
}
$form_container = new FormContainer($lang->find_users_where);
|
$form_container->output_row($lang->username_contains, "", $form->generate_text_box('conditions[username]', $input['conditions']['username'], array('id' => 'username')), 'username');
| $form_container->output_row($lang->username_contains, "", $form->generate_text_box('conditions[username]', htmlspecialchars_uni($input['conditions']['username']), array('id' => 'username')), 'username');
|
$form_container->output_row($lang->email_address_contains, "", $form->generate_text_box('conditions[email]', $input['conditions']['email'], array('id' => 'email')), 'email');
$options = array();
| $form_container->output_row($lang->email_address_contains, "", $form->generate_text_box('conditions[email]', $input['conditions']['email'], array('id' => 'email')), 'email');
$options = array();
|
Zeile 4152 | Zeile 4210 |
---|
<!-- $("#username").select2({ placeholder: "'.$lang->search_for_a_user.'",
|
<!-- $("#username").select2({ placeholder: "'.$lang->search_for_a_user.'",
|
minimumInputLength: 3, maximumSelectionSize: 3,
| 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",
| multiple: false, ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper url: "../xmlhttp.php?action=get_users",
|