Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: users.php 5161 2010-08-01 20:45:07Z RyanGordon $
| * $Id: users.php 5483 2011-07-06 00:57:17Z huji $
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 1598 | Zeile 1598 |
---|
$db->delete_query("userfields", "ufid='{$user['uid']}'"); $db->delete_query("privatemessages", "uid='{$user['uid']}'"); $db->delete_query("events", "uid='{$user['uid']}'");
|
$db->delete_query("userfields", "ufid='{$user['uid']}'"); $db->delete_query("privatemessages", "uid='{$user['uid']}'"); $db->delete_query("events", "uid='{$user['uid']}'");
|
$db->delete_query("moderators", "id='{$user['uid']}' AND isgroup = '0'");
| |
$db->delete_query("forumsubscriptions", "uid='{$user['uid']}'"); $db->delete_query("threadsubscriptions", "uid='{$user['uid']}'"); $db->delete_query("sessions", "uid='{$user['uid']}'");
| $db->delete_query("forumsubscriptions", "uid='{$user['uid']}'"); $db->delete_query("threadsubscriptions", "uid='{$user['uid']}'"); $db->delete_query("sessions", "uid='{$user['uid']}'");
|
Zeile 1612 | Zeile 1611 |
---|
// Update forum stats update_stats(array('numusers' => '-1'));
|
// Update forum stats update_stats(array('numusers' => '-1'));
|
| // Did this user have an uploaded avatar? if($user['avatartype'] == "upload") { // Removes the ./ at the beginning the timestamp on the end... @unlink("../".substr($user['avatar'], 2, -20)); }
// Was this user a moderator? if(is_moderator($user['uid'])) { $db->delete_query("moderators", "id='{$user['uid']}' AND isgroup = '0'"); $cache->update_moderators(); }
|
$plugins->run_hooks("admin_user_users_delete_commit");
// Log admin action log_admin_action($user['uid'], $user['username']);
|
$plugins->run_hooks("admin_user_users_delete_commit");
// Log admin action 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 1711 | Zeile 1723 |
---|
$table->construct_row();
if(empty($user['regip']))
|
$table->construct_row();
if(empty($user['regip']))
|
{
| {
|
$user['regip'] = $lang->unknown; $controls = ''; }
| $user['regip'] = $lang->unknown; $controls = ''; }
|
Zeile 1769 | Zeile 1781 |
---|
if(!$destination_user['uid']) { $errors[] = $lang->error_invalid_user_destination;
|
if(!$destination_user['uid']) { $errors[] = $lang->error_invalid_user_destination;
|
| } // 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(!is_super_admin($mybb->user['uid']) && (is_super_admin($source_user['uid']) || is_super_admin($destination_user['uid']))) { flash_message($lang->error_no_perms_super_admin, 'error'); admin_redirect("index.php?module=user-users");
|
}
if($source_user['uid'] == $destination_user['uid'])
| }
if($source_user['uid'] == $destination_user['uid'])
|
Zeile 1876 | Zeile 1895 |
---|
$db->update_query("threads", $last_poster, "lastposteruid='{$source_user['uid']}'"); $edit_uid = array( "edituid" => $destination_user['uid']
|
$db->update_query("threads", $last_poster, "lastposteruid='{$source_user['uid']}'"); $edit_uid = array( "edituid" => $destination_user['uid']
|
);
| );
|
$db->update_query("posts", $edit_uid, "edituid='{$source_user['uid']}'");
$from_uid = array(
| $db->update_query("posts", $edit_uid, "edituid='{$source_user['uid']}'");
$from_uid = array(
|
Zeile 1938 | Zeile 1957 |
---|
$page->output_header($lang->merge_users); $page->output_nav_tabs($sub_tabs, 'merge_users');
|
$page->output_header($lang->merge_users); $page->output_nav_tabs($sub_tabs, 'merge_users');
|
// If we have any error messages, show them if($errors) { $page->output_inline_error($errors);
| // If we have any error messages, show them if($errors) { $page->output_inline_error($errors);
|
}
$form = new Form("index.php?module=user-users&action=merge", "post");
| }
$form = new Form("index.php?module=user-users&action=merge", "post");
|
Zeile 2008 | Zeile 2027 |
---|
}
// Override specific parts of the view
|
}
// Override specific parts of the view
|
unset($admin_view['vid']);
| unset($admin_view['vid']);
|
if($mybb->input['type']) { $admin_view['view_type'] = $mybb->input['type'];
|
if($mybb->input['type']) { $admin_view['view_type'] = $mybb->input['type'];
|
}
| }
|
if($mybb->input['conditions']) {
| if($mybb->input['conditions']) {
|
Zeile 2021 | Zeile 2040 |
---|
} if($mybb->input['sortby'])
|
} if($mybb->input['sortby'])
|
{
| {
|
$admin_view['sortby'] = $mybb->input['sortby']; } if($mybb->input['perpage']) { $admin_view['perpage'] = $mybb->input['perpage'];
|
$admin_view['sortby'] = $mybb->input['sortby']; } if($mybb->input['perpage']) { $admin_view['perpage'] = $mybb->input['perpage'];
|
}
| }
|
if($mybb->input['order']) { $admin_view['sortorder'] = $mybb->input['order'];
|
if($mybb->input['order']) { $admin_view['sortorder'] = $mybb->input['order'];
|
}
| }
|
if($mybb->input['displayas']) {
| if($mybb->input['displayas']) {
|
Zeile 2041 | Zeile 2060 |
---|
} if($mybb->input['profile_fields'])
|
} if($mybb->input['profile_fields'])
|
{
| {
|
$admin_view['custom_profile_fields'] = $mybb->input['profile_fields']; }
| $admin_view['custom_profile_fields'] = $mybb->input['profile_fields']; }
|
Zeile 2054 | Zeile 2073 |
---|
$page->output_nav_tabs($sub_tabs, 'find_users'); echo $results; $page->output_footer();
|
$page->output_nav_tabs($sub_tabs, 'find_users'); echo $results; $page->output_footer();
|
}
| }
|
else { if($mybb->input['from'] == "home")
|
else { if($mybb->input['from'] == "home")
|
{
| {
|
flash_message($lang->error_no_users_found, 'error'); admin_redirect("index.php"); exit;
|
flash_message($lang->error_no_users_found, 'error'); admin_redirect("index.php"); exit;
|
}
| }
|
else { $errors[] = $lang->error_no_users_found;
| else { $errors[] = $lang->error_no_users_found;
|
Zeile 2074 | Zeile 2093 |
---|
$page->output_header($lang->find_users); $page->output_nav_tabs($sub_tabs, 'find_users');
|
$page->output_header($lang->find_users); $page->output_nav_tabs($sub_tabs, 'find_users');
|
|
|
// If we have any error messages, show them if($errors) {
| // If we have any error messages, show them if($errors) {
|
Zeile 2140 | Zeile 2159 |
---|
// If there isn't anything to select, then output an error if(!is_array($selected))
|
// If there isn't anything to select, then output an error if(!is_array($selected))
|
{
| {
|
if($mybb->input['inline_action'] != "multilift" && $mybb->request_method != "post") { $errors[] = $lang->error_inline_no_users_selected;
| if($mybb->input['inline_action'] != "multilift" && $mybb->request_method != "post") { $errors[] = $lang->error_inline_no_users_selected;
|
Zeile 2272 | Zeile 2291 |
---|
while($user = $db->fetch_array($query)) { $bannedcache[] = "u_".$user['uid'];
|
while($user = $db->fetch_array($query)) { $bannedcache[] = "u_".$user['uid'];
|
}
| }
|
// Collect the users $query = $db->simple_select("users", "uid, username, usergroup, additionalgroups, displaygroup", "uid IN (".$sql_array.")");
if($mybb->input['bantime'] == '---')
|
// Collect the users $query = $db->simple_select("users", "uid, username, usergroup, additionalgroups, displaygroup", "uid IN (".$sql_array.")");
if($mybb->input['bantime'] == '---')
|
{
| {
|
$lifted = 0; } else
|
$lifted = 0; } else
|
{
| {
|
$lifted = ban_date2timestamp($mybb->input['bantime']); }
| $lifted = ban_date2timestamp($mybb->input['bantime']); }
|
Zeile 2290 | Zeile 2309 |
---|
while($user = $db->fetch_array($query)) { if($user['uid'] == $mybb->user['uid'] || is_super_admin($user['uid']))
|
while($user = $db->fetch_array($query)) { if($user['uid'] == $mybb->user['uid'] || is_super_admin($user['uid']))
|
{
| {
|
// We remove ourselves and Super Admins from the mix continue; }
| // We remove ourselves and Super Admins from the mix continue; }
|
Zeile 2306 | Zeile 2325 |
---|
"reason" => $db->escape_string($mybb->input['reason']) ); $db->update_query("banned", $update_array, "uid = '".$user['uid']."'");
|
"reason" => $db->escape_string($mybb->input['reason']) ); $db->update_query("banned", $update_array, "uid = '".$user['uid']."'");
|
}
| }
|
else { // Not currently banned - insert the ban
| else { // Not currently banned - insert the ban
|
Zeile 2405 | Zeile 2424 |
---|
while($user = $db->fetch_array($query)) { if($user['uid'] == $mybb->user['uid'] || is_super_admin($user['uid']))
|
while($user = $db->fetch_array($query)) { if($user['uid'] == $mybb->user['uid'] || is_super_admin($user['uid']))
|
{
| {
|
// Remove me and super admins continue; }
| // Remove me and super admins continue; }
|
Zeile 2932 | Zeile 2951 |
---|
if(!isset($admin_session['data']['last_users_view']) || $admin_session['data']['last_users_view'] != str_replace("&", "&", $view['url'])) { update_admin_session('last_users_url', str_replace("&", "&", $view['url']));
|
if(!isset($admin_session['data']['last_users_view']) || $admin_session['data']['last_users_view'] != str_replace("&", "&", $view['url'])) { update_admin_session('last_users_url', str_replace("&", "&", $view['url']));
|
| } if(isset($view['conditions']['referrer'])){ $view['url'] .= "&action=referrers&uid=".htmlspecialchars($view['conditions']['referrer']);
|
} // Do we not have any views?
| } // Do we not have any views?
|
Zeile 3081 | Zeile 3104 |
---|
{ foreach($input as $value => $text) {
|
{ foreach($input as $value => $text) {
|
if($value == "N/A")
| if($value == $column) { $value = $text; }
if($value == $lang->na)
|
{ continue; }
| { continue; }
|
Zeile 3091 | Zeile 3119 |
---|
} else if(!empty($input)) {
|
} else if(!empty($input)) {
|
if($input == "N/A")
| if($input == $lang->na)
|
{ continue; }
| { continue; }
|
Zeile 3616 | Zeile 3644 |
---|
list($type, $options) = explode("\n", $profile_field['type'], 2); $type = trim($type); $field_name = "fid{$profile_field['fid']}";
|
list($type, $options) = explode("\n", $profile_field['type'], 2); $type = trim($type); $field_name = "fid{$profile_field['fid']}";
|
|
|
switch($type) { case "multiselect":
|
switch($type) { case "multiselect":
|
if(!is_array($values[$field_name])) { $user_options = explode("\n", $values[$field_name]); } else { $user_options = $values[$field_name]; } foreach($user_options as $val) { $selected_options[$val] = $val; } $select_options = array();
| if(!is_array($values[$field_name])) { $user_options = explode("\n", $values[$field_name]); } else { $user_options = $values[$field_name]; }
foreach($user_options as $val) { $selected_options[$val] = $val; }
$select_options = explode("\n", $options);
|
$options = array(); if($search == true) { $select_options[''] = $lang->na; }
|
$options = array(); if($search == true) { $select_options[''] = $lang->na; }
|
$select_options += explode("\n", $options);
| |
|
|
foreach($select_options as $val) { $val = trim($val); $options[$val] = $val; } if(!$profile_field['length'])
| foreach($select_options as $val) { $val = trim($val); $options[$val] = $val; } if(!$profile_field['length'])
|
{ $profile_field['length'] = 3; }
| { $profile_field['length'] = 3; }
|
Zeile 3658 | Zeile 3688 |
---|
} $select_options += explode("\n", $options); $options = array();
|
} $select_options += explode("\n", $options); $options = array();
|
foreach($select_options as $val) {
| foreach($select_options as $val) {
|
$val = trim($val); $options[$val] = $val;
|
$val = trim($val); $options[$val] = $val;
|
}
| }
|
if(!$profile_field['length'])
|
if(!$profile_field['length'])
|
{
| {
|
$profile_field['length'] = 1; }
|
$profile_field['length'] = 1; }
|
$code = $form->generate_select_box("profile_fields[{$field_name}]", $options, $values[$field_name], array('id' => "profile_field_{$field_name}", 'size' => $profile_field['length']));
| if($search == true) { $code = $form->generate_select_box("profile_fields[{$field_name}][{$field_name}]", $options, $values[$field_name], array('id' => "profile_field_{$field_name}", 'size' => $profile_field['length'])); } else { $code = $form->generate_select_box("profile_fields[{$field_name}]", $options, $values[$field_name], array('id' => "profile_field_{$field_name}", 'size' => $profile_field['length'])); }
|
break; case "radio": $radio_options = array();
| break; case "radio": $radio_options = array();
|
Zeile 3688 | Zeile 3725 |
---|
$user_options = explode("\n", $values[$field_name]); } else
|
$user_options = explode("\n", $values[$field_name]); } else
|
{
| {
|
$user_options = $values[$field_name]; } foreach($user_options as $val)
| $user_options = $values[$field_name]; } foreach($user_options as $val)
|
Zeile 3716 | Zeile 3753 |
---|
} $form_container->output_row($profile_field['name'], $profile_field['description'], $code, "", array('id' => "profile_field_{$field_name}")); $code = $user_options = $selected_options = $radio_options = $val = $options = '';
|
} $form_container->output_row($profile_field['name'], $profile_field['description'], $code, "", array('id' => "profile_field_{$field_name}")); $code = $user_options = $selected_options = $radio_options = $val = $options = '';
|
}
| }
|
}
|
}
|
|
|
function user_search_conditions($input=array(), &$form) { global $mybb, $db, $lang;
| function user_search_conditions($input=array(), &$form) { global $mybb, $db, $lang;
|
Zeile 3728 | Zeile 3765 |
---|
$input = $mybb->input; }
|
$input = $mybb->input; }
|
if(!is_array($input['conditions']))
| if(!is_array($input['conditions'])) { $input['conditions'] = unserialize($input['conditions']); } if(!is_array($input['profile_fields']))
|
{
|
{
|
$input['conditions'] = unserialize($input['conditions']);
| $input['profile_fields'] = unserialize($input['profile_fields']);
|
} if(!is_array($input['fields']))
| } if(!is_array($input['fields']))
|
Zeile 3787 | Zeile 3829 |
---|
} }
|
} }
|
output_custom_profile_fields($profile_fields['required'], $mybb->input['profile_fields'], $form_container, $form, true); output_custom_profile_fields($profile_fields['optional'], $mybb->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);
|
$form_container->end();
| $form_container->end();
|