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 2561 | Zeile 2569 |
---|
"profile_fields" => $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY), "profile_fields_editable" => true, "website" => $mybb->get_input('website'),
|
"profile_fields" => $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY), "profile_fields_editable" => true, "website" => $mybb->get_input('website'),
|
"icq" => $mybb->get_input('icq'),
| |
"skype" => $mybb->get_input('skype'), "google" => $mybb->get_input('google'), "signature" => $mybb->get_input('signature'),
| "skype" => $mybb->get_input('skype'), "google" => $mybb->get_input('google'), "signature" => $mybb->get_input('signature'),
|
Zeile 2635 | Zeile 2642 |
---|
"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 2703 | Zeile 2710 |
---|
if(isset($extra_user_updates) && !empty($extra_user_updates['moderateposts']) && !empty($extra_user_updates['suspendposting'])) { $errors[] = $lang->suspendmoderate_error;
|
if(isset($extra_user_updates) && !empty($extra_user_updates['moderateposts']) && !empty($extra_user_updates['suspendposting'])) { $errors[] = $lang->suspendmoderate_error;
|
}
| }
|
if(is_array($errors) && !empty($errors)) {
| if(is_array($errors) && !empty($errors)) {
|
Zeile 2768 | Zeile 2775 |
---|
if(!my_validate_url($user['website'])) { $user['website'] = '';
|
if(!my_validate_url($user['website'])) { $user['website'] = '';
|
}
if($user['icq'] != "0") { $user['icq'] = (int)$user['icq'];
| |
}
if(!$errors)
| }
if(!$errors)
|
Zeile 2795 | Zeile 2797 |
---|
}
// Sanitize all input
|
}
// Sanitize all input
|
foreach(array('usertitle', 'website', 'icq', 'skype', 'google', 'signature', 'birthday_day', 'birthday_month', 'birthday_year') as $field)
| foreach(array('usertitle', 'website', 'skype', 'google', 'signature', 'birthday_day', 'birthday_month', 'birthday_year') as $field)
|
{ $mybb->input[$field] = htmlspecialchars_uni($mybb->get_input($field)); }
| { $mybb->input[$field] = htmlspecialchars_uni($mybb->get_input($field)); }
|
Zeile 2848 | Zeile 2850 |
---|
$bdaymonthsel[$month] = ''; } $bdaymonthsel[$mybb->input['birthday_month']] = 'selected="selected"';
|
$bdaymonthsel[$month] = ''; } $bdaymonthsel[$mybb->input['birthday_month']] = 'selected="selected"';
|
| $awaysection = '';
|
if($mybb->settings['allowaway'] != 0) {
| if($mybb->settings['allowaway'] != 0) {
|
Zeile 2915 | Zeile 2919 |
---|
}
eval("\$awaysection = \"".$templates->get("usercp_profile_away")."\";");
|
}
eval("\$awaysection = \"".$templates->get("usercp_profile_away")."\";");
|
}
| }
|
$plugins->run_hooks("modcp_editprofile_start");
// Fetch profile fields
| $plugins->run_hooks("modcp_editprofile_start");
// Fetch profile fields
|
Zeile 2961 | Zeile 2965 |
---|
$userfield = $user_fields[$field]; } if($type == "multiselect")
|
$userfield = $user_fields[$field]; } if($type == "multiselect")
|
{ if($errors) { $useropts = $userfield; } else { $useropts = explode("\n", $userfield); } if(is_array($useropts)) { foreach($useropts as $key => $val) { $seloptions[$val] = $val; } } $expoptions = explode("\n", $options); if(is_array($expoptions)) { foreach($expoptions as $key => $val) { $val = trim($val); $val = str_replace("\n", "\\n", $val);
$sel = ""; if(isset($seloptions[$val]) && $val == $seloptions[$val]) { $sel = " selected=\"selected\""; }
eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");
| { if($errors) { $useropts = $userfield; } else { $useropts = explode("\n", $userfield); } if(is_array($useropts)) { foreach($useropts as $key => $val) { $seloptions[$val] = $val; } } $expoptions = explode("\n", $options); if(is_array($expoptions)) { foreach($expoptions as $key => $val) { $val = trim($val); $val = str_replace("\n", "\\n", $val);
$sel = ""; if(isset($seloptions[$val]) && $val == $seloptions[$val]) { $sel = " selected=\"selected\""; }
eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");
|
} if(!$profilefield['length']) {
| } if(!$profilefield['length']) {
|
Zeile 3018 | Zeile 3022 |
---|
eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";"); }
|
eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";"); }
|
if(!$profilefield['length']) { $profilefield['length'] = 1; }
| if(!$profilefield['length']) { $profilefield['length'] = 1; }
|
eval("\$code = \"".$templates->get("usercp_profile_profilefields_select")."\";"); }
| eval("\$code = \"".$templates->get("usercp_profile_profilefields_select")."\";"); }
|
Zeile 3090 | Zeile 3094 |
---|
}
eval("\$code = \"".$templates->get("usercp_profile_profilefields_text")."\";");
|
}
eval("\$code = \"".$templates->get("usercp_profile_profilefields_text")."\";");
|
}
| }
|
if($profilefield['required'] == 1) {
| if($profilefield['required'] == 1) {
|
Zeile 3193 | Zeile 3197 |
---|
if($user[$option['option']]) { if($user[$option['length']] == 0)
|
if($user[$option['option']]) { if($user[$option['length']] == 0)
|
{
| {
|
// User has a permanent ban $string = $option['option']."_perm"; $suspension_info = $lang->$string;
| // User has a permanent ban $string = $option['option']."_perm"; $suspension_info = $lang->$string;
|
Zeile 3263 | Zeile 3267 |
---|
$birthday_year = $mybb->input['birthday_year']; $user_website = $mybb->input['website'];
|
$birthday_year = $mybb->input['birthday_year']; $user_website = $mybb->input['website'];
|
$user_icq = $mybb->input['icq'];
| |
$user_skype = $mybb->input['skype']; $user_google = $mybb->input['google'];
| $user_skype = $mybb->input['skype']; $user_google = $mybb->input['google'];
|
Zeile 3366 | Zeile 3369 |
---|
if(!empty($mybb->input[$field])) { $page_url .= "&{$field}=".$mybb->input[$field];
|
if(!empty($mybb->input[$field])) { $page_url .= "&{$field}=".$mybb->input[$field];
|
} }
| } }
|
$multipage = multipage($user_count, $perpage, $page, $page_url);
$usergroups_cache = $cache->read("usergroups");
$plugins->run_hooks("modcp_finduser_start");
|
$multipage = multipage($user_count, $perpage, $page, $page_url);
$usergroups_cache = $cache->read("usergroups");
$plugins->run_hooks("modcp_finduser_start");
|
|
|
// Fetch out results $query = $db->simple_select("users", "*", "1=1 {$where}", array("order_by" => $sortby, "order_dir" => $order, "limit" => $perpage, "limit_start" => $start)); $users = '';
| // Fetch out results $query = $db->simple_select("users", "*", "1=1 {$where}", array("order_by" => $sortby, "order_dir" => $order, "limit" => $perpage, "limit_start" => $start)); $users = '';
|
Zeile 3388 | Zeile 3391 |
---|
if($user['invisible'] == 1 && $mybb->usergroup['canviewwolinvis'] != 1 && $user['uid'] != $mybb->user['uid']) {
|
if($user['invisible'] == 1 && $mybb->usergroup['canviewwolinvis'] != 1 && $user['uid'] != $mybb->user['uid']) {
|
$lastdate = $lang->lastvisit_never;
if($user['lastvisit']) { // We have had at least some active time, hide it instead $lastdate = $lang->lastvisit_hidden; }
| // We have had at least some active time, hide it instead $lastdate = $lang->lastvisit_hidden; } else if($user['lastvisit']) { $lastdate = my_date('relative', $user['lastvisit']);
|
} else {
|
} else {
|
$lastdate = my_date('relative', $user['lastvisit']);
| $lastdate = $lang->lastvisit_never;
|
}
$usergroup = htmlspecialchars_uni($usergroups_cache[$user['usergroup']]['title']);
| }
$usergroup = htmlspecialchars_uni($usergroups_cache[$user['usergroup']]['title']);
|
Zeile 3475 | Zeile 3477 |
---|
{ $mod_user = get_user($mybb->input['search']['uid']); $mybb->input['search']['mod_username'] = htmlspecialchars_uni($mod_user['username']);
|
{ $mod_user = get_user($mybb->input['search']['uid']); $mybb->input['search']['mod_username'] = htmlspecialchars_uni($mod_user['username']);
|
}
| }
|
} else {
| } else {
|
Zeile 3545 | Zeile 3547 |
---|
$total_warnings = $db->fetch_field($query, 'count'); $page = $mybb->get_input('page', MyBB::INPUT_INT); if($page <= 0)
|
$total_warnings = $db->fetch_field($query, 'count'); $page = $mybb->get_input('page', MyBB::INPUT_INT); if($page <= 0)
|
{
| {
|
$page = 1; } $per_page = 20;
| $page = 1; } $per_page = 20;
|
Zeile 3717 | Zeile 3719 |
---|
if(!empty($onlyusfids)) { $where_sql .= " AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))";
|
if(!empty($onlyusfids)) { $where_sql .= " AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))";
|
}
| }
|
// Moderators can view unapproved/deleted posts if($mybb->usergroup['issupermod'] != 1) {
| // Moderators can view unapproved/deleted posts if($mybb->usergroup['issupermod'] != 1) {
|
Zeile 3727 | Zeile 3729 |
---|
$visible_sql = " AND (p.visible = 1 AND t.visible = 1)"; $query = $db->simple_select("moderators", "fid, canviewunapprove, canviewdeleted", "(id='{$mybb->user['uid']}' AND isgroup='0') OR (id='{$mybb->user['usergroup']}' AND isgroup='1')"); while($moderator = $db->fetch_array($query))
|
$visible_sql = " AND (p.visible = 1 AND t.visible = 1)"; $query = $db->simple_select("moderators", "fid, canviewunapprove, canviewdeleted", "(id='{$mybb->user['uid']}' AND isgroup='0') OR (id='{$mybb->user['usergroup']}' AND isgroup='1')"); while($moderator = $db->fetch_array($query))
|
{
| {
|
if($moderator['canviewunapprove'] == 1) { $unapprove_forums[] = $moderator['fid'];
|
if($moderator['canviewunapprove'] == 1) { $unapprove_forums[] = $moderator['fid'];
|
}
| }
|
if($moderator['canviewdeleted'] == 1) {
| if($moderator['canviewdeleted'] == 1) {
|
Zeile 3740 | Zeile 3742 |
---|
}
if(!empty($unapprove_forums))
|
}
if(!empty($unapprove_forums))
|
{
| {
|
$visible_sql .= " OR (p.visible = 0 AND p.fid IN(".implode(',', $unapprove_forums).")) OR (t.visible = 0 AND t.fid IN(".implode(',', $unapprove_forums)."))"; } if(!empty($deleted_forums))
| $visible_sql .= " OR (p.visible = 0 AND p.fid IN(".implode(',', $unapprove_forums).")) OR (t.visible = 0 AND t.fid IN(".implode(',', $unapprove_forums)."))"; } if(!empty($deleted_forums))
|
Zeile 3752 | Zeile 3754 |
---|
{ // Super moderators (and admins) $visible_sql = " AND p.visible >= -1";
|
{ // Super moderators (and admins) $visible_sql = " AND p.visible >= -1";
|
}
| }
|
$query = $db->query(" SELECT COUNT(p.pid) AS count
| $query = $db->query(" SELECT COUNT(p.pid) AS count
|
Zeile 4261 | Zeile 4263 |
---|
"); $user = $db->fetch_array($query);
|
"); $user = $db->fetch_array($query);
|
if($user['uid'])
| if($user)
|
{ $existing_ban = true; }
| { $existing_ban = true; }
|
Zeile 4285 | Zeile 4287 |
---|
$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 4310 | Zeile 4312 |
---|
// 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; }
|