Zeile 172 | Zeile 172 |
---|
} }
|
} }
|
$ipaddress_host_name = htmlspecialchars_uni(@gethostbyaddr($mybb->input['ipaddress']));
// gethostbyaddr returns the same ip on failure if($ipaddress_host_name == $mybb->input['ipaddress'])
| if(filter_var($mybb->input['ipaddress'], FILTER_VALIDATE_IP))
|
{
|
{
|
$ipaddress_host_name = $lang->na;
| $ipaddress_host_name = htmlspecialchars_uni(@gethostbyaddr($mybb->input['ipaddress']));
// gethostbyaddr returns the same ip on failure if($ipaddress_host_name == $mybb->input['ipaddress']) { $ipaddress_host_name = $lang->na; }
|
} }
| } }
|
Zeile 188 | Zeile 191 |
---|
<?php
$table = new Table();
|
<?php
$table = new Table();
|
|
|
$table->construct_cell($lang->ipaddress_host_name.":"); $table->construct_cell($ipaddress_host_name); $table->construct_row();
| $table->construct_cell($lang->ipaddress_host_name.":"); $table->construct_cell($ipaddress_host_name); $table->construct_row();
|
Zeile 223 | Zeile 226 |
---|
}
$plugins->run_hooks("admin_user_users_coppa_activate");
|
}
$plugins->run_hooks("admin_user_users_coppa_activate");
|
|
|
$updated_user['usergroup'] = $user['usergroup'];
// Update
| $updated_user['usergroup'] = $user['usergroup'];
// Update
|
Zeile 231 | Zeile 234 |
---|
{ $updated_user = array( "coppauser" => 0
|
{ $updated_user = array( "coppauser" => 0
|
); } else
| ); } else
|
{ $db->delete_query("awaitingactivation", "uid='{$user['uid']}'"); }
| { $db->delete_query("awaitingactivation", "uid='{$user['uid']}'"); }
|
Zeile 245 | Zeile 248 |
---|
}
$plugins->run_hooks("admin_user_users_coppa_activate_commit");
|
}
$plugins->run_hooks("admin_user_users_coppa_activate_commit");
|
|
|
$db->update_query("users", $updated_user, "uid='{$user['uid']}'");
|
$db->update_query("users", $updated_user, "uid='{$user['uid']}'");
|
|
|
$cache->update_awaitingactivation();
|
$cache->update_awaitingactivation();
|
|
|
$message = $lang->sprintf($lang->email_adminactivateaccount, $user['username'], $mybb->settings['bbname'], $mybb->settings['bburl']); my_mail($user['email'], $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']), $message);
|
$message = $lang->sprintf($lang->email_adminactivateaccount, $user['username'], $mybb->settings['bbname'], $mybb->settings['bburl']); my_mail($user['email'], $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']), $message);
|
|
|
// Log admin action
|
// Log admin action
|
log_admin_action($user['uid'], htmlspecialchars_uni($user['username']));
| log_admin_action($user['uid'], $user['username']);
|
if($mybb->input['from'] == "home") {
| if($mybb->input['from'] == "home") {
|
Zeile 274 | Zeile 277 |
---|
if($user['coppauser']) { flash_message($lang->success_coppa_activated, 'success');
|
if($user['coppauser']) { flash_message($lang->success_coppa_activated, 'success');
|
}
| }
|
else { flash_message($lang->success_activated, 'success');
| else { flash_message($lang->success_activated, 'success');
|
Zeile 289 | Zeile 292 |
---|
if($mybb->input['from'] == "home") { update_admin_session('from', 'home');
|
if($mybb->input['from'] == "home") { update_admin_session('from', 'home');
|
} } else {
| } } else {
|
$url = "index.php?module=user-users&action=edit&uid={$user['uid']}"; }
|
$url = "index.php?module=user-users&action=edit&uid={$user['uid']}"; }
|
|
|
$plugins->run_hooks("admin_user_users_coppa_end");
admin_redirect($url); }
|
$plugins->run_hooks("admin_user_users_coppa_end");
admin_redirect($url); }
|
|
|
if($mybb->input['action'] == "add") { $plugins->run_hooks("admin_user_users_add");
| if($mybb->input['action'] == "add") { $plugins->run_hooks("admin_user_users_add");
|
Zeile 308 | Zeile 311 |
---|
if($mybb->request_method == "post") { // Determine the usergroup stuff
|
if($mybb->request_method == "post") { // Determine the usergroup stuff
|
if(is_array($mybb->input['additionalgroups']))
| if(!empty($mybb->input['additionalgroups']) && is_array($mybb->input['additionalgroups']))
|
{ foreach($mybb->input['additionalgroups'] as $key => $gid) {
| { foreach($mybb->input['additionalgroups'] as $key => $gid) {
|
Zeile 317 | Zeile 320 |
---|
unset($mybb->input['additionalgroups'][$key]); } }
|
unset($mybb->input['additionalgroups'][$key]); } }
|
$additionalgroups = implode(",", $mybb->input['additionalgroups']);
| $additionalgroups = implode(",", array_map('intval', $mybb->input['additionalgroups']));
|
} else { $additionalgroups = '';
|
} else { $additionalgroups = '';
|
}
| }
|
// Set up user handler. require_once MYBB_ROOT."inc/datahandlers/user.php"; $userhandler = new UserDataHandler('insert');
// Set the data for the new user. $new_user = array(
|
// Set up user handler. require_once MYBB_ROOT."inc/datahandlers/user.php"; $userhandler = new UserDataHandler('insert');
// Set the data for the new user. $new_user = array(
|
"uid" => $mybb->input['uid'], "username" => $mybb->input['username'], "password" => $mybb->input['password'], "password2" => $mybb->input['confirm_password'], "email" => $mybb->input['email'], "email2" => $mybb->input['email'], "usergroup" => $mybb->input['usergroup'],
| "uid" => $mybb->get_input('uid'), "username" => $mybb->get_input('username'), "password" => $mybb->get_input('password'), "password2" => $mybb->get_input('confirm_password'), "email" => $mybb->get_input('email'), "email2" => $mybb->get_input('email'), "usergroup" => $mybb->get_input('usergroup'),
|
"additionalgroups" => $additionalgroups,
|
"additionalgroups" => $additionalgroups,
|
"displaygroup" => $mybb->input['displaygroup'], "profile_fields" => $mybb->input['profile_fields'],
| "displaygroup" => $mybb->get_input('displaygroup'), "profile_fields" => $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY),
|
"profile_fields_editable" => true, );
| "profile_fields_editable" => true, );
|
Zeile 359 | Zeile 362 |
---|
$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'], htmlspecialchars_uni($user_info['username']));
| log_admin_action($user_info['uid'], $user_info['username']);
|
flash_message($lang->success_user_created, 'success');
|
flash_message($lang->success_user_created, 'success');
|
admin_redirect("index.php?module=user-users&action=edit&uid={$user_info['uid']}");
| admin_redirect("index.php?module=user-users&action=edit&uid={$user_info['uid']}");
|
} }
// Fetch custom profile fields - only need required profile fields here $query = $db->simple_select("profilefields", "*", "required=1", array('order_by' => 'disporder'));
|
} }
// Fetch custom profile fields - only need required profile fields here $query = $db->simple_select("profilefields", "*", "required=1", array('order_by' => 'disporder'));
|
$profile_fields = array();
| $profile_fields = array( 'required' => array(), 'optional' => array(), );
|
while($profile_field = $db->fetch_array($query))
|
while($profile_field = $db->fetch_array($query))
|
{
| {
|
$profile_fields['required'][] = $profile_field; }
| $profile_fields['required'][] = $profile_field; }
|
Zeile 379 | Zeile 385 |
---|
$page->output_header($lang->create_user);
$form = new Form("index.php?module=user-users&action=add", "post");
|
$page->output_header($lang->create_user);
$form = new Form("index.php?module=user-users&action=add", "post");
|
|
|
$page->output_nav_tabs($sub_tabs, 'create_user');
// If we have any error messages, show them
| $page->output_nav_tabs($sub_tabs, 'create_user');
// If we have any error messages, show them
|
Zeile 391 | Zeile 397 |
---|
{ $mybb->input = array_merge($mybb->input, array('usergroup' => 2)); }
|
{ $mybb->input = array_merge($mybb->input, array('usergroup' => 2)); }
|
| $mybb->input['profile_fields'] = $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY);
|
$form_container = new FormContainer($lang->required_profile_info); $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 = new FormContainer($lang->required_profile_info); $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->get_input('password'), array('id' => 'password', 'autocomplete' => 'off')), 'password'); $form_container->output_row($lang->confirm_password." <em>*</em>", "", $form->generate_password_box('confirm_password', $mybb->get_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->get_input('email'), array('id' => 'email')), 'email');
|
$display_group_options[0] = $lang->use_primary_user_group; $options = array();
| $display_group_options[0] = $lang->use_primary_user_group; $options = array();
|
Zeile 407 | Zeile 415 |
---|
$display_group_options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']); }
|
$display_group_options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']); }
|
$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->get_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->get_input('additionalgroups', MyBB::INPUT_ARRAY), 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->get_input('displaygroup'), array('id' => 'displaygroup')), 'displaygroup');
|
// Output custom profile fields - required
|
// Output custom profile fields - required
|
output_custom_profile_fields($profile_fields['required'], $mybb->input['profile_fields'], $form_container, $form);
| output_custom_profile_fields($profile_fields['required'], $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY), $form_container, $form);
|
$form_container->end(); $buttons[] = $form->generate_submit_button($lang->save_user);
| $form_container->end(); $buttons[] = $form->generate_submit_button($lang->save_user);
|
Zeile 437 | Zeile 445 |
---|
if($mybb->request_method == "post") {
|
if($mybb->request_method == "post") {
|
| $plugins->run_hooks("admin_user_users_edit_start");
|
if(is_super_admin($mybb->input['uid']) && $mybb->user['uid'] != $mybb->input['uid'] && !is_super_admin($mybb->user['uid'])) { flash_message($lang->error_no_perms_super_admin, 'error');
| if(is_super_admin($mybb->input['uid']) && $mybb->user['uid'] != $mybb->input['uid'] && !is_super_admin($mybb->user['uid'])) { flash_message($lang->error_no_perms_super_admin, 'error');
|
Zeile 444 | Zeile 453 |
---|
}
// Determine the usergroup stuff
|
}
// Determine the usergroup stuff
|
if(is_array($mybb->input['additionalgroups']))
| if(!empty($mybb->input['additionalgroups']) && is_array($mybb->input['additionalgroups']))
|
{ foreach($mybb->input['additionalgroups'] as $key => $gid) {
| { foreach($mybb->input['additionalgroups'] as $key => $gid) {
|
Zeile 453 | Zeile 462 |
---|
unset($mybb->input['additionalgroups'][$key]); } }
|
unset($mybb->input['additionalgroups'][$key]); } }
|
$additionalgroups = implode(",", $mybb->input['additionalgroups']);
| $additionalgroups = implode(",", array_map('intval', $mybb->input['additionalgroups']));
|
} else {
| } else {
|
Zeile 487 | Zeile 496 |
---|
}
$returndate = "{$return_day}-{$return_month}-{$return_year}";
|
}
$returndate = "{$return_day}-{$return_month}-{$return_year}";
|
}
| }
|
// Set up user handler. require_once MYBB_ROOT."inc/datahandlers/user.php";
| // Set up user handler. require_once MYBB_ROOT."inc/datahandlers/user.php";
|
Zeile 495 | Zeile 504 |
---|
// Set the data for the new user. $updated_user = array(
|
// Set the data for the new user. $updated_user = array(
|
"uid" => $mybb->input['uid'], "username" => $mybb->input['username'], "email" => $mybb->input['email'], "email2" => $mybb->input['email'], "usergroup" => $mybb->input['usergroup'],
| "uid" => $mybb->get_input('uid'), "username" => $mybb->get_input('username'), "email" => $mybb->get_input('email'), "email2" => $mybb->get_input('email'), "usergroup" => $mybb->get_input('usergroup'),
|
"additionalgroups" => $additionalgroups,
|
"additionalgroups" => $additionalgroups,
|
"displaygroup" => $mybb->input['displaygroup'], "postnum" => $mybb->input['postnum'], "threadnum" => $mybb->input['threadnum'], "usertitle" => $mybb->input['usertitle'], "timezone" => $mybb->input['timezone'], "language" => $mybb->input['language'], "profile_fields" => $mybb->input['profile_fields'],
| "displaygroup" => $mybb->get_input('displaygroup'), "postnum" => $mybb->get_input('postnum'), "threadnum" => $mybb->get_input('threadnum'), "usertitle" => $mybb->get_input('usertitle'), "timezone" => $mybb->get_input('timezone'), "language" => $mybb->get_input('language'), "profile_fields" => $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY),
|
"profile_fields_editable" => true,
|
"profile_fields_editable" => true,
|
"website" => $mybb->input['website'], "icq" => $mybb->input['icq'], "aim" => $mybb->input['aim'], "yahoo" => $mybb->input['yahoo'], "skype" => $mybb->input['skype'], "google" => $mybb->input['google'],
| "website" => $mybb->get_input('website'), "icq" => $mybb->get_input('icq'), "skype" => $mybb->get_input('skype'), "google" => $mybb->get_input('google'),
|
"birthday" => array(
|
"birthday" => array(
|
"day" => $mybb->input['bday1'], "month" => $mybb->input['bday2'], "year" => $mybb->input['bday3']
| "day" => $mybb->get_input('bday1'), "month" => $mybb->get_input('bday2'), "year" => $mybb->get_input('bday3')
|
),
|
),
|
"style" => $mybb->input['style'], "signature" => $mybb->input['signature'],
| "style" => $mybb->get_input('style'), "signature" => $mybb->get_input('signature'),
|
"dateformat" => $mybb->get_input('dateformat', MyBB::INPUT_INT), "timeformat" => $mybb->get_input('timeformat', MyBB::INPUT_INT),
|
"dateformat" => $mybb->get_input('dateformat', MyBB::INPUT_INT), "timeformat" => $mybb->get_input('timeformat', MyBB::INPUT_INT),
|
"usernotes" => $mybb->input['usernotes'],
| "usernotes" => $mybb->get_input('usernotes'),
|
"away" => array(
|
"away" => array(
|
"away" => $mybb->input['away'],
| "away" => $mybb->get_input('away'),
|
"date" => TIME_NOW, "returndate" => $returndate,
|
"date" => TIME_NOW, "returndate" => $returndate,
|
"awayreason" => $mybb->input['awayreason']
| "awayreason" => $mybb->get_input('awayreason')
|
) );
|
) );
|
if($user['usergroup'] == 5 && $mybb->input['usergroup'] != 5)
| if($user['usergroup'] == 5 && $mybb->get_input('usergroup') != 5)
|
{ if($user['coppauser'] == 1) { $updated_user['coppa_user'] = 0; } }
|
{ if($user['coppauser'] == 1) { $updated_user['coppa_user'] = 0; } }
|
if($mybb->input['new_password'])
| if($mybb->get_input('new_password'))
|
{
|
{
|
$updated_user['password'] = $mybb->input['new_password']; $updated_user['password2'] = $mybb->input['confirm_new_password'];
| $updated_user['password'] = $mybb->get_input('new_password'); $updated_user['password2'] = $mybb->get_input('confirm_new_password');
|
}
$updated_user['options'] = array(
|
}
$updated_user['options'] = array(
|
"allownotices" => $mybb->input['allownotices'], "hideemail" => $mybb->input['hideemail'], "subscriptionmethod" => $mybb->input['subscriptionmethod'], "invisible" => $mybb->input['invisible'], "dstcorrection" => $mybb->input['dstcorrection'], "threadmode" => $mybb->input['threadmode'], "classicpostbit" => $mybb->input['classicpostbit'], "showimages" => $mybb->input['showimages'], "showvideos" => $mybb->input['showvideos'], "showsigs" => $mybb->input['showsigs'], "showavatars" => $mybb->input['showavatars'], "showquickreply" => $mybb->input['showquickreply'], "receivepms" => $mybb->input['receivepms'], "receivefrombuddy" => $mybb->input['receivefrombuddy'], "pmnotice" => $mybb->input['pmnotice'], "daysprune" => $mybb->input['daysprune'], "showcodebuttons" => $mybb->input['showcodebuttons'], "sourceeditor" => $mybb->input['sourceeditor'], "pmnotify" => $mybb->input['pmnotify'], "buddyrequestspm" => $mybb->input['buddyrequestspm'], "buddyrequestsauto" => $mybb->input['buddyrequestsauto'], "showredirect" => $mybb->input['showredirect']
| "allownotices" => $mybb->get_input('allownotices'), "hideemail" => $mybb->get_input('hideemail'), "subscriptionmethod" => $mybb->get_input('subscriptionmethod'), "invisible" => $mybb->get_input('invisible'), "dstcorrection" => $mybb->get_input('dstcorrection'), "threadmode" => $mybb->get_input('threadmode'), "classicpostbit" => $mybb->get_input('classicpostbit'), "showimages" => $mybb->get_input('showimages'), "showvideos" => $mybb->get_input('showvideos'), "showsigs" => $mybb->get_input('showsigs'), "showavatars" => $mybb->get_input('showavatars'), "showquickreply" => $mybb->get_input('showquickreply'), "receivepms" => $mybb->get_input('receivepms'), "receivefrombuddy" => $mybb->get_input('receivefrombuddy'), "pmnotice" => $mybb->get_input('pmnotice'), "daysprune" => $mybb->get_input('daysprune'), "showcodebuttons" => $mybb->get_input('showcodebuttons'), "sourceeditor" => $mybb->get_input('sourceeditor'), "pmnotify" => $mybb->get_input('pmnotify'), "buddyrequestspm" => $mybb->get_input('buddyrequestspm'), "buddyrequestsauto" => $mybb->get_input('buddyrequestsauto'), "showredirect" => $mybb->get_input('showredirect')
|
);
if($mybb->settings['usertppoptions'])
| );
if($mybb->settings['usertppoptions'])
|
Zeile 593 | Zeile 600 |
---|
else { // Are we removing an avatar from this user?
|
else { // Are we removing an avatar from this user?
|
if($mybb->input['remove_avatar'])
| if($mybb->get_input('remove_avatar'))
|
{ $extra_user_updates = array( "avatar" => "",
| { $extra_user_updates = array( "avatar" => "",
|
Zeile 627 | Zeile 634 |
---|
// 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)
| if(!$mybb->settings['allowremoteavatars'])
|
{
|
{
|
// 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" );
| $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']);
| 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) = preg_split('/[|x]/', my_strtolower($mybb->settings['maxavatardims']));
$s = "?s={$maxwidth}"; $maxheight = (int)$maxwidth;
|
|
|
// 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;
| $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; } else
|
{ $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)
| { $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;
|
} } }
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))
| } 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) = preg_split('/[|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 > 0 && $height > 0)
|
{
|
{
|
$lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight); $avatar_error = $lang->error_avatartoobig;
| $avatar_dimensions = (int)$width."|".(int)$height;
|
}
|
}
|
| $extra_user_updates = array( "avatar" => $db->escape_string($mybb->input['avatar_url'].'?dateline='.TIME_NOW), "avatardimensions" => $avatar_dimensions, "avatartype" => "remote" ); remove_avatars($user['uid']);
|
}
|
}
|
}
if(empty($avatar_error)) { if($width > 0 && $height > 0)
| 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); } }
| } }
|
}
// Moderator "Options" (suspend signature, suspend/moderate posting)
| }
// Moderator "Options" (suspend signature, suspend/moderate posting)
|
Zeile 744 | Zeile 758 |
---|
require_once MYBB_ROOT."inc/functions_warnings.php"; foreach($moderator_options as $option) {
|
require_once MYBB_ROOT."inc/functions_warnings.php"; foreach($moderator_options as $option) {
|
if(!$mybb->input[$option['action']])
| if(empty($mybb->input[$option['action']]))
|
{ if($user[$option['update_field']] == 1) {
| { if($user[$option['update_field']] == 1) {
|
Zeile 756 | Zeile 770 |
---|
// Skip this option if we haven't selected it continue; }
|
// Skip this option if we haven't selected it continue; }
|
if($mybb->input[$option['action']])
| else
|
{ if((int)$mybb->input[$option['time']] == 0 && $mybb->input[$option['period']] != "never" && $user[$option['update_field']] != 1) {
| { if((int)$mybb->input[$option['time']] == 0 && $mybb->input[$option['period']] != "never" && $user[$option['update_field']] != 1) {
|
Zeile 801 | Zeile 814 |
---|
} }
|
} }
|
if($extra_user_updates['moderateposts'] && $extra_user_updates['suspendposting'])
| if(!empty($extra_user_updates['moderateposts']) && !empty($extra_user_updates['suspendposting']))
|
{ $errors[] = $lang->suspendmoderate_error; }
| { $errors[] = $lang->suspendmoderate_error; }
|
Zeile 817 | Zeile 830 |
---|
$plugins->run_hooks("admin_user_users_edit_commit_start");
|
$plugins->run_hooks("admin_user_users_edit_commit_start");
|
$db->update_query("users", $extra_user_updates, "uid='{$user['uid']}'");
| if(!empty($extra_user_updates)) { $db->update_query("users", $extra_user_updates, "uid='{$user['uid']}'"); }
|
// if we're updating the user's signature preferences, do so now if($mybb->input['update_posts'] == 'enable' || $mybb->input['update_posts'] == 'disable')
| // if we're updating the user's signature preferences, do so now if($mybb->input['update_posts'] == 'enable' || $mybb->input['update_posts'] == 'disable')
|
Zeile 836 | Zeile 852 |
---|
}
// Log admin action
|
}
// Log admin action
|
log_admin_action($user['uid'], htmlspecialchars_uni($mybb->input['username']));
| log_admin_action($user['uid'], $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"); }
|
| $plugins->run_hooks("admin_user_users_edit_end");
|
} }
|
} }
|
|
|
if(!$errors) { $user['usertitle'] = htmlspecialchars_decode($user['usertitle']);
| if(!$errors) { $user['usertitle'] = htmlspecialchars_decode($user['usertitle']);
|
Zeile 867 | Zeile 884 |
---|
// We need to fetch this users profile field values $query = $db->simple_select("userfields", "*", "ufid='{$user['uid']}'"); $mybb->input['profile_fields'] = $db->fetch_array($query);
|
// We need to fetch this users profile field values $query = $db->simple_select("userfields", "*", "ufid='{$user['uid']}'"); $mybb->input['profile_fields'] = $db->fetch_array($query);
|
}
| }
|
if($mybb->input['bday1'] || $mybb->input['bday2'] || $mybb->input['bday3']) { $mybb->input['bday'][0] = $mybb->input['bday1'];
| if($mybb->input['bday1'] || $mybb->input['bday2'] || $mybb->input['bday3']) { $mybb->input['bday'][0] = $mybb->input['bday1'];
|
Zeile 882 | Zeile 899 |
---|
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->get_input('away_day') || $mybb->get_input('away_month') || $mybb->get_input('away_year')) {
|
$mybb->input['away_year'] = $mybb->get_input('away_year', MyBB::INPUT_INT); } else
| $mybb->input['away_year'] = $mybb->get_input('away_year', MyBB::INPUT_INT); } else
|
Zeile 904 | Zeile 921 |
---|
// Fetch custom profile fields $query = $db->simple_select("profilefields", "*", "", array('order_by' => 'disporder'));
|
// Fetch custom profile fields $query = $db->simple_select("profilefields", "*", "", array('order_by' => 'disporder'));
|
$profile_fields = array();
| $profile_fields = array( 'required' => array(), 'optional' => array(), );
|
while($profile_field = $db->fetch_array($query)) { if($profile_field['required'] == 1)
| while($profile_field = $db->fetch_array($query)) { if($profile_field['required'] == 1)
|
Zeile 921 | Zeile 941 |
---|
$page->extra_header .= <<<EOF
|
$page->extra_header .= <<<EOF
|
<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=1808"></script> <script type="text/javascript" src="../jscripts/sceditor/editor_plugins/undo.js?ver=1805"></script>
| <link rel="stylesheet" href="../jscripts/sceditor/themes/mybb.css" type="text/css" media="all" /> <script type="text/javascript" src="../jscripts/sceditor/jquery.sceditor.bbcode.min.js?ver=1822"></script> <script type="text/javascript" src="../jscripts/bbcodes_sceditor.js?ver=1827"></script> <script type="text/javascript" src="../jscripts/sceditor/plugins/undo.js?ver=1805"></script>
|
EOF; $page->output_header($lang->edit_user);
| EOF; $page->output_header($lang->edit_user);
|
Zeile 946 | Zeile 966 |
---|
// 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']) {
|
echo $lang->sprintf($lang->warning_coppa_user, $user['uid']);
| echo $lang->sprintf($lang->warning_coppa_user, $user['uid'], $mybb->post_code);
|
}
$tabs = array(
| }
$tabs = array(
|
Zeile 969 | Zeile 989 |
---|
$table->construct_header($lang->general_account_stats, array('colspan' => '2', 'class' => 'align_center'));
// Avatar
|
$table->construct_header($lang->general_account_stats, array('colspan' => '2', 'class' => 'align_center'));
// Avatar
|
$avatar_dimensions = explode("|", $user['avatardimensions']); if($user['avatar']) { 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 { $scaled_dimensions = array( "width" => 120, "height" => 120 ); } if(!my_validate_url($user['avatar'])) { $user['avatar'] = "../{$user['avatar']}\n"; } }
| $avatar_dimensions = preg_split('/[|x]/', $user['avatardimensions']); if($user['avatardimensions']) { require_once MYBB_ROOT."inc/functions_image.php"; list($width, $height) = preg_split('/[|x]/', $user['avatardimensions']); $scaled_dimensions = scale_image($width, $height, 120, 120); } else { $scaled_dimensions = array( "width" => 120, "height" => 120 ); } if($user['avatar'] && (my_strpos($user['avatar'], '://') === false || $mybb->settings['allowremoteavatars'])) { if(!my_validate_url($user['avatar'])) { $avatar = format_avatar($user['avatar'], $user['avatardimensions']); $user['avatar'] = $avatar['image']; } }
|
else { if(my_validate_url($mybb->settings['useravatar'])) { $user['avatar'] = str_replace('{theme}', 'images', $mybb->settings['useravatar']);
|
else { if(my_validate_url($mybb->settings['useravatar'])) { $user['avatar'] = str_replace('{theme}', 'images', $mybb->settings['useravatar']);
|
} else
| } else
|
{ $user['avatar'] = "../".str_replace('{theme}', 'images', $mybb->settings['useravatar']); }
|
{ $user['avatar'] = "../".str_replace('{theme}', 'images', $mybb->settings['useravatar']); }
|
$scaled_dimensions = array( "width" => 120, "height" => 120 ); }
| }
|
$avatar_top = ceil((126-$scaled_dimensions['height'])/2);
|
$avatar_top = ceil((126-$scaled_dimensions['height'])/2);
|
if($user['lastactive']) { $last_active = my_date('relative', $user['lastactive']); } else
| $last_seen = max(array($user['lastactive'], $user['lastvisit'])); if(!empty($last_seen)) { $last_active = my_date('relative', $last_seen); } else
|
{ $last_active = $lang->never; } $reg_date = my_date('relative', $user['regdate']); if($user['dst'] == 1)
|
{ $last_active = $lang->never; } $reg_date = my_date('relative', $user['regdate']); if($user['dst'] == 1)
|
{ $timezone = $user['timezone']+1;
| { $timezone = (float)$user['timezone']+1;
|
} else {
|
} else {
|
$timezone = $user['timezone'];
| $timezone = (float)$user['timezone'];
|
} $local_date = gmdate($mybb->settings['dateformat'], TIME_NOW + ($timezone * 3600)); $local_time = gmdate($mybb->settings['timeformat'], TIME_NOW + ($timezone * 3600));
| } $local_date = gmdate($mybb->settings['dateformat'], TIME_NOW + ($timezone * 3600)); $local_time = gmdate($mybb->settings['timeformat'], TIME_NOW + ($timezone * 3600));
|
Zeile 1035 | Zeile 1053 |
---|
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);
$stats = $cache->read("stats");
| $posts_per_day = my_number_format($posts_per_day);
$stats = $cache->read("stats");
|
Zeile 1107 | Zeile 1125 |
---|
$username = htmlspecialchars_uni($user['username']); $table->output("{$lang->user_overview}: {$username}");
|
$username = htmlspecialchars_uni($user['username']); $table->output("{$lang->user_overview}: {$username}");
|
| $plugins->run_hooks("admin_user_users_edit_overview");
|
echo "</div>\n";
//
| echo "</div>\n";
//
|
Zeile 1129 | Zeile 1148 |
---|
$display_group_options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']); }
|
$display_group_options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']); }
|
if(!is_array($mybb->input['additionalgroups']))
| if(isset($mybb->input['additionalgroups']) && !is_array($mybb->input['additionalgroups']))
|
{ $mybb->input['additionalgroups'] = explode(',', $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->post_count." <em>*</em>", "", $form->generate_numeric_field('postnum', $mybb->input['postnum'], array('id' => 'postnum', 'min' => 0)), 'postnum'); $form_container->output_row($lang->thread_count." <em>*</em>", "", $form->generate_numeric_field('threadnum', $mybb->input['threadnum'], array('id' => 'threadnum', 'min' => 0)), 'threadnum');
| $form_container->output_row($lang->primary_user_group." <em>*</em>", "", $form->generate_select_box('usergroup', $options, $mybb->get_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->get_input('additionalgroups', MyBB::INPUT_ARRAY), 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->get_input('displaygroup'), array('id' => 'displaygroup')), 'displaygroup'); $form_container->output_row($lang->post_count." <em>*</em>", "", $form->generate_numeric_field('postnum', $mybb->get_input('postnum'), array('id' => 'postnum', 'min' => 0)), 'postnum'); $form_container->output_row($lang->thread_count." <em>*</em>", "", $form->generate_numeric_field('threadnum', $mybb->get_input('threadnum'), array('id' => 'threadnum', 'min' => 0)), 'threadnum');
|
// Output custom profile fields - required if(!isset($profile_fields['required'])) { $profile_fields['required'] = array(); }
|
// Output custom profile fields - required if(!isset($profile_fields['required'])) { $profile_fields['required'] = array(); }
|
output_custom_profile_fields($profile_fields['required'], $mybb->input['profile_fields'], $form_container, $form);
| output_custom_profile_fields($profile_fields['required'], $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY), $form_container, $form);
|
$form_container->end();
$form_container = new FormContainer($lang->optional_profile_info.': '.htmlspecialchars_uni($user['username']));
|
$form_container->end();
$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->aim_handle, "", $form->generate_text_box('aim', $mybb->input['aim'], array('id' => 'aim')), 'aim'); $form_container->output_row($lang->yahoo_messanger_handle, "", $form->generate_text_box('yahoo', $mybb->input['yahoo'], array('id' => 'yahoo')), 'yahoo'); $form_container->output_row($lang->skype_handle, "", $form->generate_text_box('skype', $mybb->input['skype'], array('id' => 'skype')), 'skype'); $form_container->output_row($lang->google_handle, "", $form->generate_text_box('google', $mybb->input['google'], array('id' => 'google')), 'google');
| $form_container->output_row($lang->custom_user_title, $lang->custom_user_title_desc, $form->generate_text_box('usertitle', $mybb->get_input('usertitle'), array('id' => 'usertitle')), 'usertitle'); $form_container->output_row($lang->website, "", $form->generate_text_box('website', $mybb->get_input('website'), array('id' => 'website')), 'website'); $form_container->output_row($lang->icq_number, "", $form->generate_numeric_field('icq', $mybb->get_input('icq'), array('id' => 'icq', 'min' => 0)), 'icq'); $form_container->output_row($lang->skype_handle, "", $form->generate_text_box('skype', $mybb->get_input('skype'), array('id' => 'skype')), 'skype'); $form_container->output_row($lang->google_handle, "", $form->generate_text_box('google', $mybb->get_input('google'), array('id' => 'google')), 'google');
|
// Birthday $birthday_days = array(0 => '');
| // Birthday $birthday_days = array(0 => '');
|
Zeile 1214 | Zeile 1231 |
---|
$form_container->end(); }
|
$form_container->end(); }
|
| $plugins->run_hooks("admin_user_users_edit_profile");
|
echo "</div>\n";
// // ACCOUNT SETTINGS //
|
echo "</div>\n";
// // ACCOUNT SETTINGS //
|
// 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.': '.htmlspecialchars_uni($user['username'])); $login_options = array(
|
echo "<div id=\"tab_settings\">\n"; $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'])),
| $form->generate_check_box("invisible", 1, $lang->hide_from_whos_online, array("checked" => $mybb->get_input('invisible'))),
|
); $form_container->output_row($lang->login_cookies_privacy, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $login_options)."</div>");
|
); $form_container->output_row($lang->login_cookies_privacy, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $login_options)."</div>");
|
if($mybb->input['pmnotice'] > 1) { $mybb->input['pmnotice'] = 1; }
| if($mybb->get_input('pmnotice') > 1) { $mybb->input['pmnotice'] = 1; }
|
$messaging_options = array(
|
$messaging_options = array(
|
$form->generate_check_box("allownotices", 1, $lang->recieve_admin_emails, array("checked" => $mybb->input['allownotices'])), $form->generate_check_box("hideemail", 1, $lang->hide_email_from_others, array("checked" => $mybb->input['hideemail'])), $form->generate_check_box("receivepms", 1, $lang->recieve_pms_from_others, array("checked" => $mybb->input['receivepms'])), $form->generate_check_box("receivefrombuddy", 1, $lang->recieve_pms_from_buddy, array("checked" => $mybb->input['receivefrombuddy'])), $form->generate_check_box("pmnotice", 1, $lang->alert_new_pms, array("checked" => $mybb->input['pmnotice'])), $form->generate_check_box("pmnotify", 1, $lang->email_notify_new_pms, array("checked" => $mybb->input['pmnotify'])), $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("allownotices", 1, $lang->recieve_admin_emails, array("checked" => $mybb->get_input('allownotices'))), $form->generate_check_box("hideemail", 1, $lang->hide_email_from_others, array("checked" => $mybb->get_input('hideemail'))), $form->generate_check_box("receivepms", 1, $lang->recieve_pms_from_others, array("checked" => $mybb->get_input('receivepms'))), $form->generate_check_box("receivefrombuddy", 1, $lang->recieve_pms_from_buddy, array("checked" => $mybb->get_input('receivefrombuddy'))), $form->generate_check_box("pmnotice", 1, $lang->alert_new_pms, array("checked" => $mybb->get_input('pmnotice'))), $form->generate_check_box("pmnotify", 1, $lang->email_notify_new_pms, array("checked" => $mybb->get_input('pmnotify'))), $form->generate_check_box("buddyrequestspm", 1, $lang->buddy_requests_pm, array("checked" => $mybb->get_input('buddyrequestspm'))), $form->generate_check_box("buddyrequestsauto", 1, $lang->buddy_requests_auto, array("checked" => $mybb->get_input('buddyrequestsauto'))), "<label for=\"subscriptionmethod\">{$lang->default_thread_subscription_mode}:</label><br />".$form->generate_select_box("subscriptionmethod", array($lang->do_not_subscribe, $lang->no_notification, $lang->instant_email_notification, $lang->instant_pm_notification), $mybb->get_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>");
| // Allow plugins to add messaging options $messaging_options = $plugins->run_hooks('admin_user_users_edit_messaging_options', $messaging_options);
// Output messaging options $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 = array($lang->use_default); foreach($date_formats as $key => $format)
|
Zeile 1260 | Zeile 1281 |
---|
}
$date_options = array(
|
}
$date_options = array(
|
"<label for=\"dateformat\">{$lang->date_format}:</label><br />".$form->generate_select_box("dateformat", $date_format_options, $mybb->input['dateformat'], array('id' => 'dateformat')), "<label for=\"dateformat\">{$lang->time_format}:</label><br />".$form->generate_select_box("timeformat", $time_format_options, $mybb->input['timeformat'], array('id' => 'timeformat')), "<label for=\"timezone\">{$lang->time_zone}:</label><br />".build_timezone_select("timezone", $mybb->input['timezone']), "<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'))
| "<label for=\"dateformat\">{$lang->date_format}:</label><br />".$form->generate_select_box("dateformat", $date_format_options, $mybb->get_input('dateformat'), array('id' => 'dateformat')), "<label for=\"dateformat\">{$lang->time_format}:</label><br />".$form->generate_select_box("timeformat", $time_format_options, $mybb->get_input('timeformat'), array('id' => 'timeformat')), "<label for=\"timezone\">{$lang->time_zone}:</label><br />".build_timezone_select("timezone", $mybb->get_input('timezone')), "<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->get_input('dstcorrection'), array('id' => 'dstcorrection'))
|
);
|
);
|
| // Allow plugins to add date options $date_options = $plugins->run_hooks('admin_user_users_edit_date_options', $date_options);
// Output date options
|
$form_container->output_row($lang->date_and_time_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $date_options)."</div>");
| $form_container->output_row($lang->date_and_time_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $date_options)."</div>");
|
Zeile 1296 | Zeile 1322 |
---|
);
$forum_options = array(
|
);
$forum_options = array(
|
"<label for=\"tpp\">{$lang->threads_per_page}:</label><br />".$form->generate_select_box("tpp", $tpp_options, $mybb->input['tpp'], array('id' => 'tpp')), "<label for=\"daysprune\">{$lang->default_thread_age_view}:</label><br />".$form->generate_select_box("daysprune", $thread_age_options, $mybb->input['daysprune'], array('id' => 'daysprune'))
| "<label for=\"tpp\">{$lang->threads_per_page}:</label><br />".$form->generate_select_box("tpp", $tpp_options, $mybb->get_input('tpp'), array('id' => 'tpp')), "<label for=\"daysprune\">{$lang->default_thread_age_view}:</label><br />".$form->generate_select_box("daysprune", $thread_age_options, $mybb->get_input('daysprune'), array('id' => 'daysprune'))
|
);
|
);
|
| // Allow plugins to add forum options $forum_options = $plugins->run_hooks('admin_user_users_edit_forum_options', $forum_options);
// Output forum options
|
$form_container->output_row($lang->forum_display_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $forum_options)."</div>");
$ppp_options = array($lang->use_default);
| $form_container->output_row($lang->forum_display_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $forum_options)."</div>");
$ppp_options = array($lang->use_default);
|
Zeile 1316 | Zeile 1347 |
---|
}
$thread_options = array(
|
}
$thread_options = array(
|
$form->generate_check_box("classicpostbit", 1, $lang->show_classic_postbit, array("checked" => $mybb->input['classicpostbit'])), $form->generate_check_box("showimages", 1, $lang->display_images, array("checked" => $mybb->input['showimages'])), $form->generate_check_box("showvideos", 1, $lang->display_videos, array("checked" => $mybb->input['showvideos'])), $form->generate_check_box("showsigs", 1, $lang->display_users_sigs, array("checked" => $mybb->input['showsigs'])), $form->generate_check_box("showavatars", 1, $lang->display_users_avatars, array("checked" => $mybb->input['showavatars'])), $form->generate_check_box("showquickreply", 1, $lang->show_quick_reply, array("checked" => $mybb->input['showquickreply'])), "<label for=\"ppp\">{$lang->posts_per_page}:</label><br />".$form->generate_select_box("ppp", $ppp_options, $mybb->input['ppp'], array('id' => 'ppp')),
| $form->generate_check_box("classicpostbit", 1, $lang->show_classic_postbit, array("checked" => $mybb->get_input('classicpostbit'))), $form->generate_check_box("showimages", 1, $lang->display_images, array("checked" => $mybb->get_input('showimages'))), $form->generate_check_box("showvideos", 1, $lang->display_videos, array("checked" => $mybb->get_input('showvideos'))), $form->generate_check_box("showsigs", 1, $lang->display_users_sigs, array("checked" => $mybb->get_input('showsigs'))), $form->generate_check_box("showavatars", 1, $lang->display_users_avatars, array("checked" => $mybb->get_input('showavatars'))), $form->generate_check_box("showquickreply", 1, $lang->show_quick_reply, array("checked" => $mybb->get_input('showquickreply'))), "<label for=\"ppp\">{$lang->posts_per_page}:</label><br />".$form->generate_select_box("ppp", $ppp_options, $mybb->get_input('ppp'), array('id' => 'ppp')),
|
"<label for=\"threadmode\">{$lang->default_thread_view_mode}:</label><br />".$form->generate_select_box("threadmode", array("" => $lang->use_default, "linear" => $lang->linear_mode, "threaded" => $lang->threaded_mode), $mybb->input['threadmode'], array('id' => 'threadmode')) );
|
"<label for=\"threadmode\">{$lang->default_thread_view_mode}:</label><br />".$form->generate_select_box("threadmode", array("" => $lang->use_default, "linear" => $lang->linear_mode, "threaded" => $lang->threaded_mode), $mybb->input['threadmode'], array('id' => 'threadmode')) );
|
$form_container->output_row($lang->thread_view_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $thread_options)."</div>");
| // Allow plugins to add thread options $thread_options = $plugins->run_hooks('admin_user_users_edit_thread_options', $thread_options);
// Output thread options $form_container->output_row($lang->thread_view_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $thread_options)."</div>");
|
$languages = array_merge(array('' => $lang->use_default), $lang->get_languages());
$other_options = array(
|
$languages = array_merge(array('' => $lang->use_default), $lang->get_languages());
$other_options = array(
|
$form->generate_check_box("showredirect", 1, $lang->show_redirect, array("checked" => $mybb->input['showredirect'])), $form->generate_check_box("showcodebuttons", "1", $lang->show_code_buttons, array("checked" => $mybb->input['showcodebuttons'])), $form->generate_check_box("sourceeditor", "1", $lang->source_editor, array("checked" => $mybb->input['sourceeditor'])), "<label for=\"style\">{$lang->theme}:</label><br />".build_theme_select("style", $mybb->input['style'], 0, "", true, false, true), "<label for=\"language\">{$lang->board_language}:</label><br />".$form->generate_select_box("language", $languages, $mybb->input['language'], array('id' => 'language'))
| $form->generate_check_box("showredirect", 1, $lang->show_redirect, array("checked" => $mybb->get_input('showredirect'))), $form->generate_check_box("showcodebuttons", "1", $lang->show_code_buttons, array("checked" => $mybb->get_input('showcodebuttons'))), $form->generate_check_box("sourceeditor", "1", $lang->source_editor, array("checked" => $mybb->get_input('sourceeditor'))), "<label for=\"style\">{$lang->theme}:</label><br />".build_theme_select("style", $mybb->get_input('style'), 0, "", true, false, true), "<label for=\"language\">{$lang->board_language}:</label><br />".$form->generate_select_box("language", $languages, $mybb->get_input('language'), array('id' => 'language'))
|
);
|
);
|
$form_container->output_row($lang->other_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $other_options)."</div>");
| |
|
|
$form_container->end();
| // Allow plugins to add other options $other_options = $plugins->run_hooks('admin_user_users_edit_other_options', $other_options);
// Output other options $form_container->output_row($lang->other_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $other_options)."</div>");
$form_container->end(); $plugins->run_hooks("admin_user_users_edit_settings");
|
echo "</div>\n";
// // SIGNATURE EDITOR //
|
echo "</div>\n";
// // SIGNATURE EDITOR //
|
$signature_editor = $form->generate_text_area("signature", $mybb->input['signature'], array('id' => 'signature', 'rows' => 15, 'cols' => '70', 'style' => 'height: 250px; width: 95%'));
| $signature_editor = $form->generate_text_area("signature", $mybb->get_input('signature'), array('id' => 'signature', 'rows' => 15, 'cols' => '70', 'style' => 'height: 250px; width: 95%'));
|
$sig_smilies = $lang->off; if($mybb->settings['sigsmilies'] == 1) {
| $sig_smilies = $lang->off; if($mybb->settings['sigsmilies'] == 1) {
|
Zeile 1379 | Zeile 1421 |
---|
);
// Are we already suspending the signature?
|
);
// Are we already suspending the signature?
|
if($mybb->input['suspendsignature'])
| if($mybb->get_input('suspendsignature'))
|
{ $sig_checked = 1;
| { $sig_checked = 1;
|
Zeile 1473 | Zeile 1515 |
---|
$form_container->output_row($lang->signature_preferences, "", implode("<br />", $signature_options));
$form_container->end();
|
$form_container->output_row($lang->signature_preferences, "", implode("<br />", $signature_options));
$form_container->end();
|
| $plugins->run_hooks("admin_user_users_edit_signatur");
|
echo "</div>\n";
//
| echo "</div>\n";
//
|
Zeile 1502 | Zeile 1545 |
---|
if($mybb->settings['maxavatardims'] != "") {
|
if($mybb->settings['maxavatardims'] != "") {
|
list($max_width, $max_height) = explode("x", my_strtolower($mybb->settings['maxavatardims']));
| list($max_width, $max_height) = preg_split('/[|x]/', my_strtolower($mybb->settings['maxavatardims']));
|
$max_size = "<br />{$lang->max_dimensions_are} {$max_width}x{$max_height}";
|
$max_size = "<br />{$lang->max_dimensions_are} {$max_width}x{$max_height}";
|
}
| }
|
if($mybb->settings['avatarsize']) { $maximum_size = get_friendly_size($mybb->settings['avatarsize']*1024);
| if($mybb->settings['avatarsize']) { $maximum_size = get_friendly_size($mybb->settings['avatarsize']*1024);
|
Zeile 1515 | Zeile 1558 |
---|
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.': '.htmlspecialchars_uni($user['username']));
// Custom avatar if($mybb->settings['avatarresizing'] == "auto") { $auto_resize = $lang->avatar_auto_resize;
|
$table->output($lang->avatar.': '.htmlspecialchars_uni($user['username']));
// Custom avatar if($mybb->settings['avatarresizing'] == "auto") { $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');
|
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');
|
$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();
|
$form_container->end();
|
| $plugins->run_hooks("admin_user_users_edit_avatar");
|
echo "</div>\n";
//
| echo "</div>\n";
//
|
Zeile 1558 | Zeile 1605 |
---|
// Do we have any existing suspensions here? $existing_info = '';
|
// Do we have any existing suspensions here? $existing_info = '';
|
if($user['moderateposts'] || ($mybb->input['moderateposting'] && !empty($errors)))
| if($user['moderateposts'] || ($mybb->get_input('moderateposting') && !empty($errors)))
|
{ $mybb->input['moderateposting'] = 1; if($user['moderationtime'] != 0)
| { $mybb->input['moderateposting'] = 1; if($user['moderationtime'] != 0)
|
Zeile 1588 | Zeile 1635 |
---|
} }
|
} }
|
$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->get_input('modpost_time'), array('style' => 'width: 3em;', 'min' => 0)).' '.$modpost_options.'</div>';
|
$lang->moderate_posts_info = $lang->sprintf($lang->moderate_posts_info, htmlspecialchars_uni($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);
| $form_container->output_row($form->generate_check_box("moderateposting", 1, $lang->moderate_posts, array("id" => "moderateposting", "onclick" => "toggleBox('modpost');", "checked" => $mybb->get_input('moderateposting'))), $lang->moderate_posts_info, $modpost_div);
|
// Suspend posts // Generate check box
|
// Suspend posts // Generate check box
|
$suspost_options = $form->generate_select_box('suspost_period', $periods, $mybb->input['suspost_period'], array('id' => 'suspost_period'));
| $suspost_options = $form->generate_select_box('suspost_period', $periods, $mybb->get_input('suspost_period'), array('id' => 'suspost_period'));
|
// Do we have any existing suspensions here?
|
// Do we have any existing suspensions here?
|
if($user['suspendposting'] || ($mybb->input['suspendposting'] && !empty($errors)))
| if($user['suspendposting'] || ($mybb->get_input('suspendposting') && !empty($errors)))
|
{ $mybb->input['suspendposting'] = 1;
|
{ $mybb->input['suspendposting'] = 1;
|
if($user['suspensiontime'] == 0 || $mybb->input['suspost_period'] == "never")
| if($user['suspensiontime'] == 0 || $mybb->get_input('suspost_period') == "never")
|
{ $existing_info = $lang->suspended_perm; }
| { $existing_info = $lang->suspended_perm; }
|
Zeile 1628 | Zeile 1675 |
---|
} }
|
} }
|
$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->get_input('suspost_time'), array('style' => 'width: 3em;', 'min' => 0)).' '.$suspost_options.'</div>';
|
$lang->suspend_posts_info = $lang->sprintf($lang->suspend_posts_info, htmlspecialchars_uni($user['username']));
|
$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->output_row($form->generate_check_box("suspendposting", 1, $lang->suspend_posts, array("id" => "suspendposting", "onclick" => "toggleBox('suspost');", "checked" => $mybb->get_input('suspendposting'))), $lang->suspend_posts_info, $suspost_div);
|
$form_container->end();
|
$form_container->end();
|
| $plugins->run_hooks("admin_user_users_edit_moderator_options");
|
echo "</div>\n";
$plugins->run_hooks("admin_user_users_edit_graph");
| echo "</div>\n";
$plugins->run_hooks("admin_user_users_edit_graph");
|
Zeile 1720 | Zeile 1768 |
---|
}
// User clicked no
|
}
// User clicked no
|
if($mybb->input['no'])
| if($mybb->get_input('no'))
|
{ admin_redirect("index.php?module=user-users"); }
| { admin_redirect("index.php?module=user-users"); }
|
Zeile 1746 | Zeile 1794 |
---|
$plugins->run_hooks("admin_user_users_delete_commit_end");
|
$plugins->run_hooks("admin_user_users_delete_commit_end");
|
log_admin_action($user['uid'], htmlspecialchars_uni($user['username']));
| log_admin_action($user['uid'], $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 1826 | Zeile 1874 |
---|
$user = $db->fetch_array($query);
// Log admin action
|
$user = $db->fetch_array($query);
// Log admin action
|
log_admin_action($user['uid'], htmlspecialchars_uni($user['username']));
| log_admin_action($user['uid'], $user['username']);
|
$table = new Table;
| $table = new Table;
|
Zeile 1902 | Zeile 1950 |
---|
if($mybb->request_method == "post") {
|
if($mybb->request_method == "post") {
|
$source_user = get_user_by_username($mybb->input['source_username'], array('fields' => '*')); if(!$source_user['uid'])
| foreach(array('source', 'destination') as $target)
|
{
|
{
|
$errors[] = $lang->error_invalid_user_source; }
$destination_user = get_user_by_username($mybb->input['destination_username'], array('fields' => '*')); if(!$destination_user['uid']) { $errors[] = $lang->error_invalid_user_destination;
| ${$target.'_user'} = get_user_by_username($mybb->input[$target.'_username'], array('fields' => '*')); if(empty(${$target.'_user'}['uid'])) { $errors[] = $lang->{'error_invalid_user_'.$target}; }
|
}
// If we're not a super admin and we're merging a source super admin or a destination super admin then dissallow this action
| }
// If we're not a super admin and we're merging a source super admin or a destination super admin then dissallow this action
|
Zeile 1921 | Zeile 1966 |
---|
admin_redirect("index.php?module=user-users"); }
|
admin_redirect("index.php?module=user-users"); }
|
if($source_user['uid'] == $destination_user['uid'])
| if((!empty($source_user)) && !empty($destination_user) && $source_user['uid'] == $destination_user['uid'] && !empty($source_user['uid']))
|
{ $errors[] = $lang->error_cannot_merge_same_account; }
| { $errors[] = $lang->error_cannot_merge_same_account; }
|
Zeile 1952 | Zeile 1997 |
---|
$db->update_query("posts", $uid_update, "uid='{$source_user['uid']}'"); $db->update_query("privatemessages", $uid_update, "uid='{$source_user['uid']}'"); $db->update_query("reportedcontent", $uid_update, "uid='{$source_user['uid']}'");
|
$db->update_query("posts", $uid_update, "uid='{$source_user['uid']}'"); $db->update_query("privatemessages", $uid_update, "uid='{$source_user['uid']}'"); $db->update_query("reportedcontent", $uid_update, "uid='{$source_user['uid']}'");
|
$db->update_query("threadratings", $uid_update, "uid='{$source_user['uid']}'");
| |
$db->update_query("threads", $uid_update, "uid='{$source_user['uid']}'"); $db->update_query("warnings", $uid_update, "uid='{$source_user['uid']}'"); $db->update_query("warnings", array("revokedby" => $destination_user['uid']), "revokedby='{$source_user['uid']}'"); $db->update_query("warnings", array("issuedby" => $destination_user['uid']), "issuedby='{$source_user['uid']}'");
|
$db->update_query("threads", $uid_update, "uid='{$source_user['uid']}'"); $db->update_query("warnings", $uid_update, "uid='{$source_user['uid']}'"); $db->update_query("warnings", array("revokedby" => $destination_user['uid']), "revokedby='{$source_user['uid']}'"); $db->update_query("warnings", array("issuedby" => $destination_user['uid']), "issuedby='{$source_user['uid']}'");
|
| // Thread ratings merge_thread_ratings($source_user['uid'], $destination_user['uid']);
|
// Banning $db->update_query("banned", array('admin' => $destination_user['uid']), "admin = '{$source_user['uid']}'");
|
// Banning $db->update_query("banned", array('admin' => $destination_user['uid']), "admin = '{$source_user['uid']}'");
|
| // Carry over referrals $db->update_query("users", array("referrer" => $destination_user['uid']), "referrer='{$source_user['uid']}' AND uid!='{$destination_user['uid']}'"); // If destination user has no referrer but source does and source user was not referred by destination user // or destination user was referred by the source user if(($destination_user['referrer'] == 0 && $source_user['referrer'] > 0 && $source_user['referrer'] != $destination_user['uid']) || $destination_user['referrer'] == $source_user['uid']) { $db->update_query("users", array("referrer" => $source_user['referrer']), "uid='{$destination_user['uid']}'"); } $query = $db->simple_select("users", "COUNT(uid) as total_referrals", "referrer='{$destination_user['uid']}' AND uid!='{$source_user['uid']}'"); $new_referrals = $db->fetch_field($query, "total_referrals"); $db->update_query("users", array("referrals" => (int)$new_referrals), "uid='{$destination_user['uid']}'");
|
// Merging Reputation // First, let's change all the details over to our new user...
| // Merging Reputation // First, let's change all the details over to our new user...
|
Zeile 1973 | Zeile 2032 |
---|
);
$to_remove = array();
|
);
$to_remove = array();
|
$query = $db->simple_select("reputation", "*", "adduid = '".$destination_user['uid']."'");
| $query = $db->simple_select("reputation", "*", "adduid = '".$destination_user['uid']."'", $options);
|
while($rep = $db->fetch_array($query)) { if($rep['pid'] == 0 && $mybb->settings['multirep'] == 0 && $last_result['uid'] == $rep['uid'])
| while($rep = $db->fetch_array($query)) { if($rep['pid'] == 0 && $mybb->settings['multirep'] == 0 && $last_result['uid'] == $rep['uid'])
|
Zeile 2072 | Zeile 2131 |
---|
"ignorelist" => $ignored ); $db->update_query("users", $lists, "uid='{$destination_user['uid']}'");
|
"ignorelist" => $ignored ); $db->update_query("users", $lists, "uid='{$destination_user['uid']}'");
|
// Set up user handler. require_once MYBB_ROOT.'inc/datahandlers/user.php'; $userhandler = new UserDataHandler('delete');
// Delete the old user $userhandler->delete_user($source_user['uid']);
| |
// Get a list of forums where post count doesn't apply $fids = array();
| // Get a list of forums where post count doesn't apply $fids = array();
|
Zeile 2086 | Zeile 2138 |
---|
while($fid = $db->fetch_field($query, "fid")) { $fids[] = $fid;
|
while($fid = $db->fetch_field($query, "fid")) { $fids[] = $fid;
|
}
| }
|
$fids_not_in = ''; if(!empty($fids)) { $fids_not_in = "AND fid NOT IN(".implode(',', $fids).")";
|
$fids_not_in = ''; if(!empty($fids)) { $fids_not_in = "AND fid NOT IN(".implode(',', $fids).")";
|
}
| }
|
// Update user post count $query = $db->simple_select("posts", "COUNT(*) AS postnum", "uid='".$destination_user['uid']."' {$fids_not_in}");
|
// Update user post count $query = $db->simple_select("posts", "COUNT(*) AS postnum", "uid='".$destination_user['uid']."' {$fids_not_in}");
|
$num = $db->fetch_array($query); $updated_count = array(
| $num = $db->fetch_array($query); $updated_count = array(
|
"postnum" => $num['postnum']
|
"postnum" => $num['postnum']
|
); $db->update_query("users", $updated_count, "uid='{$destination_user['uid']}'");
| ); $db->update_query("users", $updated_count, "uid='{$destination_user['uid']}'");
|
// Update user thread count $query = $db->simple_select("threads", "COUNT(*) AS threadnum", "uid='".$destination_user['uid']."' {$fids_not_in}"); $num = $db->fetch_array($query);
| // Update user thread count $query = $db->simple_select("threads", "COUNT(*) AS threadnum", "uid='".$destination_user['uid']."' {$fids_not_in}"); $num = $db->fetch_array($query);
|
Zeile 2109 | Zeile 2161 |
---|
"threadnum" => $num['threadnum'] ); $db->update_query("users", $updated_count, "uid='{$destination_user['uid']}'");
|
"threadnum" => $num['threadnum'] ); $db->update_query("users", $updated_count, "uid='{$destination_user['uid']}'");
|
|
|
// Use the earliest registration date if($destination_user['regdate'] > $source_user['regdate']) {
| // Use the earliest registration date if($destination_user['regdate'] > $source_user['regdate']) {
|
Zeile 2117 | Zeile 2169 |
---|
}
$plugins->run_hooks("admin_user_users_merge_commit");
|
}
$plugins->run_hooks("admin_user_users_merge_commit");
|
| // Set up user handler. require_once MYBB_ROOT.'inc/datahandlers/user.php'; $userhandler = new UserDataHandler('delete');
// Delete the old user $userhandler->delete_user($source_user['uid']);
|
$cache->update_awaitingactivation();
// Log admin action
|
$cache->update_awaitingactivation();
// Log admin action
|
log_admin_action($source_user['uid'], htmlspecialchars_uni($source_user['username']), $destination_user['uid'], htmlspecialchars_uni($destination_user['username']));
| log_admin_action($source_user['uid'], $source_user['username'], $destination_user['uid'], $destination_user['username']);
|
// Redirect! $username = htmlspecialchars_uni($source_user['username']);
| // Redirect! $username = htmlspecialchars_uni($source_user['username']);
|
Zeile 2146 | Zeile 2205 |
---|
$form = new Form("index.php?module=user-users&action=merge", "post");
$form_container = new FormContainer($lang->merge_users);
|
$form = new Form("index.php?module=user-users&action=merge", "post");
$form_container = new FormContainer($lang->merge_users);
|
$form_container->output_row($lang->source_account." <em>*</em>", $lang->source_account_desc, $form->generate_text_box('source_username', $mybb->input['source_username'], array('id' => 'source_username')), 'source_username'); $form_container->output_row($lang->destination_account." <em>*</em>", $lang->destination_account_desc, $form->generate_text_box('destination_username', $mybb->input['destination_username'], array('id' => 'destination_username')), 'destination_username');
| $form_container->output_row($lang->source_account." <em>*</em>", $lang->source_account_desc, $form->generate_text_box('source_username', $mybb->get_input('source_username'), array('id' => 'source_username')), 'source_username'); $form_container->output_row($lang->destination_account." <em>*</em>", $lang->destination_account_desc, $form->generate_text_box('destination_username', $mybb->get_input('destination_username'), array('id' => 'destination_username')), 'destination_username');
|
$form_container->end();
// Autocompletion for usernames
| $form_container->end();
// Autocompletion for usernames
|
Zeile 2157 | Zeile 2216 |
---|
<script type="text/javascript"> <!-- $("#source_username").select2({
|
<script type="text/javascript"> <!-- $("#source_username").select2({
|
placeholder: "'.$lang->search_for_a_user.'", minimumInputLength: 2, multiple: false, ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper url: "../xmlhttp.php?action=get_users", dataType: \'json\', data: function (term, page) { return { query: term // search term }; }, results: function (data, page) { // parse the results into the format expected by Select2. // since we are using custom formatting functions we do not need to alter remote JSON data return {results: data}; } }, initSelection: function(element, callback) { var query = $(element).val(); if (query !== "") { $.ajax("../xmlhttp.php?action=get_users&getone=1", { data: { query: query }, dataType: "json"
| placeholder: "'.$lang->search_for_a_user.'", minimumInputLength: 2, multiple: false, ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper url: "../xmlhttp.php?action=get_users", dataType: \'json\', data: function (term, page) { return { query: term // search term }; }, results: function (data, page) { // parse the results into the format expected by Select2. // since we are using custom formatting functions we do not need to alter remote JSON data return {results: data}; } }, initSelection: function(element, callback) { var query = $(element).val(); if (query !== "") { $.ajax("../xmlhttp.php?action=get_users&getone=1", { data: { query: query }, dataType: "json"
|
}).done(function(data) { callback(data); }); } }
| }).done(function(data) { callback(data); }); } }
|
Zeile 2210 | Zeile 2269 |
---|
query: query }, dataType: "json"
|
query: query }, dataType: "json"
|
}).done(function(data) { callback(data); }); } }
| }).done(function(data) { callback(data); }); } }
|
}); // --> </script>';
| }); // --> </script>';
|
Zeile 2223 | Zeile 2282 |
---|
$page->output_footer(); }
|
$page->output_footer(); }
|
|
|
if($mybb->input['action'] == "search") { $plugins->run_hooks("admin_user_users_search");
|
if($mybb->input['action'] == "search") { $plugins->run_hooks("admin_user_users_search");
|
if($mybb->request_method == "post" || $mybb->input['results'] == 1)
| if($mybb->request_method == "post" || $mybb->get_input('results') == 1)
|
{ // Build view options from incoming search options
|
{ // Build view options from incoming search options
|
if($mybb->input['vid'])
| if($mybb->get_input('vid'))
|
{ $query = $db->simple_select("adminviews", "*", "vid='".$mybb->get_input('vid', MyBB::INPUT_INT)."'"); $admin_view = $db->fetch_array($query);
| { $query = $db->simple_select("adminviews", "*", "vid='".$mybb->get_input('vid', MyBB::INPUT_INT)."'"); $admin_view = $db->fetch_array($query);
|
Zeile 2239 | Zeile 2298 |
---|
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);
|
}
| } }
if($mybb->get_input('search_id') && $admin_session['data']['user_views'][$mybb->get_input('search_id')]) { $admin_view = $admin_session['data']['user_views'][$mybb->get_input('search_id')]; unset($admin_view['extra_sql']);
|
}
|
}
|
if($mybb->input['search_id'] && $admin_session['data']['user_views'][$mybb->input['search_id']])
| // Don't have a view? Fetch the default if(!isset($admin_view) || !$admin_view['vid'])
|
{
|
{
|
$admin_view = $admin_session['data']['user_views'][$mybb->input['search_id']]; unset($admin_view['extra_sql']); } else { // Don't have a view? Fetch the default if(!$admin_view['vid'])
| $default_view = fetch_default_view("user"); if(!$default_view)
|
{
|
{
|
$default_view = fetch_default_view("user"); if(!$default_view) { $default_view = "0"; } $query = $db->simple_select("adminviews", "*", "type='user' AND (vid='{$default_view}' OR uid=0)", array("order_by" => "uid", "order_dir" => "desc")); $admin_view = $db->fetch_array($query);
| $default_view = "0";
|
}
|
}
|
| $query = $db->simple_select("adminviews", "*", "type='user' AND (vid='{$default_view}' OR uid=0)", array("order_by" => "uid", "order_dir" => "desc")); $admin_view = $db->fetch_array($query);
|
}
|
}
|
// Override specific parts of the view unset($admin_view['vid']);
if($mybb->input['type']) { $admin_view['view_type'] = $mybb->input['type']; }
if($mybb->input['conditions']) { $admin_view['conditions'] = $mybb->input['conditions']; }
if($mybb->input['sortby'])
| // Override specific parts of the view unset($admin_view['vid']);
if($mybb->get_input('type')) { $admin_view['view_type'] = $mybb->get_input('type'); }
if(!empty($mybb->input['conditions'])) { $admin_view['conditions'] = $mybb->get_input('conditions', MyBB::INPUT_ARRAY); }
if($mybb->get_input('sortby'))
|
{
|
{
|
$admin_view['sortby'] = $mybb->input['sortby'];
| $admin_view['sortby'] = $mybb->get_input('sortby');
|
}
if($mybb->get_input('perpage', MyBB::INPUT_INT)) {
|
}
if($mybb->get_input('perpage', MyBB::INPUT_INT)) {
|
$admin_view['perpage'] = $mybb->input['perpage'];
| $admin_view['perpage'] = $mybb->get_input('perpage');
|
}
|
}
|
if($mybb->input['order'])
| if($mybb->get_input('order'))
|
{
|
{
|
$admin_view['sortorder'] = $mybb->input['order'];
| $admin_view['sortorder'] = $mybb->get_input('order');
|
}
|
}
|
if($mybb->input['displayas'])
| if($mybb->get_input('displayas'))
|
{
|
{
|
$admin_view['view_type'] = $mybb->input['displayas'];
| $admin_view['view_type'] = $mybb->get_input('displayas');
|
}
|
}
|
if($mybb->input['profile_fields'])
| if(!empty($mybb->input['profile_fields']))
|
{
|
{
|
$admin_view['custom_profile_fields'] = $mybb->input['profile_fields'];
| $admin_view['custom_profile_fields'] = $mybb->get_input('profile_fields');
|
}
$plugins->run_hooks("admin_user_users_search_commit");
| }
$plugins->run_hooks("admin_user_users_search_commit");
|
Zeile 2314 | Zeile 2371 |
---|
} else {
|
} else {
|
if($mybb->input['from'] == "home")
| if($mybb->get_input('from') == "home")
|
{ flash_message($lang->error_no_users_found, 'error'); admin_redirect("index.php");
| { flash_message($lang->error_no_users_found, 'error'); admin_redirect("index.php");
|
Zeile 2334 | Zeile 2391 |
---|
// If we have any error messages, show them if($errors)
|
// If we have any error messages, show them if($errors)
|
{
| {
|
$page->output_inline_error($errors);
|
$page->output_inline_error($errors);
|
}
| }
|
|
|
if(!$mybb->input['displayas'])
| if(!$mybb->get_input('displayas'))
|
{ $mybb->input['displayas'] = "card"; }
| { $mybb->input['displayas'] = "card"; }
|
Zeile 2351 | Zeile 2408 |
---|
$sort_directions = array( "asc" => $lang->ascending, "desc" => $lang->descending
|
$sort_directions = array( "asc" => $lang->ascending, "desc" => $lang->descending
|
); $form_container->output_row($lang->sort_results_by, "", $form->generate_select_box('sortby', $sort_options, $mybb->input['sortby'], array('id' => 'sortby'))." {$lang->in} ".$form->generate_select_box('order', $sort_directions, $mybb->input['order'], array('id' => 'order')), 'sortby'); $form_container->output_row($lang->results_per_page, "", $form->generate_numeric_field('perpage', $mybb->input['perpage'], array('id' => 'perpage', 'min' => 1)), 'perpage'); $form_container->output_row($lang->display_results_as, "", $form->generate_radio_button('displayas', 'table', $lang->table, array('checked' => ($mybb->input['displayas'] != "card" ? true : false)))."<br />".$form->generate_radio_button('displayas', 'card', $lang->business_card, array('checked' => ($mybb->input['displayas'] == "card" ? true : false))));
| ); $form_container->output_row($lang->sort_results_by, "", $form->generate_select_box('sortby', $sort_options, $mybb->get_input('sortby'), array('id' => 'sortby'))." {$lang->in} ".$form->generate_select_box('order', $sort_directions, $mybb->get_input('order'), array('id' => 'order')), 'sortby'); $form_container->output_row($lang->results_per_page, "", $form->generate_numeric_field('perpage', $mybb->get_input('perpage'), array('id' => 'perpage', 'min' => 1)), 'perpage'); $form_container->output_row($lang->display_results_as, "", $form->generate_radio_button('displayas', 'table', $lang->table, array('checked' => ($mybb->get_input('displayas') != "card" ? true : false)))."<br />".$form->generate_radio_button('displayas', 'card', $lang->business_card, array('checked' => ($mybb->get_input('displayas') == "card" ? true : false))));
|
$form_container->end();
$buttons[] = $form->generate_submit_button($lang->find_users);
| $form_container->end();
$buttons[] = $form->generate_submit_button($lang->find_users);
|
Zeile 2368 | Zeile 2425 |
---|
{ $plugins->run_hooks("admin_user_users_inline");
|
{ $plugins->run_hooks("admin_user_users_inline");
|
if($mybb->input['vid'] || $mybb->cookies['acp_view'])
| if(!empty($mybb->input['vid']) || !empty($mybb->cookies['acp_view']))
|
{ // We have a custom view
|
{ // We have a custom view
|
if(!$mybb->cookies['acp_view'])
| if(empty($mybb->cookies['acp_view']))
|
{ // Set a cookie my_setcookie("acp_view", $mybb->input['vid'], 60); }
|
{ // Set a cookie my_setcookie("acp_view", $mybb->input['vid'], 60); }
|
elseif($mybb->cookies['acp_view'])
| else
|
{ // We already have a cookie, so let's use it... $mybb->input['vid'] = $mybb->cookies['acp_view']; }
|
{ // We already have a cookie, so let's use it... $mybb->input['vid'] = $mybb->cookies['acp_view']; }
|
$vid_url = "&vid=".$mybb->input['vid'];
| $vid_url = "&vid=".$mybb->get_input('vid'); } else { $vid_url = null;
|
}
// First, collect the user IDs that we're performing the moderation on
|
}
// First, collect the user IDs that we're performing the moderation on
|
$ids = explode("|", $mybb->cookies['inlinemod_useracp']); foreach($ids as $id)
| $selected = array(); if(isset($mybb->cookies['inlinemod_useracp']))
|
{
|
{
|
if($id != '')
| $ids = explode("|", $mybb->cookies['inlinemod_useracp']); foreach($ids as $id)
|
{
|
{
|
$selected[] = (int)$id;
| if($id != '') { $selected[] = (int)$id; }
|
} }
| } }
|
Zeile 2408 | Zeile 2473 |
---|
); $page->add_breadcrumb_item($lang->manage_users);
|
); $page->add_breadcrumb_item($lang->manage_users);
|
if(!is_array($selected))
| if(empty($selected))
|
{ // Not selected any users, show error flash_message($lang->error_inline_no_users_selected, 'error');
| { // Not selected any users, show error flash_message($lang->error_inline_no_users_selected, 'error');
|
Zeile 2431 | Zeile 2496 |
---|
} }
|
} }
|
if(is_array($to_update))
| $plugins->run_hooks("admin_user_multiactivate", $to_update);
if(isset($to_update) && is_array($to_update))
|
{ $sql_array = implode(",", $to_update); $db->write_query("UPDATE ".TABLE_PREFIX."users SET usergroup = '2' WHERE uid IN (".$sql_array.")");
| { $sql_array = implode(",", $to_update); $db->write_query("UPDATE ".TABLE_PREFIX."users SET usergroup = '2' WHERE uid IN (".$sql_array.")");
|
Zeile 2449 | Zeile 2516 |
---|
$to_update_count = count($to_update); $lang->inline_activated = $lang->sprintf($lang->inline_activated, my_number_format($to_update_count));
|
$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))
| if(is_array($selected) && $to_update_count != count($selected))
|
{ // The update count is different to how many we selected! $not_updated_count = count($selected) - $to_update_count;
| { // The update count is different to how many we selected! $not_updated_count = count($selected) - $to_update_count;
|
Zeile 2473 | Zeile 2540 |
---|
break; case 'multilift': // Get the users that are banned, and check that they have been selected
|
break; case 'multilift': // Get the users that are banned, and check that they have been selected
|
if($mybb->input['no'])
| if($mybb->get_input('no'))
|
{ admin_redirect("index.php?module=user-users".$vid_url); // User clicked on 'No' }
| { admin_redirect("index.php?module=user-users".$vid_url); // User clicked on 'No' }
|
Zeile 2487 | Zeile 2554 |
---|
{ $updated_group = array( "usergroup" => $ban['oldgroup'],
|
{ $updated_group = array( "usergroup" => $ban['oldgroup'],
|
"additionalgroups" => $ban['oldadditionalgroups'],
| "additionalgroups" => $db->escape_string($ban['oldadditionalgroups']),
|
"displaygroup" => $ban['olddisplaygroup'] ); $db->update_query("users", $updated_group, "uid = '".$ban['uid']."'"); $db->delete_query("banned", "uid = '".$ban['uid']."'"); }
|
"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";
| $cache->update_moderators();
$mybb->input['action'] = "inline_lift";
|
Zeile 2566 | Zeile 2632 |
---|
'uid' => $user['uid'], 'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT), 'oldgroup' => $user['usergroup'],
|
'uid' => $user['uid'], 'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT), 'oldgroup' => $user['usergroup'],
|
'oldadditionalgroups' => $user['additionalgroups'],
| 'oldadditionalgroups' => $db->escape_string($user['additionalgroups']),
|
'olddisplaygroup' => $user['displaygroup'], 'admin' => (int)$mybb->user['uid'], 'dateline' => TIME_NOW,
| 'olddisplaygroup' => $user['displaygroup'], 'admin' => (int)$mybb->user['uid'], 'dateline' => TIME_NOW,
|
Zeile 2588 | Zeile 2654 |
---|
$db->delete_query("forumsubscriptions", "uid = '{$user['uid']}'"); $db->delete_query("threadsubscriptions", "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";
| ++$banned_count; } $mybb->input['action'] = "inline_banned";
|
Zeile 2642 | Zeile 2707 |
---|
$page->output_footer(); break; case 'multidelete':
|
$page->output_footer(); break; case 'multidelete':
|
if($mybb->input['no'])
| if($mybb->get_input('no'))
|
{ admin_redirect("index.php?module=user-users".$vid_url); // User clicked on 'No }
| { admin_redirect("index.php?module=user-users".$vid_url); // User clicked on 'No }
|
Zeile 2778 | Zeile 2843 |
---|
$prune_array = array_merge_recursive($prune_array, $return_array); } }
|
$prune_array = array_merge_recursive($prune_array, $return_array); } }
|
| $plugins->run_hooks("admin_user_multiprune_threads", $prune_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);
|
// 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)
|
// 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'");
| foreach($prune_array['to_delete'] as $tid) { $db->delete_query("threads", "tid='$tid'");
|
Zeile 2806 | Zeile 2873 |
---|
// After deleting threads, rebuild the thread counters for the affected threads if(is_array($prune_array['thread_update']) && count($prune_array['thread_update']) > 0)
|
// 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']);
|
$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)
| // After updating thread counters, update the affected forum counters if(is_array($prune_array['forum_update']) && count($prune_array['forum_update']) > 0)
|
Zeile 2835 | Zeile 2902 |
---|
//log_admin_action(); my_unsetcookie("inlinemod_useracp"); // We've got our users, remove the cookie flash_message($lang->prune_complete, 'success');
|
//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); }
| admin_redirect("index.php?module=user-users".$vid_url); }
|
}
$page->output_header($lang->manage_users);
| }
$page->output_header($lang->manage_users);
|
Zeile 2929 | Zeile 2996 |
---|
"additionalgroups" => $additionalgroups, "displaygroup" => $mybb->get_input('displaygroup', MyBB::INPUT_INT) );
|
"additionalgroups" => $additionalgroups, "displaygroup" => $mybb->get_input('displaygroup', MyBB::INPUT_INT) );
|
| // Create an admin_user_multiusergroup hook array $hook_params = array( "selected" => &$selected, "update_array" => &$update_array );
$hook_params = $plugins->run_hooks("admin_user_multiusergroup", $hook_params);
|
// Do the usergroup update for all those selected // If the a selected user is a super admin, don't update that user
|
// Do the usergroup update for all those selected // If the a selected user is a super admin, don't update that user
|
| $users_to_update = array();
|
foreach($selected as $user) { if(!is_super_admin($user))
| foreach($selected as $user) { if(!is_super_admin($user))
|
Zeile 2941 | Zeile 3017 |
---|
}
$to_update_count = count($users_to_update);
|
}
$to_update_count = count($users_to_update);
|
if($to_update_count > 0 && is_array($users_to_update))
| if($to_update_count > 0)
|
{ // Update the users in the database $sql = implode(",", $users_to_update);
| { // Update the users in the database $sql = implode(",", $users_to_update);
|
Zeile 2953 | Zeile 3029 |
---|
my_unsetcookie("inlinemod_useracp"); flash_message($lang->success_mass_usergroups, 'success'); admin_redirect("index.php?module=user-users".$vid_url);
|
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!
| else { // They tried to edit super admins! Uh-oh!
|
Zeile 2974 | Zeile 3050 |
---|
if($errors) { $page->output_inline_error($errors);
|
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');
| // Display the usergroup options $form = new Form("index.php?module=user-users", "post"); echo $form->generate_hidden_field('action', 'inline_edit');
|
Zeile 2989 | Zeile 3065 |
---|
$options = array(); $query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title')); while($usergroup = $db->fetch_array($query))
|
$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']); }
| $options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']); $display_group_options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']); }
|
Zeile 3010 | Zeile 3086 |
---|
$form->end(); $page->output_footer(); break;
|
$form->end(); $page->output_footer(); break;
|
}
| }
|
}
if(!$mybb->input['action'])
| }
if(!$mybb->input['action'])
|
Zeile 3038 | Zeile 3114 |
---|
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 3068 | Zeile 3144 |
---|
if(isset($mybb->input['type'])) { $admin_view['view_type'] = $mybb->input['type'];
|
if(isset($mybb->input['type'])) { $admin_view['view_type'] = $mybb->input['type'];
|
}
| }
|
$results = build_users_view($admin_view);
if(!$results) { // If we came from the home page and clicked on the "Activate Users" link, send them back to here if($admin_session['data']['from'] == "home")
|
$results = build_users_view($admin_view);
if(!$results) { // If we came from the home page and clicked on the "Activate Users" link, send them back to here if($admin_session['data']['from'] == "home")
|
{
| {
|
flash_message($admin_session['data']['flash_message2']['message'], $admin_session['data']['flash_message2']['type']); update_admin_session('flash_message2', ''); update_admin_session('from', '');
| flash_message($admin_session['data']['flash_message2']['message'], $admin_session['data']['flash_message2']['type']); update_admin_session('flash_message2', ''); update_admin_session('from', '');
|
Zeile 3097 | Zeile 3173 |
---|
echo "<div style=\"display: inline; float: right;\">{$admin_view['popup']}</div><br />\n"; } $page->output_inline_error($errors);
|
echo "<div style=\"display: inline; float: right;\">{$admin_view['popup']}</div><br />\n"; } $page->output_inline_error($errors);
|
}
| }
|
echo $results;
| echo $results;
|
Zeile 3112 | Zeile 3188 |
---|
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';
| if($view['view_type'] != 'card') { $view['view_type'] = 'table';
|
Zeile 3121 | Zeile 3197 |
---|
$view_title = ''; if($view['title']) {
|
$view_title = ''; if($view['title']) {
|
$title_string = "view_title_{$view['vid']}";
if($lang->$title_string)
| if(isset($view['vid']))
|
{
|
{
|
$view['title'] = $lang->$title_string;
| $title_string = "view_title_{$view['vid']}";
if(isset($lang->$title_string)) { $view['title'] = $lang->$title_string; }
|
}
$view_title .= " (".htmlspecialchars_uni($view['title']).")";
|
}
$view_title .= " (".htmlspecialchars_uni($view['title']).")";
|
}
| }
|
// Build the URL to this view if(!isset($view['url']))
| // Build the URL to this view if(!isset($view['url']))
|
Zeile 3153 | Zeile 3232 |
---|
$view['conditions']['username'] = $mybb->input['username']; $view['url'] .= "&username=".urlencode(htmlspecialchars_uni($mybb->input['username'])); }
|
$view['conditions']['username'] = $mybb->input['username']; $view['url'] .= "&username=".urlencode(htmlspecialchars_uni($mybb->input['username'])); }
|
if($view['vid'])
| if(!empty($view['vid']))
|
{ $view['url'] .= "&vid={$view['vid']}"; }
| { $view['url'] .= "&vid={$view['vid']}"; }
|
Zeile 3161 | Zeile 3240 |
---|
{ // If this is a custom view we need to save everything ready to pass it on from page to page global $admin_session;
|
{ // 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(empty($mybb->input['search_id']))
|
{ $search_id = md5(random_str()); $admin_session['data']['user_views'][$search_id] = $view;
| { $search_id = md5(random_str()); $admin_session['data']['user_views'][$search_id] = $view;
|
Zeile 3217 | Zeile 3296 |
---|
// Build the search SQL for users
// List of valid LIKE search fields
|
// Build the search SQL for users
// List of valid LIKE search fields
|
$user_like_fields = array("username", "email", "website", "icq", "aim", "yahoo", "skype", "google", "signature", "usertitle");
| $user_like_fields = array("username", "email", "website", "icq", "skype", "google", "signature", "usertitle");
|
foreach($user_like_fields as $search_field) {
|
foreach($user_like_fields as $search_field) {
|
if(!empty($view['conditions'][$search_field]) && !$view['conditions'][$search_field.'_blank'])
| if(!empty($view['conditions'][$search_field]) && empty($view['conditions'][$search_field.'_blank']))
|
{ $search_sql .= " AND u.{$search_field} LIKE '%".$db->escape_string_like($view['conditions'][$search_field])."%'"; }
| { $search_sql .= " AND u.{$search_field} LIKE '%".$db->escape_string_like($view['conditions'][$search_field])."%'"; }
|
Zeile 3248 | Zeile 3327 |
---|
if(isset($view['conditions'][$search_field]) && ($view['conditions'][$search_field] || $view['conditions'][$search_field] === '0') && $view['conditions'][$direction_field]) { switch($view['conditions'][$direction_field])
|
if(isset($view['conditions'][$search_field]) && ($view['conditions'][$search_field] || $view['conditions'][$search_field] === '0') && $view['conditions'][$direction_field]) { switch($view['conditions'][$direction_field])
|
{
| {
|
case "greater_than": $direction = ">"; break;
| case "greater_than": $direction = ">"; break;
|
Zeile 3361 | Zeile 3440 |
---|
else { $userfield_sql .= ' AND '.$db->escape_string($column)." LIKE '%".$db->escape_string_like($input)."%'";
|
else { $userfield_sql .= ' AND '.$db->escape_string($column)." LIKE '%".$db->escape_string_like($input)."%'";
|
} } }
| } } }
|
if($userfield_sql != '1=1') {
| if($userfield_sql != '1=1') {
|
Zeile 3458 | Zeile 3537 |
---|
if($mybb->input['page']) { $start = ($mybb->input['page'] - 1) * $view['perpage'];
|
if($mybb->input['page']) { $start = ($mybb->input['page'] - 1) * $view['perpage'];
|
| $pages = ceil($num_results / $view['perpage']); if($mybb->input['page'] > $pages) { $start = 0; $mybb->input['page'] = 1; }
|
} else {
| } else {
|
Zeile 3531 | Zeile 3616 |
---|
$user['view']['additionalgroups'] = "<small>{$groups_list}</small>"; $user['view']['email'] = "<a href=\"mailto:".htmlspecialchars_uni($user['email'])."\">".htmlspecialchars_uni($user['email'])."</a>"; $user['view']['regdate'] = my_date('relative', $user['regdate']);
|
$user['view']['additionalgroups'] = "<small>{$groups_list}</small>"; $user['view']['email'] = "<a href=\"mailto:".htmlspecialchars_uni($user['email'])."\">".htmlspecialchars_uni($user['email'])."</a>"; $user['view']['regdate'] = my_date('relative', $user['regdate']);
|
$user['view']['lastactive'] = my_date('relative', $user['lastactive']);
| $last_seen = max(array($user['lastactive'], $user['lastvisit'])); if(!empty($last_seen)) { $user['view']['lastactive'] = my_date('relative', $last_seen); } else { $user['view']['lastactive'] = $lang->never; }
|
// Build popup menu $popup = new PopupMenu("user_{$user['uid']}", $lang->options);
| // Build popup menu $popup = new PopupMenu("user_{$user['uid']}", $lang->options);
|
Zeile 3594 | Zeile 3687 |
---|
$user['view']['warninglevel'] = get_colored_warning_level($warning_level); }
|
$user['view']['warninglevel'] = get_colored_warning_level($warning_level); }
|
if($user['avatar'] && !my_validate_url($user['avatar'])) { $user['avatar'] = "../{$user['avatar']}"; } if($view['view_type'] == "card") { $scaled_avatar = fetch_scaled_avatar($user, 80, 80); } else { $scaled_avatar = fetch_scaled_avatar($user, 34, 34); } if(!$user['avatar']) { 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']}\" />";
| if($view['view_type'] == "card") { $max_dimensions = '80x80'; } else { $max_dimensions = '34x34'; }
$avatar = format_avatar($user['avatar'], $user['avatardimensions'], $max_dimensions);
$user['view']['avatar'] = "<img src=\"".$avatar['image']."\" alt=\"\" {$avatar['width_height']} />";
|
// Convert IP's to readable $user['regip'] = my_inet_ntop($db->unescape_binary($user['regip']));
|
// Convert IP's to readable $user['regip'] = my_inet_ntop($db->unescape_binary($user['regip']));
|
$user['lastip'] = my_inet_ntop($db->unescape_binary($user['lastip']));
| $user['lastip'] = my_inet_ntop($db->unescape_binary($user['lastip']));
|
if($view['view_type'] == "card") { $users .= build_user_view_card($user, $view, $i);
| if($view['view_type'] == "card") { $users .= build_user_view_card($user, $view, $i);
|
Zeile 3642 | Zeile 3723 |
---|
}
if(!isset($view['table_id']))
|
}
if(!isset($view['table_id']))
|
{
| {
|
$view['table_id'] = "users_list"; }
| $view['table_id'] = "users_list"; }
|
Zeile 3655 | Zeile 3736 |
---|
if($view['view_type'] != "card") { $switch_view .= "<strong>{$lang->table_view}</strong> | <a href=\"{$switch_url}&type=card\" style=\"font-weight: normal;\">{$lang->card_view}</a>";
|
if($view['view_type'] != "card") { $switch_view .= "<strong>{$lang->table_view}</strong> | <a href=\"{$switch_url}&type=card\" style=\"font-weight: normal;\">{$lang->card_view}</a>";
|
}
| }
|
else { $switch_view .= "<a href=\"{$switch_url}&type=table\" style=\"font-weight: normal;\">{$lang->table_view}</a> | <strong>{$lang->card_view}</strong>"; } $switch_view .= "</div>";
|
else { $switch_view .= "<a href=\"{$switch_url}&type=table\" style=\"font-weight: normal;\">{$lang->table_view}</a> | <strong>{$lang->card_view}</strong>"; } $switch_view .= "</div>";
|
|
|
// Do we need to construct the pagination? if($num_results > $view['perpage']) {
| // Do we need to construct the pagination? if($num_results > $view['perpage']) {
|
Zeile 3669 | Zeile 3750 |
---|
$pagination = draw_admin_pagination($mybb->input['page'], $view['perpage'], $num_results, $view['url']."&type={$view_type}"); $search_class = "float_right"; $search_style = "";
|
$pagination = draw_admin_pagination($mybb->input['page'], $view['perpage'], $num_results, $view['url']."&type={$view_type}"); $search_class = "float_right"; $search_style = "";
|
}
| }
|
else { $search_class = '';
| else { $search_class = '';
|
Zeile 3699 | Zeile 3780 |
---|
} $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";
|
} $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'])
| if(!empty($view['popup']))
|
{ $built_view .= " <div style=\"display: inline\">{$view['popup']}</div>\n"; } $built_view .= "<script type=\"text/javascript\"> var form = $(\"#search_form\");
|
{ $built_view .= " <div style=\"display: inline\">{$view['popup']}</div>\n"; } $built_view .= "<script type=\"text/javascript\"> var form = $(\"#search_form\");
|
form.submit(function() {
| form.on('submit', function() {
|
var search = $('#search_keywords'); if(search.val() == '' || search.val() == '".addcslashes($lang->search_for_user, "'")."') {
|
var search = $('#search_keywords'); if(search.val() == '' || search.val() == '".addcslashes($lang->search_for_user, "'")."') {
|
search.focus();
| search.trigger('focus');
|
return false; } });
var search = $(\"#search_keywords\");
|
return false; } });
var search = $(\"#search_keywords\");
|
search.focus(function()
| search.on('focus', function()
|
{ var searched_focus = $(this); if(searched_focus.val() == '".addcslashes($lang->search_for_user, "'")."')
| { var searched_focus = $(this); if(searched_focus.val() == '".addcslashes($lang->search_for_user, "'")."')
|
Zeile 3723 | Zeile 3804 |
---|
searched_focus.removeClass(\"search_default\"); searched_focus.val(\"\"); }
|
searched_focus.removeClass(\"search_default\"); searched_focus.val(\"\"); }
|
});
search.blur(function()
| }).on('blur', function()
|
{ var searched_blur = $(this); if(searched_blur.val() == \"\")
| { var searched_blur = $(this); if(searched_blur.val() == \"\")
|
Zeile 3767 | Zeile 3846 |
---|
}
$built_view .= '
|
}
$built_view .= '
|
<script type="text/javascript" src="'.$mybb->settings['bburl'].'/jscripts/inline_moderation.js?ver=1800"></script>
| <script type="text/javascript" src="'.$mybb->settings['bburl'].'/jscripts/inline_moderation.js?ver=1821"></script>
|
<form action="index.php?module=user-users" method="post"> <input type="hidden" name="my_post_key" value="'.$mybb->post_code.'" /> <input type="hidden" name="action" value="inline_edit" />
| <form action="index.php?module=user-users" method="post"> <input type="hidden" name="my_post_key" value="'.$mybb->post_code.'" /> <input type="hidden" name="action" value="inline_edit" />
|
Zeile 3864 | Zeile 3943 |
---|
}
// And build the final card
|
}
// And build the final card
|
| $uname = ""; if(in_array('username', $view['fields'])) { $uname = $user['view']['username']; }
|
$card = "<fieldset id=\"uid_{$user['uid']}\" style=\"width: 47%; float: {$float};\">\n";
|
$card = "<fieldset id=\"uid_{$user['uid']}\" style=\"width: 47%; float: {$float};\">\n";
|
$card .= "<legend><input type=\"checkbox\" class=\"checkbox\" name=\"inlinemod_{$user['uid']}\" id=\"inlinemod_{$user['uid']}\" value=\"1\" onclick=\"$('#uid_{$user['uid']}').toggleClass('inline_selected');\" /> {$user['view']['username']}</legend>\n"; if($avatar)
| $card .= "<legend><input type=\"checkbox\" class=\"checkbox\" name=\"inlinemod_{$user['uid']}\" id=\"inlinemod_{$user['uid']}\" value=\"1\" onclick=\"$('#uid_{$user['uid']}').toggleClass('inline_selected');\" /> {$uname}</legend>\n"; if(!empty($avatar))
|
{ $card .= "<div class=\"user_avatar\">{$avatar}</div>\n"; }
|
{ $card .= "<div class=\"user_avatar\">{$avatar}</div>\n"; }
|
if($user_details)
| if(!empty($user_details))
|
{ $card .= "<div class=\"user_details\">".implode("<br />", $user_details)."</div>\n"; }
|
{ $card .= "<div class=\"user_details\">".implode("<br />", $user_details)."</div>\n"; }
|
if($controls)
| if(!empty($controls))
|
{ $card .= "<div class=\"float_right\" style=\"padding: 4px;\">{$controls}</div>\n"; }
| { $card .= "<div class=\"float_right\" style=\"padding: 4px;\">{$controls}</div>\n"; }
|
Zeile 3900 | Zeile 3984 |
---|
} $view_field = $user_view_fields[$field]; $field_options = array();
|
} $view_field = $user_view_fields[$field]; $field_options = array();
|
if($view_field['align'])
| if(($view_field['align']))
|
{ $field_options['class'] = "align_".$view_field['align']; }
|
{ $field_options['class'] = "align_".$view_field['align']; }
|
if($user['view'][$field])
| if(!empty($user['view'][$field]))
|
{ $value = $user['view'][$field]; } else { $value = $user[$field];
|
{ $value = $user['view'][$field]; } else { $value = $user[$field];
|
}
| }
|
if($field == "postnum")
|
if($field == "postnum")
|
{
| {
|
$value = my_number_format($user[$field]); } $table->construct_cell($value, $field_options);
| $value = my_number_format($user[$field]); } $table->construct_cell($value, $field_options);
|
Zeile 3923 | Zeile 4007 |
---|
$table->construct_cell("<input type=\"checkbox\" class=\"checkbox\" name=\"inlinemod_{$user['uid']}\" id=\"inlinemod_{$user['uid']}\" value=\"1\" onclick=\"$('#uid_{$user['uid']}').toggleClass('inline_selected');\" />");
$table->construct_row();
|
$table->construct_cell("<input type=\"checkbox\" class=\"checkbox\" name=\"inlinemod_{$user['uid']}\" id=\"inlinemod_{$user['uid']}\" value=\"1\" onclick=\"$('#uid_{$user['uid']}').toggleClass('inline_selected');\" />");
$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( "width" => $max_width, "height" => $max_height, );
if($user['avatar']) { if($user['avatardimensions']) { require_once MYBB_ROOT."inc/functions_image.php"; list($width, $height) = explode("|", $user['avatardimensions']); $scaled_dimensions = scale_image($width, $height, $max_width, $max_height); } }
return array("width" => $scaled_dimensions['width'], "height" => $scaled_dimensions['height']);
| |
}
/**
| }
/**
|
Zeile 3961 | Zeile 4018 |
---|
*/ function output_custom_profile_fields($fields, $values, &$form_container, &$form, $search=false) {
|
*/ function output_custom_profile_fields($fields, $values, &$form_container, &$form, $search=false) {
|
global $lang;
| global $lang, $mybb;
|
if(!is_array($fields))
|
if(!is_array($fields))
|
{ return; }
| { return; }
|
foreach($fields as $profile_field) { $profile_field['name'] = htmlspecialchars_uni($profile_field['name']); $profile_field['description'] = htmlspecialchars_uni($profile_field['description']);
|
foreach($fields as $profile_field) { $profile_field['name'] = htmlspecialchars_uni($profile_field['name']); $profile_field['description'] = htmlspecialchars_uni($profile_field['description']);
|
list($type, $options) = explode("\n", $profile_field['type'], 2);
| $type_data = explode("\n", $profile_field['type'], 2); $type = $type_data[0]; $options = !empty($type_data[1]) ? $type_data[1] : null;
|
$type = trim($type); $field_name = "fid{$profile_field['fid']}";
|
$type = trim($type); $field_name = "fid{$profile_field['fid']}";
|
| if(!isset($values[$field_name])) { $values[$field_name] = ''; } if(!isset($values[$field_name.'_blank'])) { $values[$field_name.'_blank'] = ''; }
|
switch($type) { case "multiselect":
|
switch($type) { case "multiselect":
|
| $selected_options = array();
|
if(!is_array($values[$field_name])) { $user_options = explode("\n", $values[$field_name]);
| if(!is_array($values[$field_name])) { $user_options = explode("\n", $values[$field_name]);
|
Zeile 3987 | Zeile 4058 |
---|
$user_options = $values[$field_name]; }
|
$user_options = $values[$field_name]; }
|
$selected_options = array();
|
|
foreach($user_options as $val) { $selected_options[$val] = htmlspecialchars_uni($val);
| foreach($user_options as $val) { $selected_options[$val] = htmlspecialchars_uni($val);
|
Zeile 4052 | Zeile 4123 |
---|
} break; case "checkbox":
|
} break; case "checkbox":
|
| $select_options = array();
|
if(!is_array($values[$field_name]))
|
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[$val] = $val; }
|
foreach($user_options as $val) { $selected_options[$val] = $val; }
|
$select_options = array();
|
|
if($search == true) { $select_options[''] = $lang->na;
| if($search == true) { $select_options[''] = $lang->na;
|
Zeile 4106 | Zeile 4180 |
---|
* @param array $input * @param DefaultForm $form */
|
* @param array $input * @param DefaultForm $form */
|
function user_search_conditions($input=array(), &$form)
| function user_search_conditions($input, &$form)
|
{ global $mybb, $db, $lang;
| { global $mybb, $db, $lang;
|
Zeile 4115 | Zeile 4189 |
---|
$input = $mybb->input; }
|
$input = $mybb->input; }
|
if(!is_array($input['conditions']))
| if(empty($input['conditions']))
|
{
|
{
|
$input['conditions'] = my_unserialize($input['conditions']);
| $input['conditions'] = array(); }
if(!is_array($input['conditions'])) { $input['conditions'] = (array)my_unserialize($input['conditions']); }
$array = array('username', 'email', 'usergroup', 'website', 'website_blank', 'icq', 'icq_blank', 'skype', 'skype_blank', 'google', 'google_blank', 'signature', 'signature_blank', 'usertitle', 'usertitle_blank', 'postnum_dir', 'postnum', 'threadnum_dir', 'threadnum', 'regdate', 'regip', 'lastip', 'postip'); foreach($array as $condition) { if(!isset($input['conditions'][$condition])) { $input['conditions'][$condition] = ''; } }
if(empty($input['profile_fields'])) { $input['profile_fields'] = array();
|
}
if(!is_array($input['profile_fields']))
|
}
if(!is_array($input['profile_fields']))
|
{ $input['profile_fields'] = my_unserialize($input['profile_fields']);
| { $input['profile_fields'] = (array)my_unserialize($input['profile_fields']); }
if(empty($input['fields'])) { $input['fields'] = array();
|
}
if(!is_array($input['fields'])) {
|
}
if(!is_array($input['fields'])) {
|
$input['fields'] = my_unserialize($input['fields']);
| $input['fields'] = (array)my_unserialize($input['fields']);
|
}
$form_container = new FormContainer($lang->find_users_where);
| }
$form_container = new FormContainer($lang->find_users_where);
|
Zeile 4139 | Zeile 4237 |
---|
while($usergroup = $db->fetch_array($query)) { $options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);
|
while($usergroup = $db->fetch_array($query)) { $options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);
|
}
| }
|
$form_container->output_row($lang->is_member_of_groups, $lang->additional_user_groups_desc, $form->generate_select_box('conditions[usergroup][]', $options, $input['conditions']['usergroup'], array('id' => 'usergroups', 'multiple' => true, 'size' => 5)), 'usergroups');
$form_container->output_row($lang->website_contains, "", $form->generate_text_box('conditions[website]', $input['conditions']['website'], array('id' => 'website'))." {$lang->or} ".$form->generate_check_box('conditions[website_blank]', 1, $lang->is_not_blank, array('id' => 'website_blank', 'checked' => $input['conditions']['website_blank'])), 'website'); $form_container->output_row($lang->icq_number_contains, "", $form->generate_text_box('conditions[icq]', $input['conditions']['icq'], array('id' => 'icq'))." {$lang->or} ".$form->generate_check_box('conditions[icq_blank]', 1, $lang->is_not_blank, array('id' => 'icq_blank', 'checked' => $input['conditions']['icq_blank'])), 'icq');
|
$form_container->output_row($lang->is_member_of_groups, $lang->additional_user_groups_desc, $form->generate_select_box('conditions[usergroup][]', $options, $input['conditions']['usergroup'], array('id' => 'usergroups', 'multiple' => true, 'size' => 5)), 'usergroups');
$form_container->output_row($lang->website_contains, "", $form->generate_text_box('conditions[website]', $input['conditions']['website'], array('id' => 'website'))." {$lang->or} ".$form->generate_check_box('conditions[website_blank]', 1, $lang->is_not_blank, array('id' => 'website_blank', 'checked' => $input['conditions']['website_blank'])), 'website'); $form_container->output_row($lang->icq_number_contains, "", $form->generate_text_box('conditions[icq]', $input['conditions']['icq'], array('id' => 'icq'))." {$lang->or} ".$form->generate_check_box('conditions[icq_blank]', 1, $lang->is_not_blank, array('id' => 'icq_blank', 'checked' => $input['conditions']['icq_blank'])), 'icq');
|
$form_container->output_row($lang->aim_handle_contains, "", $form->generate_text_box('conditions[aim]', $input['conditions']['aim'], array('id' => 'aim'))." {$lang->or} ".$form->generate_check_box('conditions[aim_blank]', 1, $lang->is_not_blank, array('id' => 'aim_blank', 'checked' => $input['conditions']['aim_blank'])), 'aim'); $form_container->output_row($lang->yahoo_contains, "", $form->generate_text_box('conditions[yahoo]', $input['conditions']['yahoo'], array('id' => 'yahoo'))." {$lang->or} ".$form->generate_check_box('conditions[yahoo_blank]', 1, $lang->is_not_blank, array('id' => 'yahoo_blank', 'checked' => $input['conditions']['yahoo_blank'])), 'yahoo');
| |
$form_container->output_row($lang->skype_contains, "", $form->generate_text_box('conditions[skype]', $input['conditions']['skype'], array('id' => 'skype'))." {$lang->or} ".$form->generate_check_box('conditions[skype_blank]', 1, $lang->is_not_blank, array('id' => 'skype_blank', 'checked' => $input['conditions']['skype_blank'])), 'skype'); $form_container->output_row($lang->google_contains, "", $form->generate_text_box('conditions[google]', $input['conditions']['google'], array('id' => 'google'))." {$lang->or} ".$form->generate_check_box('conditions[google_blank]', 1, $lang->is_not_blank, array('id' => 'google_blank', 'checked' => $input['conditions']['google_blank'])), 'google'); $form_container->output_row($lang->signature_contains, "", $form->generate_text_box('conditions[signature]', $input['conditions']['signature'], array('id' => 'signature'))." {$lang->or} ".$form->generate_check_box('conditions[signature_blank]', 1, $lang->is_not_blank, array('id' => 'signature_blank', 'checked' => $input['conditions']['signature_blank'])), 'signature');
| $form_container->output_row($lang->skype_contains, "", $form->generate_text_box('conditions[skype]', $input['conditions']['skype'], array('id' => 'skype'))." {$lang->or} ".$form->generate_check_box('conditions[skype_blank]', 1, $lang->is_not_blank, array('id' => 'skype_blank', 'checked' => $input['conditions']['skype_blank'])), 'skype'); $form_container->output_row($lang->google_contains, "", $form->generate_text_box('conditions[google]', $input['conditions']['google'], array('id' => 'google'))." {$lang->or} ".$form->generate_check_box('conditions[google_blank]', 1, $lang->is_not_blank, array('id' => 'google_blank', 'checked' => $input['conditions']['google_blank'])), 'google'); $form_container->output_row($lang->signature_contains, "", $form->generate_text_box('conditions[signature]', $input['conditions']['signature'], array('id' => 'signature'))." {$lang->or} ".$form->generate_check_box('conditions[signature_blank]', 1, $lang->is_not_blank, array('id' => 'signature_blank', 'checked' => $input['conditions']['signature_blank'])), 'signature');
|
Zeile 4171 | Zeile 4267 |
---|
// Fetch custom profile fields $query = $db->simple_select("profilefields", "*", "", array('order_by' => 'disporder'));
|
// Fetch custom profile fields $query = $db->simple_select("profilefields", "*", "", array('order_by' => 'disporder'));
|
$profile_fields = array();
| $profile_fields = array( 'required' => array(), 'optional' => array(), );
|
while($profile_field = $db->fetch_array($query)) { if($profile_field['required'] == 1)
|
while($profile_field = $db->fetch_array($query)) { if($profile_field['required'] == 1)
|
{
| {
|
$profile_fields['required'][] = $profile_field;
|
$profile_fields['required'][] = $profile_field;
|
}
| }
|
else { $profile_fields['optional'][] = $profile_field;
|
else { $profile_fields['optional'][] = $profile_field;
|
} }
| } }
|
output_custom_profile_fields($profile_fields['required'], $input['profile_fields'], $form_container, $form, true); output_custom_profile_fields($profile_fields['optional'], $input['profile_fields'], $form_container, $form, true);
| output_custom_profile_fields($profile_fields['required'], $input['profile_fields'], $form_container, $form, true); output_custom_profile_fields($profile_fields['optional'], $input['profile_fields'], $form_container, $form, true);
|
Zeile 4211 | Zeile 4310 |
---|
results: function (data, page) { // parse the results into the format expected by Select2. // since we are using custom formatting functions we do not need to alter remote JSON data return {results: data};
|
results: function (data, page) { // parse the results into the format expected by Select2. // since we are using custom formatting functions we do not need to alter remote JSON data return {results: data};
|
}
| }
|
}, initSelection: function(element, callback) { var query = $(element).val();
| }, initSelection: function(element, callback) { var query = $(element).val();
|
Zeile 4227 | Zeile 4326 |
---|
}); // --> </script>';
|
}); // --> </script>';
|
| }
/** * @param int $source_uid * @param int $destination_uid */ function merge_thread_ratings($source_uid, $destination_uid) { global $db;
$source_ratings = $dest_threads = $delete_list = $decrement_list = array();
// Get all thread ratings from both accounts $query = $db->simple_select('threadratings', 'tid, uid, rid, rating', "uid IN ({$destination_uid}, {$source_uid})"); while($rating = $db->fetch_array($query)) { if($rating['uid'] == $destination_uid) { $dest_threads[] = $rating['tid']; } else { $source_ratings[] = $rating; } }
// If there are duplicates, mark them for deletion foreach($source_ratings as $rating) { if(in_array($rating['tid'], $dest_threads)) { $delete_list[] = $rating['rid']; $decrement_list[$rating['tid']][] = (int) $rating['rating']; } }
// Attribute all of the source user's ratings to the destination user $db->update_query("threadratings", array("uid" => $destination_uid), "uid='{$source_uid}'");
// Remove ratings previously given to recently acquired threads $query = $db->query(" SELECT tr.rid, tr.rating, t.tid FROM {$db->table_prefix}threadratings tr LEFT JOIN {$db->table_prefix}threads t ON (t.tid=tr.tid) WHERE tr.uid='{$destination_uid}' AND tr.uid=t.uid "); while($rating = $db->fetch_array($query)) { $delete_list[] = $rating['rid']; $decrement_list[$rating['tid']][] = (int) $rating['rating']; }
// Delete the duplicate/disallowed ratings if(!empty($delete_list)) { $imp = implode(',', $delete_list); $db->delete_query('threadratings', "rid IN ({$imp})"); }
// Correct the thread rating counters if(!empty($decrement_list)) { foreach($decrement_list as $tid => $ratings) { if(is_array($ratings)) { $db->update_query('threads', array('numratings' => 'numratings-'.count($ratings), 'totalratings' => 'totalratings-'.array_sum($ratings)), "tid='{$tid}'", 1, true); } } }
|
}
| }
|