Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: users.php 4389 2009-06-26 04:29:32Z RyanGordon $
| * $Id: users.php 4657 2009-12-24 20:31:25Z RyanGordon $
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 159 | Zeile 159 |
---|
// We've selected a new avatar for this user! if($mybb->input['avatar']) {
|
// We've selected a new avatar for this user! if($mybb->input['avatar']) {
|
| $mybb->input['avatar'] = str_replace(array("./", ".."), "", $mybb->input['avatar']);
|
if(file_exists("../".$mybb->settings['avatardir']."/".$mybb->input['avatar'])) { $dimensions = @getimagesize("../".$mybb->settings['avatardir']."/".$mybb->input['avatar']); $updated_avatar = array( "avatar" => $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['avatar']), "avatardimensions" => "{$dimensions[0]}|{$dimensions[1]}",
|
if(file_exists("../".$mybb->settings['avatardir']."/".$mybb->input['avatar'])) { $dimensions = @getimagesize("../".$mybb->settings['avatardir']."/".$mybb->input['avatar']); $updated_avatar = array( "avatar" => $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['avatar']), "avatardimensions" => "{$dimensions[0]}|{$dimensions[1]}",
|
| |
"avatartype" => "gallery" );
| "avatartype" => "gallery" );
|
Zeile 371 | Zeile 372 |
---|
if($user['usergroup'] == 5) { $updated_user['usergroup'] = 2;
|
if($user['usergroup'] == 5) { $updated_user['usergroup'] = 2;
|
}
| }
|
$db->update_query("users", $updated_user, "uid='{$user['uid']}'");
| $db->update_query("users", $updated_user, "uid='{$user['uid']}'");
|
Zeile 381 | Zeile 382 |
---|
log_admin_action($user['uid'], $user['username']);
if($mybb->input['from'] == "home")
|
log_admin_action($user['uid'], $user['username']);
if($mybb->input['from'] == "home")
|
{ if($user['coppauser']) {
| { if($user['coppauser']) {
|
$message = $lang->success_coppa_activated;
|
$message = $lang->success_coppa_activated;
|
} else
| } else
|
{ $message = $lang->success_activated; }
| { $message = $lang->success_activated; }
|
Zeile 398 | Zeile 399 |
---|
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');
|
}
| }
|
} if($admin_session['data']['last_users_url'])
| } if($admin_session['data']['last_users_url'])
|
Zeile 411 | Zeile 412 |
---|
update_admin_session('last_users_url', ''); if($mybb->input['from'] == "home")
|
update_admin_session('last_users_url', ''); if($mybb->input['from'] == "home")
|
{
| {
|
update_admin_session('from', 'home'); }
|
update_admin_session('from', 'home'); }
|
}
| }
|
else { $url = "index.php?module=user/users&action=edit&uid={$user['uid']}";
| else { $url = "index.php?module=user/users&action=edit&uid={$user['uid']}";
|
Zeile 426 | Zeile 427 |
---|
if($mybb->input['action'] == "add") { $plugins->run_hooks("admin_user_users_add");
|
if($mybb->input['action'] == "add") { $plugins->run_hooks("admin_user_users_add");
|
if($mybb->request_method == "post") { // Determine the usergroup stuff if(is_array($mybb->input['additionalgroups'])) { foreach($mybb->input['additionalgroups'] as $gid) {
| if($mybb->request_method == "post") { // Determine the usergroup stuff if(is_array($mybb->input['additionalgroups'])) { foreach($mybb->input['additionalgroups'] as $key => $gid) {
|
if($gid == $mybb->input['usergroup']) {
|
if($gid == $mybb->input['usergroup']) {
|
unset($mybb->input['additionalgroups'][$gid]);
| unset($mybb->input['additionalgroups'][$key]);
|
} } $additionalgroups = implode(",", $mybb->input['additionalgroups']);
| } } $additionalgroups = implode(",", $mybb->input['additionalgroups']);
|
Zeile 445 | Zeile 446 |
---|
{ $additionalgroups = ''; }
|
{ $additionalgroups = ''; }
|
|
|
// Set up user handler. require_once MYBB_ROOT."inc/datahandlers/user.php"; $userhandler = new UserDataHandler('insert');
| // Set up user handler. require_once MYBB_ROOT."inc/datahandlers/user.php"; $userhandler = new UserDataHandler('insert');
|
Zeile 456 | Zeile 457 |
---|
"username" => $mybb->input['username'], "password" => $mybb->input['password'], "password2" => $mybb->input['confirm_password'],
|
"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'], "additionalgroups" => $additionalgroups, "displaygroup" => $mybb->input['displaygroup'], "profile_fields" => $mybb->input['profile_fields'], "profile_fields_editable" => true, );
| "email" => $mybb->input['email'], "email2" => $mybb->input['email'], "usergroup" => $mybb->input['usergroup'], "additionalgroups" => $additionalgroups, "displaygroup" => $mybb->input['displaygroup'], "profile_fields" => $mybb->input['profile_fields'], "profile_fields_editable" => true, );
|
// Set the data of the user in the datahandler. $userhandler->set_data($new_user); $errors = '';
|
// Set the data of the user in the datahandler. $userhandler->set_data($new_user); $errors = '';
|
|
|
// Validate the user and get any errors that might have occurred. if(!$userhandler->validate_user()) {
| // Validate the user and get any errors that might have occurred. if(!$userhandler->validate_user()) {
|
Zeile 493 | Zeile 494 |
---|
while($profile_field = $db->fetch_array($query)) { $profile_fields['required'][] = $profile_field;
|
while($profile_field = $db->fetch_array($query)) { $profile_fields['required'][] = $profile_field;
|
}
| }
|
$page->add_breadcrumb_item($lang->create_user); $page->output_header($lang->create_user);
| $page->add_breadcrumb_item($lang->create_user); $page->output_header($lang->create_user);
|
Zeile 568 | Zeile 569 |
---|
// Determine the usergroup stuff if(is_array($mybb->input['additionalgroups'])) {
|
// Determine the usergroup stuff if(is_array($mybb->input['additionalgroups'])) {
|
foreach($mybb->input['additionalgroups'] as $gid)
| foreach($mybb->input['additionalgroups'] as $key => $gid)
|
{ if($gid == $mybb->input['usergroup']) {
|
{ if($gid == $mybb->input['usergroup']) {
|
unset($mybb->input['additionalgroups'][$gid]);
| unset($mybb->input['additionalgroups'][$key]);
|
} } $additionalgroups = implode(",", $mybb->input['additionalgroups']);
| } } $additionalgroups = implode(",", $mybb->input['additionalgroups']);
|
Zeile 648 | Zeile 649 |
---|
if($mybb->settings['usertppoptions']) { $updated_user['options']['tpp'] = intval($mybb->input['tpp']);
|
if($mybb->settings['usertppoptions']) { $updated_user['options']['tpp'] = intval($mybb->input['tpp']);
|
}
| }
|
if($mybb->settings['userpppoptions']) { $updated_user['options']['ppp'] = intval($mybb->input['ppp']);
| if($mybb->settings['userpppoptions']) { $updated_user['options']['ppp'] = intval($mybb->input['ppp']);
|
Zeile 799 | Zeile 800 |
---|
// 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);
|
}
| }
|
// Fetch custom profile fields $query = $db->simple_select("profilefields", "*", "", array('order_by' => 'disporder')); while($profile_field = $db->fetch_array($query)) { if($profile_field['required'] == 1)
|
// Fetch custom profile fields $query = $db->simple_select("profilefields", "*", "", array('order_by' => 'disporder')); while($profile_field = $db->fetch_array($query)) { if($profile_field['required'] == 1)
|
{
| {
|
$profile_fields['required'][] = $profile_field; } else
| $profile_fields['required'][] = $profile_field; } else
|
Zeile 814 | Zeile 815 |
---|
$profile_fields['optional'][] = $profile_field; } }
|
$profile_fields['optional'][] = $profile_field; } }
|
|
|
$page->add_breadcrumb_item($lang->edit_user.": ".htmlspecialchars_uni($user['username'])); $page->output_header($lang->edit_user);
| $page->add_breadcrumb_item($lang->edit_user.": ".htmlspecialchars_uni($user['username'])); $page->output_header($lang->edit_user);
|
Zeile 822 | Zeile 823 |
---|
'title' => $lang->edit_user, 'description' => $lang->edit_user_desc );
|
'title' => $lang->edit_user, 'description' => $lang->edit_user_desc );
|
|
|
$form = new Form("index.php?module=user/users&action=edit&uid={$user['uid']}", "post", "", 1); echo "<script type=\"text/javascript\">\n function submitUserForm() { $('tab_overview').up('FORM').submit(); }</script>\n";
| $form = new Form("index.php?module=user/users&action=edit&uid={$user['uid']}", "post", "", 1); echo "<script type=\"text/javascript\">\n function submitUserForm() { $('tab_overview').up('FORM').submit(); }</script>\n";
|
Zeile 830 | Zeile 831 |
---|
// 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); }
|
Zeile 848 | Zeile 849 |
---|
"avatar" => $lang->avatar ); $page->output_tab_control($tabs);
|
"avatar" => $lang->avatar ); $page->output_tab_control($tabs);
|
|
|
// // OVERVIEW //
| // // OVERVIEW //
|
Zeile 860 | Zeile 861 |
---|
// Avatar $avatar_dimensions = explode("|", $user['avatardimensions']); if($user['avatar'])
|
// Avatar $avatar_dimensions = explode("|", $user['avatardimensions']); if($user['avatar'])
|
{
| {
|
if($user['avatardimensions']) { require_once MYBB_ROOT."inc/functions_image.php";
| if($user['avatardimensions']) { require_once MYBB_ROOT."inc/functions_image.php";
|
Zeile 868 | Zeile 869 |
---|
$scaled_dimensions = scale_image($width, $height, 120, 120); } else
|
$scaled_dimensions = scale_image($width, $height, 120, 120); } else
|
{
| {
|
$scaled_dimensions = array( "width" => 120, "height" => 120
| $scaled_dimensions = array( "width" => 120, "height" => 120
|
Zeile 878 | Zeile 879 |
---|
{ $user['avatar'] = "../{$user['avatar']}\n"; }
|
{ $user['avatar'] = "../{$user['avatar']}\n"; }
|
} else
| } else
|
{ $user['avatar'] = "styles/{$page->style}/images/default_avatar.gif"; $scaled_dimensions = array(
| { $user['avatar'] = "styles/{$page->style}/images/default_avatar.gif"; $scaled_dimensions = array(
|
Zeile 891 | Zeile 892 |
---|
if($user['lastactive']) { $last_active = my_date($mybb->settings['dateformat'], $user['lastactive']).", ".my_date($mybb->settings['timeformat'], $user['lastactive']);
|
if($user['lastactive']) { $last_active = my_date($mybb->settings['dateformat'], $user['lastactive']).", ".my_date($mybb->settings['timeformat'], $user['lastactive']);
|
} else {
| } else {
|
$last_active = $lang->never; } $reg_date = my_date($mybb->settings['dateformat'], $user['regdate']).", ".my_date($mybb->settings['timeformat'], $user['regdate']);
| $last_active = $lang->never; } $reg_date = my_date($mybb->settings['dateformat'], $user['regdate']).", ".my_date($mybb->settings['timeformat'], $user['regdate']);
|
Zeile 1379 | Zeile 1380 |
---|
'title' => $lang->show_ip_addresses, 'link' => "index.php?module=user/users&action=ipaddresses&uid={$mybb->input['uid']}", 'description' => $lang->show_ip_addresses_desc
|
'title' => $lang->show_ip_addresses, 'link' => "index.php?module=user/users&action=ipaddresses&uid={$mybb->input['uid']}", 'description' => $lang->show_ip_addresses_desc
|
);
| );
|
$page->output_nav_tabs($sub_tabs, 'ipaddresses');
|
$page->output_nav_tabs($sub_tabs, 'ipaddresses');
|
|
|
$query = $db->simple_select("users", "uid, regip, username, lastip", "uid='{$mybb->input['uid']}'", array('limit' => 1)); $user = $db->fetch_array($query);
| $query = $db->simple_select("users", "uid, regip, username, lastip", "uid='{$mybb->input['uid']}'", array('limit' => 1)); $user = $db->fetch_array($query);
|
Zeile 1390 | Zeile 1391 |
---|
log_admin_action($user['uid'], $user['username']); $table = new Table;
|
log_admin_action($user['uid'], $user['username']); $table = new Table;
|
|
|
$table->construct_header($lang->ip_address); $table->construct_header($lang->controls, array('width' => 200, 'class' => "align_center"));
| $table->construct_header($lang->ip_address); $table->construct_header($lang->controls, array('width' => 200, 'class' => "align_center"));
|
Zeile 1409 | Zeile 1410 |
---|
$controls = $popup->fetch(); } $table->construct_cell("<strong>{$lang->last_known_ip}:</strong> {$user['lastip']}");
|
$controls = $popup->fetch(); } $table->construct_cell("<strong>{$lang->last_known_ip}:</strong> {$user['lastip']}");
|
$table->construct_cell($controls, array('class' => "align_center")); $table->construct_row();
| $table->construct_cell($controls, array('class' => "align_center")); $table->construct_row();
|
if(empty($user['regip'])) { $user['regip'] = $lang->unknown;
| if(empty($user['regip'])) { $user['regip'] = $lang->unknown;
|
Zeile 1472 | Zeile 1473 |
---|
}
if($source_user['uid'] == $destination_user['uid'])
|
}
if($source_user['uid'] == $destination_user['uid'])
|
{
| {
|
$errors[] = $lang->error_cannot_merge_same_account; }
| $errors[] = $lang->error_cannot_merge_same_account; }
|
Zeile 1523 | Zeile 1524 |
---|
// Calculate new reputation $query = $db->simple_select("reputation", "SUM(reputation) as total_rep", "uid='{$destination_user['uid']}'"); $total_reputation = $db->fetch_field($query, "total_rep");
|
// Calculate new reputation $query = $db->simple_select("reputation", "SUM(reputation) as total_rep", "uid='{$destination_user['uid']}'"); $total_reputation = $db->fetch_field($query, "total_rep");
|
| // No reputation? if(!$total_reputation) { $total_reputation = '0'; }
|
$db->update_query("users", array('reputation' => $total_reputation), "uid='{$destination_user['uid']}'"); // Additional updates for non-uid fields
| $db->update_query("users", array('reputation' => $total_reputation), "uid='{$destination_user['uid']}'"); // Additional updates for non-uid fields
|
Zeile 1550 | Zeile 1557 |
---|
// Delete the old user $db->delete_query("users", "uid='{$source_user['uid']}'"); $db->delete_query("banned", "uid='{$source_user['uid']}'");
|
// Delete the old user $db->delete_query("users", "uid='{$source_user['uid']}'"); $db->delete_query("banned", "uid='{$source_user['uid']}'");
|
| // Get a list of forums where post count doesn't apply $fids = array(); $query = $db->simple_select("forums", "fid", "usepostcounts=0"); while($fid = $db->fetch_field($query, "fid")) { $fids[] = $fid; } $fids_not_in = ''; if(!empty($fids)) { $fids_not_in = "AND fid NOT IN(".implode(',', $fids).")"; }
|
// Update user post count
|
// Update user post count
|
$query = $db->simple_select("posts", "COUNT(*) AS postnum", "uid='".$destination_user['uid']."'");
| $query = $db->simple_select("posts", "COUNT(*) AS postnum", "uid='".$destination_user['uid']."' {$fids_not_in}");
|
$num = $db->fetch_array($query); $updated_count = array( "postnum" => $num['postnum'] ); $db->update_query("users", $updated_count, "uid='{$destination_user['uid']}'");
|
$num = $db->fetch_array($query); $updated_count = array( "postnum" => $num['postnum'] ); $db->update_query("users", $updated_count, "uid='{$destination_user['uid']}'");
|
| // Use the earliest registration date if($destination_user['regdate'] > $source_user['regdate']) { $db->update_query("users", array('regdate' => $source_user['regdate']), "uid='{$destination_user['uid']}'"); }
|
update_stats(array('numusers' => '-1'));
| update_stats(array('numusers' => '-1'));
|
Zeile 1615 | Zeile 1642 |
---|
if($mybb->request_method == "post" || $mybb->input['results'] == 1) { // Build view options from incoming search options
|
if($mybb->request_method == "post" || $mybb->input['results'] == 1) { // Build view options from incoming search options
|
if($mybb->input['vid']) { $query = $db->simple_select("adminviews", "*", "vid='".intval($mybb->input['vid'])."'"); $admin_view = $db->fetch_array($query); // View does not exist or this view is private and does not belong to the current user if(!$admin_view['vid'] || ($admin_view['visibility'] == 1 && $admin_view['uid'] != $mybb->user['uid'])) { unset($admin_view); } }
| if($mybb->input['vid']) { $query = $db->simple_select("adminviews", "*", "vid='".intval($mybb->input['vid'])."'"); $admin_view = $db->fetch_array($query); // View does not exist or this view is private and does not belong to the current user if(!$admin_view['vid'] || ($admin_view['visibility'] == 1 && $admin_view['uid'] != $mybb->user['uid'])) { unset($admin_view); } }
|
if($mybb->input['search_id'] && $admin_session['data']['user_views'][$mybb->input['search_id']]) {
| if($mybb->input['search_id'] && $admin_session['data']['user_views'][$mybb->input['search_id']]) {
|
Zeile 2105 | Zeile 2132 |
---|
switch($view['sortby']) {
|
switch($view['sortby']) {
|
case "numposts": $view['sortby'] = "postnum"; break;
| |
case "regdate": case "lastactive": case "postnum": case "reputation":
|
case "regdate": case "lastactive": case "postnum": case "reputation":
|
| $view['sortby'] = $db->escape_string($view['sortby']); break; case "numposts": $view['sortby'] = "postnum"; break;
|
case "warninglevel":
|
case "warninglevel":
|
| $view['sortby'] = "warningpoints";
|
break; default: $view['sortby'] = "username";
| break; default: $view['sortby'] = "username";
|
Zeile 2543 | Zeile 2573 |
---|
foreach($select_options as $val) { $val = trim($val);
|
foreach($select_options as $val) { $val = trim($val);
|
$code .= $form->generate_check_box("profile_fields[{$field_name}][]", $val, $val, array('id' => "profile_field_{$field_name}", 'checked' => ($val == $values[$field_name] ? true : false)))."<br />";
| $code .= $form->generate_check_box("profile_fields[{$field_name}][]", $val, $val, array('id' => "profile_field_{$field_name}", 'checked' => ($val == $selected_options[$val] ? true : false)))."<br />";
|
} break; case "textarea":
| } break; case "textarea":
|