Zeile 2064 | Zeile 2064 |
---|
{ $attachments = array_map("intval", array_keys($mybb->input['attachments'])); $query = $db->query("
|
{ $attachments = array_map("intval", array_keys($mybb->input['attachments'])); $query = $db->query("
|
SELECT a.pid, a.aid
| SELECT a.pid, a.aid, t.tid
|
FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
| FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
|
Zeile 2080 | Zeile 2080 |
---|
if($action == "approve") { $db->update_query("attachments", array("visible" => 1), "aid='{$attachment['aid']}'");
|
if($action == "approve") { $db->update_query("attachments", array("visible" => 1), "aid='{$attachment['aid']}'");
|
| if(isset($attachment['tid'])) { update_thread_counters((int)$attachment['tid'], array("attachmentcount" => "+1")); }
|
} else if($action == "delete") { remove_attachment($attachment['pid'], '', $attachment['aid']);
|
} else if($action == "delete") { remove_attachment($attachment['pid'], '', $attachment['aid']);
|
| if(isset($attachment['tid'])) { update_thread_counters((int)$attachment['tid'], array("attachmentcount" => "-1")); }
|
} }
| } }
|
Zeile 2480 | Zeile 2488 |
---|
if($mybb->input['action'] == "do_editprofile") { // Verify incoming POST request
|
if($mybb->input['action'] == "do_editprofile") { // Verify incoming POST request
|
verify_post_check($mybb->input['my_post_key']);
| verify_post_check($mybb->get_input('my_post_key'));
|
if($mybb->usergroup['caneditprofiles'] == 0)
|
if($mybb->usergroup['caneditprofiles'] == 0)
|
{ error_no_permission(); }
| { error_no_permission(); }
|
$user = get_user($mybb->input['uid']); if(!$user) { error($lang->error_nomember);
|
$user = get_user($mybb->input['uid']); if(!$user) { error($lang->error_nomember);
|
}
| }
|
// Check if the current user has permission to edit this user if(!modcp_can_manage_user($user['uid'])) { error_no_permission();
|
// Check if the current user has permission to edit this user if(!modcp_can_manage_user($user['uid'])) { error_no_permission();
|
}
$plugins->run_hooks("modcp_do_editprofile_start");
| }
$plugins->run_hooks("modcp_do_editprofile_start");
|
if($mybb->get_input('away', MyBB::INPUT_INT) == 1 && $mybb->settings['allowaway'] != 0) {
| if($mybb->get_input('away', MyBB::INPUT_INT) == 1 && $mybb->settings['allowaway'] != 0) {
|
Zeile 2576 | Zeile 2584 |
---|
);
if(!empty($mybb->input['usertitle']))
|
);
if(!empty($mybb->input['usertitle']))
|
{
| {
|
$updated_user['usertitle'] = $mybb->get_input('usertitle'); } else if(!empty($mybb->input['reverttitle']))
| $updated_user['usertitle'] = $mybb->get_input('usertitle'); } else if(!empty($mybb->input['reverttitle']))
|
Zeile 2635 | Zeile 2643 |
---|
"update_field" => "suspendposting", "update_length" => "suspensiontime" )
|
"update_field" => "suspendposting", "update_length" => "suspensiontime" )
|
);
| );
|
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) {
|
Zeile 2645 | Zeile 2653 |
---|
if(empty($mybb->input[$option['action']])) { if($user[$option['update_field']] == 1)
|
if(empty($mybb->input[$option['action']])) { if($user[$option['update_field']] == 1)
|
{
| {
|
// We're revoking the suspension $extra_user_updates[$option['update_field']] = 0; $extra_user_updates[$option['update_length']] = 0;
|
// We're revoking the suspension $extra_user_updates[$option['update_field']] = 0; $extra_user_updates[$option['update_length']] = 0;
|
}
| }
|
// Skip this option if we haven't selected it continue; }
|
// Skip this option if we haven't selected it continue; }
|
|
|
else { if($mybb->input[$option['time']] == 0 && $mybb->input[$option['period']] != "never" && $user[$option['update_field']] != 1)
|
else { if($mybb->input[$option['time']] == 0 && $mybb->input[$option['period']] != "never" && $user[$option['update_field']] != 1)
|
{
| {
|
// User has selected a type of ban, but not entered a valid time frame $string = $option['action']."_error"; $errors[] = $lang->$string;
| // User has selected a type of ban, but not entered a valid time frame $string = $option['action']."_error"; $errors[] = $lang->$string;
|
Zeile 2670 | Zeile 2678 |
---|
if($user[$option['update_field']] == 1 && ($mybb->input[$option['time']] || $mybb->input[$option['period']] == "never")) { // We already have a suspension, but entered a new time
|
if($user[$option['update_field']] == 1 && ($mybb->input[$option['time']] || $mybb->input[$option['period']] == "never")) { // We already have a suspension, but entered a new time
|
if($suspend_length == "-1") {
| if($suspend_length == "-1") {
|
// Permanent ban on action $extra_user_updates[$option['update_length']] = 0; } elseif($suspend_length && $suspend_length != "-1")
|
// Permanent ban on action $extra_user_updates[$option['update_length']] = 0; } elseif($suspend_length && $suspend_length != "-1")
|
{
| {
|
// Temporary ban on action
|
// Temporary ban on action
|
$extra_user_updates[$option['update_length']] = TIME_NOW + $suspend_length; } }
| $extra_user_updates[$option['update_length']] = TIME_NOW + $suspend_length; } }
|
elseif(!$user[$option['update_field']]) { // New suspension for this user... bad user!
| elseif(!$user[$option['update_field']]) { // New suspension for this user... bad user!
|
Zeile 2706 | Zeile 2714 |
---|
}
if(is_array($errors) && !empty($errors))
|
}
if(is_array($errors) && !empty($errors))
|
{
| {
|
$mybb->input['action'] = "editprofile"; } else
| $mybb->input['action'] = "editprofile"; } else
|
Zeile 2720 | Zeile 2728 |
---|
$db->update_query("users", $extra_user_updates, "uid='{$user['uid']}'"); } log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user);
|
$db->update_query("users", $extra_user_updates, "uid='{$user['uid']}'"); } log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->edited_user);
|
|
|
$plugins->run_hooks("modcp_do_editprofile_end");
redirect("modcp.php?action=finduser", $lang->redirect_user_updated);
| $plugins->run_hooks("modcp_do_editprofile_end");
redirect("modcp.php?action=finduser", $lang->redirect_user_updated);
|
Zeile 2741 | Zeile 2749 |
---|
if(!$user) { error($lang->error_nomember);
|
if(!$user) { error($lang->error_nomember);
|
}
| }
|
// Check if the current user has permission to edit this user if(!modcp_can_manage_user($user['uid']))
| // Check if the current user has permission to edit this user if(!modcp_can_manage_user($user['uid']))
|
Zeile 2814 | Zeile 2822 |
---|
{ if($title['posts'] <= $user['postnum']) {
|
{ if($title['posts'] <= $user['postnum']) {
|
$defaulttitle = $title['title'];
| $defaulttitle = htmlspecialchars_uni($title['title']);
|
break; } }
| break; } }
|
Zeile 2848 | Zeile 2856 |
---|
$bdaymonthsel[$month] = ''; } $bdaymonthsel[$mybb->input['birthday_month']] = 'selected="selected"';
|
$bdaymonthsel[$month] = ''; } $bdaymonthsel[$mybb->input['birthday_month']] = 'selected="selected"';
|
| $awaysection = '';
|
if($mybb->settings['allowaway'] != 0) { $awaycheck = array('', ''); if($errors)
|
if($mybb->settings['allowaway'] != 0) { $awaycheck = array('', ''); if($errors)
|
{ if($user['away'] == 1) { $awaycheck[1] = "checked=\"checked\""; }
| { if($user['away'] == 1) { $awaycheck[1] = "checked=\"checked\""; }
|
else { $awaycheck[0] = "checked=\"checked\"";
| else { $awaycheck[0] = "checked=\"checked\"";
|
Zeile 2881 | Zeile 2891 |
---|
{ $awaynotice = $lang->away_notice; $awaycheck[0] = "checked=\"checked\"";
|
{ $awaynotice = $lang->away_notice; $awaycheck[0] = "checked=\"checked\"";
|
}
| }
|
$returndate = explode("-", $user['returndate']); } $returndatesel = $selected = ''; for($day = 1; $day <= 31; ++$day)
|
$returndate = explode("-", $user['returndate']); } $returndatesel = $selected = ''; for($day = 1; $day <= 31; ++$day)
|
{
| {
|
if($returndate[0] == $day) { $selected = "selected=\"selected\"";
|
if($returndate[0] == $day) { $selected = "selected=\"selected\"";
|
}
| }
|
else { $selected = ''; }
eval("\$returndatesel .= \"".$templates->get("usercp_profile_day")."\";");
|
else { $selected = ''; }
eval("\$returndatesel .= \"".$templates->get("usercp_profile_day")."\";");
|
}
| }
|
$returndatemonthsel = array(); foreach(range(1, 12) as $month) { $returndatemonthsel[$month] = '';
|
$returndatemonthsel = array(); foreach(range(1, 12) as $month) { $returndatemonthsel[$month] = '';
|
}
| }
|
if(isset($returndate[1])) { $returndatemonthsel[$returndate[1]] = " selected=\"selected\"";
|
if(isset($returndate[1])) { $returndatemonthsel[$returndate[1]] = " selected=\"selected\"";
|
}
| }
|
if(!isset($returndate[2])) {
| if(!isset($returndate[2])) {
|
Zeile 2915 | Zeile 2925 |
---|
}
eval("\$awaysection = \"".$templates->get("usercp_profile_away")."\";");
|
}
eval("\$awaysection = \"".$templates->get("usercp_profile_away")."\";");
|
}
| }
|
$plugins->run_hooks("modcp_editprofile_start");
| $plugins->run_hooks("modcp_editprofile_start");
|
Zeile 3672 | Zeile 3682 |
---|
// Searching post IP addresses if(isset($mybb->input['search_posts'])) {
|
// Searching post IP addresses if(isset($mybb->input['search_posts'])) {
|
| $post_ip_sql = '';
|
if($ip_range) { if(!is_array($ip_range))
| if($ip_range) { if(!is_array($ip_range))
|
Zeile 3745 | Zeile 3756 |
---|
if(!empty($deleted_forums)) { $visible_sql .= " OR (p.visible = -1 AND p.fid IN(".implode(',', $deleted_forums).")) OR (t.visible = -1 AND t.fid IN(".implode(',', $deleted_forums)."))";
|
if(!empty($deleted_forums)) { $visible_sql .= " OR (p.visible = -1 AND p.fid IN(".implode(',', $deleted_forums).")) OR (t.visible = -1 AND t.fid IN(".implode(',', $deleted_forums)."))";
|
} } else {
| } } else {
|
// Super moderators (and admins) $visible_sql = " AND p.visible >= -1"; }
| // Super moderators (and admins) $visible_sql = " AND p.visible >= -1"; }
|
Zeile 3766 | Zeile 3777 |
---|
// Searching user IP addresses if(isset($mybb->input['search_users'])) {
|
// Searching user IP addresses if(isset($mybb->input['search_users'])) {
|
| $user_ip_sql = '';
|
if($ip_range) { if(!is_array($ip_range))
| if($ip_range) { if(!is_array($ip_range))
|
Zeile 3936 | Zeile 3948 |
---|
foreach($ipaddresses as $ipaddress) { $ip = my_inet_ntop($db->unescape_binary($ipaddress['ipaddress']));
|
foreach($ipaddresses as $ipaddress) { $ip = my_inet_ntop($db->unescape_binary($ipaddress['ipaddress']));
|
if(!$ipaddress['username'])
| if(empty($ipaddress['username']))
|
{ $ipaddress['username'] = $ipaddress['postusername']; // Guest username support } $ipaddress['username'] = htmlspecialchars_uni($ipaddress['username']); $trow = alt_trow();
|
{ $ipaddress['username'] = $ipaddress['postusername']; // Guest username support } $ipaddress['username'] = htmlspecialchars_uni($ipaddress['username']); $trow = alt_trow();
|
if(!$ipaddress['subject'])
| if(empty($ipaddress['subject']))
|
{ $ipaddress['subject'] = "RE: {$ipaddress['threadsubject']}"; }
| { $ipaddress['subject'] = "RE: {$ipaddress['threadsubject']}"; }
|
Zeile 4259 | Zeile 4271 |
---|
"); $user = $db->fetch_array($query);
|
"); $user = $db->fetch_array($query);
|
if($user['uid'])
| if($user)
|
{ $existing_ban = true; }
| { $existing_ban = true; }
|
Zeile 4283 | Zeile 4295 |
---|
$user = get_user_by_username($mybb->input['username'], $options);
|
$user = get_user_by_username($mybb->input['username'], $options);
|
if(!$user['uid'])
| if(!$user)
|
{ $errors[] = $lang->invalid_username; }
| { $errors[] = $lang->invalid_username; }
|
Zeile 4308 | Zeile 4320 |
---|
// Check banned group $usergroups_cache = $cache->read('usergroups');
|
// Check banned group $usergroups_cache = $cache->read('usergroups');
|
$usergroup = $usergroups_cache[$mybb->get_input('usergroup', MyBB::INPUT_INT)];
| if(isset($usergroups_cache[$mybb->get_input('usergroup', MyBB::INPUT_INT)])) { $usergroup = $usergroups_cache[$mybb->get_input('usergroup', MyBB::INPUT_INT)]; }
|
|
|
if(empty($usergroup['gid']) || empty($usergroup['isbannedgroup']))
| if(!isset($usergroup) || empty($usergroup['isbannedgroup']))
|
{ $errors[] = $lang->error_nobangroup; }
| { $errors[] = $lang->error_nobangroup; }
|