Zeile 56 | Zeile 56 |
---|
$flist_queue_attach = $wflist_reports = $tflist_reports = $flist_reports = $tflist_modlog = $flist_modlog = $errors = ''; // SQL for fetching items only related to forums this user moderates $moderated_forums = array();
|
$flist_queue_attach = $wflist_reports = $tflist_reports = $flist_reports = $tflist_modlog = $flist_modlog = $errors = ''; // SQL for fetching items only related to forums this user moderates $moderated_forums = array();
|
| $numannouncements = $nummodqueuethreads = $nummodqueueposts = $nummodqueueattach = $numreportedposts = $nummodlogs = 0;
|
if($mybb->usergroup['issupermod'] != 1) { $query = $db->simple_select("moderators", "*", "(id='{$mybb->user['uid']}' AND isgroup = '0') OR (id IN ({$mybb->usergroup['all_usergroups']}) AND isgroup = '1')");
|
if($mybb->usergroup['issupermod'] != 1) { $query = $db->simple_select("moderators", "*", "(id='{$mybb->user['uid']}' AND isgroup = '0') OR (id IN ({$mybb->usergroup['all_usergroups']}) AND isgroup = '1')");
|
$numannouncements = $nummodqueuethreads = $nummodqueueposts = $nummodqueueattach = $numreportedposts = $nummodlogs = 0;
| |
while($forum = $db->fetch_array($query)) {
|
while($forum = $db->fetch_array($query)) {
|
// For Announcements if($forum['canmanageannouncements'] == 1) { ++$numannouncements; }
| $moderated_forums[] = $forum['fid']; $children = get_child_list($forum['fid']); if(is_array($children)) { $moderated_forums = array_merge($moderated_forums, $children); } } $moderated_forums = array_unique($moderated_forums);
$numannouncements = $nummodqueuethreads = $nummodqueueposts = $nummodqueueattach = $numreportedposts = $nummodlogs = 0; foreach($moderated_forums as $moderated_forum) { // For Announcements if(is_moderator($moderated_forum, 'canmanageannouncements')) { ++$numannouncements; }
|
// For the Mod Queues
|
// For the Mod Queues
|
if($forum['canapproveunapprovethreads'] == 1)
| if(is_moderator($moderated_forum, 'canapproveunapprovethreads'))
|
{
|
{
|
$flist_queue_threads .= ",'{$forum['fid']}'";
$children = get_child_list($forum['fid']); if(!empty($children)) { $flist_queue_threads .= ",'".implode("','", $children)."'"; }
| $flist_queue_threads .= ",'{$moderated_forum}'";
|
++$nummodqueuethreads; }
|
++$nummodqueuethreads; }
|
if($forum['canapproveunapproveposts'] == 1) { $flist_queue_posts .= ",'{$forum['fid']}'";
$children = get_child_list($forum['fid']); if(!empty($children)) { $flist_queue_posts .= ",'".implode("','", $children)."'"; } ++$nummodqueueposts; }
if($forum['canapproveunapproveattachs'] == 1)
| if(is_moderator($moderated_forum, 'canapproveunapproveposts')) { $flist_queue_posts .= ",'{$moderated_forum}'"; ++$nummodqueueposts; }
if(is_moderator($moderated_forum, 'canapproveunapproveattachs'))
|
{
|
{
|
$flist_queue_attach .= ",'{$forum['fid']}'";
$children = get_child_list($forum['fid']); if(!empty($children)) { $flist_queue_attach .= ",'".implode("','", $children)."'"; }
| $flist_queue_attach .= ",'{$moderated_forum}'";
|
++$nummodqueueattach; }
// For Reported posts
|
++$nummodqueueattach; }
// For Reported posts
|
if($forum['canmanagereportedposts'] == 1)
| if(is_moderator($moderated_forum, 'canmanagereportedposts'))
|
{
|
{
|
$flist_reports .= ",'{$forum['fid']}'";
$children = get_child_list($forum['fid']); if(!empty($children)) { $flist_reports .= ",'".implode("','", $children)."'"; }
| $flist_reports .= ",'{$moderated_forum}'";
|
++$numreportedposts; }
// For the Mod Log
|
++$numreportedposts; }
// For the Mod Log
|
if($forum['canviewmodlog'] == 1)
| if(is_moderator($moderated_forum, 'canviewmodlog'))
|
{
|
{
|
$flist_modlog .= ",'{$forum['fid']}'";
$children = get_child_list($forum['fid']); if(!empty($children)) { $flist_modlog .= ",'".implode("','", $children)."'"; }
| $flist_modlog .= ",'{$moderated_forum}'";
|
++$nummodlogs;
|
++$nummodlogs;
|
}
$flist .= ",'{$forum['fid']}'";
| }
|
|
|
$children = get_child_list($forum['fid']); if(!empty($children)) { $flist .= ",'".implode("','", $children)."'"; } $moderated_forums[] = $forum['fid'];
| $flist .= ",'{$moderated_forum}'";
|
} if($flist_queue_threads) {
| } if($flist_queue_threads) {
|
Zeile 180 | Zeile 154 |
---|
$unviewablefids1 = $unviewablefids2 = array();
if($unviewableforums)
|
$unviewablefids1 = $unviewablefids2 = array();
if($unviewableforums)
|
{
| {
|
$flist .= " AND fid NOT IN ({$unviewableforums})"; $tflist .= " AND t.fid NOT IN ({$unviewableforums})";
| $flist .= " AND fid NOT IN ({$unviewableforums})"; $tflist .= " AND t.fid NOT IN ({$unviewableforums})";
|
Zeile 257 | Zeile 231 |
---|
if($mybb->usergroup['canuseipsearch'] == 1) { eval("\$nav_ipsearch = \"".$templates->get("modcp_nav_ipsearch")."\";");
|
if($mybb->usergroup['canuseipsearch'] == 1) { eval("\$nav_ipsearch = \"".$templates->get("modcp_nav_ipsearch")."\";");
|
}
| }
|
$plugins->run_hooks("modcp_nav");
if(!empty($nav_announcements) || !empty($nav_modqueue) || !empty($nav_reportcenter) || !empty($nav_modlogs)) {
|
$plugins->run_hooks("modcp_nav");
if(!empty($nav_announcements) || !empty($nav_modqueue) || !empty($nav_reportcenter) || !empty($nav_modlogs)) {
|
| $expaltext = (in_array("modcpforums", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;
|
eval("\$modcp_nav_forums_posts = \"".$templates->get("modcp_nav_forums_posts")."\";"); }
if(!empty($nav_editprofile) || !empty($nav_banning) || !empty($nav_warninglogs) || !empty($nav_ipsearch)) {
|
eval("\$modcp_nav_forums_posts = \"".$templates->get("modcp_nav_forums_posts")."\";"); }
if(!empty($nav_editprofile) || !empty($nav_banning) || !empty($nav_warninglogs) || !empty($nav_ipsearch)) {
|
| $expaltext = (in_array("modcpusers", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;
|
eval("\$modcp_nav_users = \"".$templates->get("modcp_nav_users")."\";"); }
| eval("\$modcp_nav_users = \"".$templates->get("modcp_nav_users")."\";"); }
|
Zeile 335 | Zeile 311 |
---|
my_unsetcookie('inlinereports'); my_unsetcookie('inlinereports_removed');
|
my_unsetcookie('inlinereports'); my_unsetcookie('inlinereports_removed');
|
$page = $mybb->get_input('page', MyBB::INPUT_INT);
| $page = $mybb->get_input('page', MyBB::INPUT_INT);
|
redirect("modcp.php?action=reports&page={$page}", $message); }
| redirect("modcp.php?action=reports&page={$page}", $message); }
|
Zeile 414 | Zeile 390 |
---|
$plugins->run_hooks("modcp_reports_start");
// Reports
|
$plugins->run_hooks("modcp_reports_start");
// Reports
|
$reports = '';
| $reports = $selectall = ''; $inlinecount = 0;
|
$query = $db->query(" SELECT r.*, u.username, rr.title FROM ".TABLE_PREFIX."reportedcontent r
| $query = $db->query(" SELECT r.*, u.username, rr.title FROM ".TABLE_PREFIX."reportedcontent r
|
Zeile 530 | Zeile 508 |
---|
$plugins->run_hooks('modcp_reports_intermediate');
|
$plugins->run_hooks('modcp_reports_intermediate');
|
$inlinecount = 0;
| |
// Now that we have all of the information needed, display the reports foreach($reportcache as $report) {
| // Now that we have all of the information needed, display the reports foreach($reportcache as $report) {
|
Zeile 1875 | Zeile 1852 |
---|
'image' => 'groupimage', 'namestyle' => 'namestyle', 'usereputationsystem' => 'usereputationsystem'
|
'image' => 'groupimage', 'namestyle' => 'namestyle', 'usereputationsystem' => 'usereputationsystem'
|
);
| );
|
foreach($data_key as $field => $key) {
| foreach($data_key as $field => $key) {
|
Zeile 1902 | Zeile 1879 |
---|
if($mybb->usergroup['canmanageannounce'] == 0) { error_no_permission();
|
if($mybb->usergroup['canmanageannounce'] == 0) { error_no_permission();
|
}
| }
|
if($numannouncements == 0 && $mybb->usergroup['issupermod'] != 1) {
| if($numannouncements == 0 && $mybb->usergroup['issupermod'] != 1) {
|
Zeile 1933 | Zeile 1910 |
---|
foreach($global_announcements as $aid => $announcement) { $trow = alt_trow();
|
foreach($global_announcements as $aid => $announcement) { $trow = alt_trow();
|
if($announcement['startdate'] > TIME_NOW || ($announcement['enddate'] < TIME_NOW && $announcement['enddate'] != 0))
| if((isset($announcement['startdate']) && $announcement['startdate'] > TIME_NOW) || (isset($announcement['enddate']) && $announcement['enddate'] < TIME_NOW && $announcement['enddate'] != 0))
|
{ eval("\$icon = \"".$templates->get("modcp_announcements_announcement_expired")."\";"); }
| { eval("\$icon = \"".$templates->get("modcp_announcements_announcement_expired")."\";"); }
|
Zeile 1950 | Zeile 1927 |
---|
else { // No global announcements
|
else { // No global announcements
|
eval("\$announcements_global = \"".$templates->get("modcp_no_announcements_global")."\";"); }
| eval("\$announcements_global = \"".$templates->get("modcp_no_announcements_global")."\";"); }
|
eval("\$announcements_global = \"".$templates->get("modcp_announcements_global")."\";"); }
| eval("\$announcements_global = \"".$templates->get("modcp_announcements_global")."\";"); }
|
Zeile 2087 | 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 2100 | Zeile 2077 |
---|
continue; } $action = $mybb->input['attachments'][$attachment['aid']];
|
continue; } $action = $mybb->input['attachments'][$attachment['aid']];
|
if($action == "approve") {
| if($action == "approve") {
|
$db->update_query("attachments", array("visible" => 1), "aid='{$attachment['aid']}'");
|
$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")); }
|
}
|
}
|
}
$plugins->run_hooks("modcp_do_modqueue_end");
| }
$plugins->run_hooks("modcp_do_modqueue_end");
|
redirect("modcp.php?action=modqueue&type=attachments", $lang->redirect_attachmentsmoderated); } }
| redirect("modcp.php?action=modqueue&type=attachments", $lang->redirect_attachmentsmoderated); } }
|
Zeile 2123 | Zeile 2108 |
---|
if($mybb->usergroup['canmanagemodqueue'] == 0) { error_no_permission();
|
if($mybb->usergroup['canmanagemodqueue'] == 0) { error_no_permission();
|
}
| }
|
if($nummodqueuethreads == 0 && $nummodqueueposts == 0 && $nummodqueueattach == 0 && $mybb->usergroup['issupermod'] != 1) { error($lang->you_cannot_use_mod_queue);
| if($nummodqueuethreads == 0 && $nummodqueueposts == 0 && $nummodqueueattach == 0 && $mybb->usergroup['issupermod'] != 1) { error($lang->you_cannot_use_mod_queue);
|
Zeile 2137 | Zeile 2122 |
---|
if($nummodqueuethreads == 0 && $mybb->usergroup['issupermod'] != 1) { error($lang->you_cannot_moderate_threads);
|
if($nummodqueuethreads == 0 && $mybb->usergroup['issupermod'] != 1) { error($lang->you_cannot_moderate_threads);
|
}
| }
|
$forum_cache = $cache->read("forums");
$query = $db->simple_select("threads", "COUNT(tid) AS unapprovedthreads", "visible='0' {$flist_queue_threads}");
| $forum_cache = $cache->read("forums");
$query = $db->simple_select("threads", "COUNT(tid) AS unapprovedthreads", "visible='0' {$flist_queue_threads}");
|
Zeile 2152 | Zeile 2137 |
---|
$perpage = $mybb->settings['threadsperpage']; $pages = $unapproved_threads / $perpage;
|
$perpage = $mybb->settings['threadsperpage']; $pages = $unapproved_threads / $perpage;
|
$pages = ceil($pages);
if($mybb->get_input('page') == "last") { $page = $pages; }
if($page > $pages || $page <= 0) { $page = 1; }
if($page) { $start = ($page-1) * $perpage; } else { $start = 0; $page = 1; }
$multipage = multipage($unapproved_threads, $perpage, $page, "modcp.php?action=modqueue&type=threads");
| $pages = ceil($pages);
if($mybb->get_input('page') == "last") { $page = $pages; }
if($page > $pages || $page <= 0) { $page = 1; }
if($page) { $start = ($page-1) * $perpage; } else { $start = 0; $page = 1; }
$multipage = multipage($unapproved_threads, $perpage, $page, "modcp.php?action=modqueue&type=threads");
|
$query = $db->query(" SELECT t.tid, t.dateline, t.fid, t.subject, t.username AS threadusername, p.message AS postmessage, u.username AS username, t.uid FROM ".TABLE_PREFIX."threads t
| $query = $db->query(" SELECT t.tid, t.dateline, t.fid, t.subject, t.username AS threadusername, p.message AS postmessage, u.username AS username, t.uid FROM ".TABLE_PREFIX."threads t
|
Zeile 2194 | Zeile 2179 |
---|
$forum_link = get_forum_link($thread['fid']); $forum_name = $forum_cache[$thread['fid']]['name']; $threaddate = my_date('relative', $thread['dateline']);
|
$forum_link = get_forum_link($thread['fid']); $forum_name = $forum_cache[$thread['fid']]['name']; $threaddate = my_date('relative', $thread['dateline']);
|
|
|
if($thread['username'] == "") { if($thread['threadusername'] != "")
| if($thread['username'] == "") { if($thread['threadusername'] != "")
|
Zeile 2211 | Zeile 2196 |
---|
{ $thread['username'] = htmlspecialchars_uni($thread['username']); $profile_link = build_profile_link($thread['username'], $thread['uid']);
|
{ $thread['username'] = htmlspecialchars_uni($thread['username']); $profile_link = build_profile_link($thread['username'], $thread['uid']);
|
}
| }
|
$thread['postmessage'] = nl2br(htmlspecialchars_uni($thread['postmessage'])); eval("\$forum = \"".$templates->get("modcp_modqueue_link_forum")."\";"); eval("\$threads .= \"".$templates->get("modcp_modqueue_threads_thread")."\";");
| $thread['postmessage'] = nl2br(htmlspecialchars_uni($thread['postmessage'])); eval("\$forum = \"".$templates->get("modcp_modqueue_link_forum")."\";"); eval("\$threads .= \"".$templates->get("modcp_modqueue_threads_thread")."\";");
|
Zeile 2221 | Zeile 2206 |
---|
if(!$threads && $mybb->input['type'] == "threads") { eval("\$threads = \"".$templates->get("modcp_modqueue_threads_empty")."\";");
|
if(!$threads && $mybb->input['type'] == "threads") { eval("\$threads = \"".$templates->get("modcp_modqueue_threads_empty")."\";");
|
}
| }
|
if($threads) { add_breadcrumb($lang->mcp_nav_modqueue_threads, "modcp.php?action=modqueue&type=threads");
|
if($threads) { add_breadcrumb($lang->mcp_nav_modqueue_threads, "modcp.php?action=modqueue&type=threads");
|
|
|
$plugins->run_hooks("modcp_modqueue_threads_end");
if($nummodqueueposts > 0 || $mybb->usergroup['issupermod'] == 1)
|
$plugins->run_hooks("modcp_modqueue_threads_end");
if($nummodqueueposts > 0 || $mybb->usergroup['issupermod'] == 1)
|
{ $navsep = " | ";
| { $navsep = " | ";
|
eval("\$post_link = \"".$templates->get("modcp_modqueue_post_link")."\";");
|
eval("\$post_link = \"".$templates->get("modcp_modqueue_post_link")."\";");
|
}
| }
|
if($mybb->settings['enableattachments'] == 1 && ($nummodqueueattach > 0 || $mybb->usergroup['issupermod'] == 1)) { $navsep = " | "; eval("\$attachment_link = \"".$templates->get("modcp_modqueue_attachment_link")."\";"); }
|
if($mybb->settings['enableattachments'] == 1 && ($nummodqueueattach > 0 || $mybb->usergroup['issupermod'] == 1)) { $navsep = " | "; eval("\$attachment_link = \"".$templates->get("modcp_modqueue_attachment_link")."\";"); }
|
|
|
eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";"); eval("\$threadqueue = \"".$templates->get("modcp_modqueue_threads")."\";"); output_page($threadqueue);
| eval("\$mass_controls = \"".$templates->get("modcp_modqueue_masscontrols")."\";"); eval("\$threadqueue = \"".$templates->get("modcp_modqueue_threads")."\";"); output_page($threadqueue);
|
Zeile 2249 | Zeile 2234 |
---|
}
if($mybb->input['type'] == "posts" || (!$mybb->input['type'] && !$threadqueue && ($nummodqueueposts > 0 || $mybb->usergroup['issupermod'] == 1)))
|
}
if($mybb->input['type'] == "posts" || (!$mybb->input['type'] && !$threadqueue && ($nummodqueueposts > 0 || $mybb->usergroup['issupermod'] == 1)))
|
{
| {
|
if($nummodqueueposts == 0 && $mybb->usergroup['issupermod'] != 1) { error($lang->you_cannot_moderate_posts);
| if($nummodqueueposts == 0 && $mybb->usergroup['issupermod'] != 1) { error($lang->you_cannot_moderate_posts);
|
Zeile 2303 | Zeile 2288 |
---|
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid) WHERE p.visible='0' {$tflist_queue_posts} AND t.firstpost != p.pid
|
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid) WHERE p.visible='0' {$tflist_queue_posts} AND t.firstpost != p.pid
|
ORDER BY p.dateline DESC
| ORDER BY p.dateline DESC, p.pid DESC
|
LIMIT {$start}, {$perpage} "); $posts = '';
| LIMIT {$start}, {$perpage} "); $posts = '';
|
Zeile 2473 | Zeile 2458 |
---|
if($nummodqueuethreads > 0 || $mybb->usergroup['issupermod'] == 1) { eval("\$thread_link = \"".$templates->get("modcp_modqueue_thread_link")."\";");
|
if($nummodqueuethreads > 0 || $mybb->usergroup['issupermod'] == 1) { eval("\$thread_link = \"".$templates->get("modcp_modqueue_thread_link")."\";");
|
$navsep = " | ";
| $navsep = " | ";
|
}
if($nummodqueueposts > 0 || $mybb->usergroup['issupermod'] == 1)
| }
if($nummodqueueposts > 0 || $mybb->usergroup['issupermod'] == 1)
|
Zeile 2492 | Zeile 2477 |
---|
if(!$threadqueue && !$postqueue && !$attachmentqueue) { add_breadcrumb($lang->mcp_nav_modqueue, "modcp.php?action=modqueue");
|
if(!$threadqueue && !$postqueue && !$attachmentqueue) { add_breadcrumb($lang->mcp_nav_modqueue, "modcp.php?action=modqueue");
|
|
|
$plugins->run_hooks("modcp_modqueue_end");
eval("\$queue = \"".$templates->get("modcp_modqueue_empty")."\";");
| $plugins->run_hooks("modcp_modqueue_end");
eval("\$queue = \"".$templates->get("modcp_modqueue_empty")."\";");
|
Zeile 2503 | 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) {
|
Zeile 2512 | Zeile 2497 |
---|
$user = get_user($mybb->input['uid']); if(!$user)
|
$user = get_user($mybb->input['uid']); if(!$user)
|
{
| {
|
error($lang->error_nomember);
|
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");
if($mybb->get_input('away', MyBB::INPUT_INT) == 1 && $mybb->settings['allowaway'] != 0)
| $plugins->run_hooks("modcp_do_editprofile_start");
if($mybb->get_input('away', MyBB::INPUT_INT) == 1 && $mybb->settings['allowaway'] != 0)
|
Zeile 2531 | Zeile 2516 |
---|
{ // If the user has indicated that they will return on a specific day, but not month or year, assume it is current month and year if(!$mybb->get_input('awaymonth', MyBB::INPUT_INT))
|
{ // If the user has indicated that they will return on a specific day, but not month or year, assume it is current month and year if(!$mybb->get_input('awaymonth', MyBB::INPUT_INT))
|
{
| {
|
$mybb->input['awaymonth'] = my_date('n', $awaydate); } if(!$mybb->get_input('awayyear', MyBB::INPUT_INT))
| $mybb->input['awaymonth'] = my_date('n', $awaydate); } if(!$mybb->get_input('awayyear', MyBB::INPUT_INT))
|
Zeile 2549 | Zeile 2534 |
---|
if($return_year < my_date('Y', $awaydate) || ($returntimestamp < $awaytimestamp && $return_year == my_date('Y', $awaydate))) { error($lang->error_modcp_return_date_past);
|
if($return_year < my_date('Y', $awaydate) || ($returntimestamp < $awaytimestamp && $return_year == my_date('Y', $awaydate))) { error($lang->error_modcp_return_date_past);
|
}
| }
|
$returndate = "{$return_day}-{$return_month}-{$return_year}";
|
$returndate = "{$return_day}-{$return_month}-{$return_year}";
|
}
| }
|
else { $returndate = ""; }
|
else { $returndate = ""; }
|
$away = array(
| $away = array(
|
"away" => 1, "date" => $awaydate, "returndate" => $returndate,
| "away" => 1, "date" => $awaydate, "returndate" => $returndate,
|
Zeile 2565 | Zeile 2550 |
---|
); } else
|
); } else
|
{
| {
|
$away = array( "away" => 0, "date" => '', "returndate" => '', "awayreason" => '' );
|
$away = array( "away" => 0, "date" => '', "returndate" => '', "awayreason" => '' );
|
}
| }
|
// Set up user handler. require_once MYBB_ROOT."inc/datahandlers/user.php"; $userhandler = new UserDataHandler('update');
| // Set up user handler. require_once MYBB_ROOT."inc/datahandlers/user.php"; $userhandler = new UserDataHandler('update');
|
Zeile 2584 | 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'), "aim" => $mybb->get_input('aim'), "yahoo" => $mybb->get_input('yahoo'),
| |
"skype" => $mybb->get_input('skype'), "google" => $mybb->get_input('google'), "signature" => $mybb->get_input('signature'), "usernotes" => $mybb->get_input('usernotes'), "away" => $away
|
"skype" => $mybb->get_input('skype'), "google" => $mybb->get_input('google'), "signature" => $mybb->get_input('signature'), "usernotes" => $mybb->get_input('usernotes'), "away" => $away
|
);
| );
|
$updated_user['birthday'] = array( "day" => $mybb->get_input('birthday_day', MyBB::INPUT_INT),
| $updated_user['birthday'] = array( "day" => $mybb->get_input('birthday_day', MyBB::INPUT_INT),
|
Zeile 2607 | Zeile 2589 |
---|
else if(!empty($mybb->input['reverttitle'])) { $updated_user['usertitle'] = '';
|
else if(!empty($mybb->input['reverttitle'])) { $updated_user['usertitle'] = '';
|
}
| }
|
if(!empty($mybb->input['remove_avatar'])) { $updated_user['avatarurl'] = '';
| if(!empty($mybb->input['remove_avatar'])) { $updated_user['avatarurl'] = '';
|
Zeile 2616 | Zeile 2598 |
---|
// Set the data of the user in the datahandler. $userhandler->set_data($updated_user);
|
// Set the data of the user in the datahandler. $userhandler->set_data($updated_user);
|
$errors = '';
| $errors = array();
|
// 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 2665 | Zeile 2647 |
---|
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) {
|
$mybb->input[$option['time']] = $mybb->get_input($option['time'], MyBB::INPUT_INT);
| ${$option['time']} = $mybb->get_input($option['time'], MyBB::INPUT_INT);
|
$mybb->input[$option['period']] = $mybb->get_input($option['period']); if(empty($mybb->input[$option['action']])) {
| $mybb->input[$option['period']] = $mybb->get_input($option['period']); if(empty($mybb->input[$option['action']])) {
|
Zeile 2688 | Zeile 2670 |
---|
$string = $option['action']."_error"; $errors[] = $lang->$string; }
|
$string = $option['action']."_error"; $errors[] = $lang->$string; }
|
if(!is_array($errors))
| else
|
{ $suspend_length = fetch_time_length((int)$mybb->input[$option['time']], $mybb->input[$option['period']]);
| { $suspend_length = fetch_time_length((int)$mybb->input[$option['time']], $mybb->input[$option['period']]);
|
Zeile 2704 | Zeile 2685 |
---|
elseif($suspend_length && $suspend_length != "-1") { // Temporary ban on action
|
elseif($suspend_length && $suspend_length != "-1") { // 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']])
| } } elseif(!$user[$option['update_field']])
|
Zeile 2714 | Zeile 2695 |
---|
if($suspend_length == "-1") { $extra_user_updates[$option['update_length']] = 0;
|
if($suspend_length == "-1") { $extra_user_updates[$option['update_length']] = 0;
|
}
| }
|
else { $extra_user_updates[$option['update_length']] = TIME_NOW + $suspend_length; } } }
|
else { $extra_user_updates[$option['update_length']] = TIME_NOW + $suspend_length; } } }
|
} }
| } }
|
// Those with javascript turned off will be able to select both - cheeky! // Check to make sure we're not moderating AND suspending posting
|
// Those with javascript turned off will be able to select both - cheeky! // Check to make sure we're not moderating AND suspending posting
|
if(isset($extra_user_updates) && $extra_user_updates['moderateposts'] && $extra_user_updates['suspendposting']) {
| if(isset($extra_user_updates) && !empty($extra_user_updates['moderateposts']) && !empty($extra_user_updates['suspendposting'])) {
|
$errors[] = $lang->suspendmoderate_error; }
|
$errors[] = $lang->suspendmoderate_error; }
|
if(is_array($errors))
| if(is_array($errors) && !empty($errors))
|
{ $mybb->input['action'] = "editprofile";
|
{ $mybb->input['action'] = "editprofile";
|
}
| }
|
else { $plugins->run_hooks("modcp_do_editprofile_update");
| else { $plugins->run_hooks("modcp_do_editprofile_update");
|
Zeile 2753 | Zeile 2734 |
---|
} } }
|
} } }
|
|
|
if($mybb->input['action'] == "editprofile") { if($mybb->usergroup['caneditprofiles'] == 0)
|
if($mybb->input['action'] == "editprofile") { if($mybb->usergroup['caneditprofiles'] == 0)
|
{ error_no_permission(); }
add_breadcrumb($lang->mcp_nav_editprofile, "modcp.php?action=editprofile");
| { error_no_permission(); }
add_breadcrumb($lang->mcp_nav_editprofile, "modcp.php?action=editprofile");
|
$user = get_user($mybb->get_input('uid', MyBB::INPUT_INT)); if(!$user) {
| $user = get_user($mybb->get_input('uid', MyBB::INPUT_INT)); if(!$user) {
|
Zeile 2771 | Zeile 2752 |
---|
// 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']))
|
{
| {
|
error_no_permission();
|
error_no_permission();
|
| }
$userperms = user_permissions($user['uid']);
// Set display group $displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");
if(!$user['displaygroup']) { $user['displaygroup'] = $user['usergroup']; }
$display_group = usergroup_displaygroup($user['displaygroup']); if(is_array($display_group)) { $userperms = array_merge($userperms, $display_group);
|
}
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 2805 | Zeile 2797 |
---|
}
// Sanitize all input
|
}
// Sanitize all input
|
foreach(array('usertitle', 'website', 'icq', 'aim', 'yahoo', '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)); }
|
// Custom user title, check to see if we have a default group title if(!$user['displaygroup']) { $user['displaygroup'] = $user['usergroup']; }
$displaygroupfields = array('usertitle'); $display_group = usergroup_displaygroup($user['displaygroup']);
if(!empty($display_group['usertitle']))
| // Custom user title if(!empty($userperms['usertitle']))
|
{
|
{
|
$defaulttitle = htmlspecialchars_uni($display_group['usertitle']);
| $defaulttitle = htmlspecialchars_uni($userperms['usertitle']);
|
} else {
| } else {
|
Zeile 2832 | Zeile 2816 |
---|
{ if($title['posts'] <= $user['postnum']) {
|
{ if($title['posts'] <= $user['postnum']) {
|
$defaulttitle = $title['title'];
| $defaulttitle = htmlspecialchars_uni($title['title']);
|
break; }
|
break; }
|
} }
| } }
|
$user['usertitle'] = htmlspecialchars_uni($user['usertitle']);
if(empty($user['usertitle']))
|
$user['usertitle'] = htmlspecialchars_uni($user['usertitle']);
if(empty($user['usertitle']))
|
{
| {
|
$lang->current_custom_usertitle = ''; }
| $lang->current_custom_usertitle = ''; }
|
Zeile 2851 | Zeile 2835 |
---|
if($mybb->input['birthday_day'] == $day) { $selected = "selected=\"selected\"";
|
if($mybb->input['birthday_day'] == $day) { $selected = "selected=\"selected\"";
|
}
| }
|
else { $selected = ''; }
|
else { $selected = ''; }
|
|
|
eval("\$bdaydaysel .= \"".$templates->get("usercp_profile_day")."\";"); }
$bdaymonthsel = array(); foreach(range(1, 12) as $month)
|
eval("\$bdaydaysel .= \"".$templates->get("usercp_profile_day")."\";"); }
$bdaymonthsel = array(); foreach(range(1, 12) as $month)
|
{
| {
|
$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 2938 | Zeile 2924 |
---|
$plugins->run_hooks("modcp_editprofile_start");
// Fetch profile fields
|
$plugins->run_hooks("modcp_editprofile_start");
// Fetch profile fields
|
| $user_fields = array();
|
$query = $db->simple_select("userfields", "*", "ufid='{$user['uid']}'");
|
$query = $db->simple_select("userfields", "*", "ufid='{$user['uid']}'");
|
$user_fields = $db->fetch_array($query);
| if($db->num_rows($query) > 0) { $user_fields = $db->fetch_array($query); }
|
$requiredfields = ''; $customfields = ''; $mybb->input['profile_fields'] = $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY);
|
$requiredfields = ''; $customfields = ''; $mybb->input['profile_fields'] = $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY);
|
|
|
$pfcache = $cache->read('profilefields');
|
$pfcache = $cache->read('profilefields');
|
|
|
if(is_array($pfcache)) { foreach($pfcache as $profilefield)
| if(is_array($pfcache)) { foreach($pfcache as $profilefield)
|
Zeile 2964 | Zeile 2954 |
---|
} $field = "fid{$profilefield['fid']}"; if($errors)
|
} $field = "fid{$profilefield['fid']}"; if($errors)
|
{
| {
|
if(isset($mybb->input['profile_fields'][$field])) { $userfield = $mybb->input['profile_fields'][$field]; } }
|
if(isset($mybb->input['profile_fields'][$field])) { $userfield = $mybb->input['profile_fields'][$field]; } }
|
else
| elseif(isset($user_fields[$field]))
|
{ $userfield = $user_fields[$field]; }
| { $userfield = $user_fields[$field]; }
|
Zeile 2983 | Zeile 2973 |
---|
else { $useropts = explode("\n", $userfield);
|
else { $useropts = explode("\n", $userfield);
|
}
| }
|
if(is_array($useropts)) { foreach($useropts as $key => $val)
| if(is_array($useropts)) { foreach($useropts as $key => $val)
|
Zeile 3010 | Zeile 3000 |
---|
if(!$profilefield['length']) { $profilefield['length'] = 3;
|
if(!$profilefield['length']) { $profilefield['length'] = 3;
|
}
eval("\$code = \"".$templates->get("usercp_profile_profilefields_multiselect")."\";");
| }
eval("\$code = \"".$templates->get("usercp_profile_profilefields_multiselect")."\";");
|
} } elseif($type == "select")
| } } elseif($type == "select")
|
Zeile 3031 | Zeile 3021 |
---|
}
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;
|
Zeile 3049 | Zeile 3039 |
---|
{ $checked = ""; if($val == $userfield)
|
{ $checked = ""; if($val == $userfield)
|
{
| {
|
$checked = " checked=\"checked\""; }
| $checked = " checked=\"checked\""; }
|
Zeile 3068 | Zeile 3058 |
---|
$useropts = explode("\n", $userfield); } if(is_array($useropts))
|
$useropts = explode("\n", $userfield); } if(is_array($useropts))
|
{
| {
|
foreach($useropts as $key => $val) { $seloptions[$val] = $val;
| foreach($useropts as $key => $val) { $seloptions[$val] = $val;
|
Zeile 3086 | Zeile 3076 |
---|
}
eval("\$code .= \"".$templates->get("usercp_profile_profilefields_checkbox")."\";");
|
}
eval("\$code .= \"".$templates->get("usercp_profile_profilefields_checkbox")."\";");
|
}
| }
|
} } elseif($type == "textarea")
| } } elseif($type == "textarea")
|
Zeile 3199 | Zeile 3189 |
---|
$suspendsignature_info = $moderateposts_info = $suspendposting_info = ''; $action_options = $modpost_options = $suspost_options = '';
|
$suspendsignature_info = $moderateposts_info = $suspendposting_info = ''; $action_options = $modpost_options = $suspost_options = '';
|
| $modopts = array();
|
foreach($moderator_options as $option) {
|
foreach($moderator_options as $option) {
|
$mybb->input[$option['time']] = $mybb->get_input($option['time'], MyBB::INPUT_INT);
| ${$option['time']} = $mybb->get_input($option['time'], MyBB::INPUT_INT);
|
// Display the suspension info, if this user has this option suspended if($user[$option['option']]) {
| // Display the suspension info, if this user has this option suspended if($user[$option['option']]) {
|
Zeile 3236 | Zeile 3227 |
---|
// Generate the boxes for this option $selection_options = ''; foreach($periods as $key => $value)
|
// Generate the boxes for this option $selection_options = ''; foreach($periods as $key => $value)
|
{
| {
|
$string = $option['select_option']."_period"; if($mybb->get_input($string) == $key) { $selected = "selected=\"selected\"";
|
$string = $option['select_option']."_period"; if($mybb->get_input($string) == $key) { $selected = "selected=\"selected\"";
|
}
| }
|
else { $selected = '';
| else { $selected = '';
|
Zeile 3263 | Zeile 3254 |
---|
eval("\$suspost_options = \"".$templates->get("modcp_editprofile_select")."\";"); break; }
|
eval("\$suspost_options = \"".$templates->get("modcp_editprofile_select")."\";"); break; }
|
}
| }
|
eval("\$suspend_signature = \"".$templates->get("modcp_editprofile_signature")."\";");
$user['usernotes'] = htmlspecialchars_uni($user['usernotes']);
|
eval("\$suspend_signature = \"".$templates->get("modcp_editprofile_signature")."\";");
$user['usernotes'] = htmlspecialchars_uni($user['usernotes']);
|
|
|
if(!isset($newtitle)) { $newtitle = ''; }
|
if(!isset($newtitle)) { $newtitle = ''; }
|
| $birthday_year = $mybb->input['birthday_year']; $user_website = $mybb->input['website']; $user_skype = $mybb->input['skype']; $user_google = $mybb->input['google'];
|
$plugins->run_hooks("modcp_editprofile_end");
| $plugins->run_hooks("modcp_editprofile_end");
|
Zeile 3395 | 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 3420 | Zeile 3415 |
---|
$plugins->run_hooks("modcp_finduser_end");
|
$plugins->run_hooks("modcp_finduser_end");
|
| $username = htmlspecialchars_uni($mybb->get_input('username'));
|
eval("\$finduser = \"".$templates->get("modcp_finduser")."\";"); output_page($finduser); }
| eval("\$finduser = \"".$templates->get("modcp_finduser")."\";"); output_page($finduser); }
|
Zeile 3534 | Zeile 3530 |
---|
else { $ordersel['asc'] = ' selected="selected"';
|
else { $ordersel['asc'] = ' selected="selected"';
|
}
$plugins->run_hooks("modcp_warninglogs_start");
| }
$plugins->run_hooks("modcp_warninglogs_start");
|
// Pagination stuff $sql = " SELECT COUNT(wid) as count FROM ".TABLE_PREFIX."warnings w
|
// Pagination stuff $sql = " SELECT COUNT(wid) as count FROM ".TABLE_PREFIX."warnings w
|
LEFT JOIN ".TABLE_PREFIX."warningtypes t ON (w.tid=t.tid) WHERE 1=1 {$where_sql} "; $query = $db->query($sql);
| LEFT JOIN ".TABLE_PREFIX."warningtypes t ON (w.tid=t.tid) WHERE 1=1 {$where_sql} "; $query = $db->query($sql);
|
$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)
|
Zeile 3555 | Zeile 3551 |
---|
$page = 1; } $per_page = 20;
|
$page = 1; } $per_page = 20;
|
if(isset($mybb->input['filter']['per_page']) && (int)$mybb->input['filter']['per_page'] > 0) {
| if(isset($mybb->input['filter']['per_page']) && (int)$mybb->input['filter']['per_page'] > 0) {
|
$per_page = (int)$mybb->input['filter']['per_page'];
|
$per_page = (int)$mybb->input['filter']['per_page'];
|
}
| }
|
$start = ($page-1) * $per_page;
|
$start = ($page-1) * $per_page;
|
| $pages = ceil($total_warnings / $per_page); if($page > $pages) { $start = 0; $page = 1; }
|
// Build the base URL for pagination links $url = 'modcp.php?action=warninglogs'; if(is_array($mybb->input['filter']) && count($mybb->input['filter'])) { foreach($mybb->input['filter'] as $field => $value)
|
// Build the base URL for pagination links $url = 'modcp.php?action=warninglogs'; if(is_array($mybb->input['filter']) && count($mybb->input['filter'])) { foreach($mybb->input['filter'] as $field => $value)
|
{
| {
|
$value = urlencode($value); $url .= "&filter[{$field}]={$value}"; }
| $value = urlencode($value); $url .= "&filter[{$field}]={$value}"; }
|
Zeile 3611 | Zeile 3613 |
---|
if($row['expires'] > 0) { $expire_date = nice_time($row['expires']-TIME_NOW);
|
if($row['expires'] > 0) { $expire_date = nice_time($row['expires']-TIME_NOW);
|
}
| }
|
else { $expire_date = $lang->never;
| else { $expire_date = $lang->never;
|
Zeile 3636 | Zeile 3638 |
---|
}
$plugins->run_hooks("modcp_warninglogs_end");
|
}
$plugins->run_hooks("modcp_warninglogs_end");
|
| $filter_username = $mybb->input['filter']['username']; $filter_modusername = $mybb->input['filter']['mod_username']; $filter_reason = $mybb->input['filter']['reason'];
|
eval("\$warninglogs = \"".$templates->get("modcp_warninglogs")."\";"); output_page($warninglogs);
| eval("\$warninglogs = \"".$templates->get("modcp_warninglogs")."\";"); output_page($warninglogs);
|
Zeile 3650 | Zeile 3656 |
---|
add_breadcrumb($lang->mcp_nav_ipsearch, "modcp.php?action=ipsearch");
|
add_breadcrumb($lang->mcp_nav_ipsearch, "modcp.php?action=ipsearch");
|
| $ipsearch_results = $ipaddressvalue = '';
|
$mybb->input['ipaddress'] = $mybb->get_input('ipaddress'); if($mybb->input['ipaddress']) {
| $mybb->input['ipaddress'] = $mybb->get_input('ipaddress'); if($mybb->input['ipaddress']) {
|
Zeile 3667 | Zeile 3674 |
---|
// 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 3685 | Zeile 3693 |
---|
{ $where_sql = '';
|
{ $where_sql = '';
|
$unviewable_forums = get_unviewable_forums(true);
| $unviewable_forums = get_unviewable_forums(true);
|
if($unviewable_forums) { $where_sql .= " AND p.fid NOT IN ({$unviewable_forums})";
| if($unviewable_forums) { $where_sql .= " AND p.fid NOT IN ({$unviewable_forums})";
|
Zeile 3761 | Zeile 3769 |
---|
// 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 3835 | Zeile 3844 |
---|
} } $multipage = multipage($total_results, $perpage, $page, $page_url);
|
} } $multipage = multipage($total_results, $perpage, $page, $page_url);
|
|
|
$post_limit = $perpage; $results = ''; if(isset($mybb->input['search_users']) && $user_results && $start <= $user_results)
| $post_limit = $perpage; $results = ''; if(isset($mybb->input['search_users']) && $user_results && $start <= $user_results)
|
Zeile 3872 | Zeile 3881 |
---|
{ eval("\$subject = \"".$templates->get("modcp_ipsearch_result_lastip")."\";"); $ip = my_inet_ntop($db->unescape_binary($ipaddress['lastip']));
|
{ eval("\$subject = \"".$templates->get("modcp_ipsearch_result_lastip")."\";"); $ip = my_inet_ntop($db->unescape_binary($ipaddress['lastip']));
|
}
| }
|
if($ip)
|
if($ip)
|
{
| {
|
eval("\$results .= \"".$templates->get("modcp_ipsearch_result")."\";"); $result = true;
|
eval("\$results .= \"".$templates->get("modcp_ipsearch_result")."\";"); $result = true;
|
}
| }
|
if($result) { --$post_limit; }
|
if($result) { --$post_limit; }
|
}
| }
|
} $post_start = 0; if($total_results > $user_results && $post_limit)
| } $post_start = 0; if($total_results > $user_results && $post_limit)
|
Zeile 3902 | Zeile 3911 |
---|
FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = p.tid) WHERE {$post_ip_sql}{$where_sql}{$visible_sql}
|
FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = p.tid) WHERE {$post_ip_sql}{$where_sql}{$visible_sql}
|
ORDER BY p.dateline desc
| ORDER BY p.dateline DESC, p.pid DESC
|
LIMIT {$post_start}, {$post_limit} "); while($ipaddress = $db->fetch_array($query))
| LIMIT {$post_start}, {$post_limit} "); while($ipaddress = $db->fetch_array($query))
|
Zeile 3910 | Zeile 3919 |
---|
$tids[$ipaddress['tid']] = $ipaddress['pid']; $uids[$ipaddress['uid']] = $ipaddress['pid']; $ipaddresses[$ipaddress['pid']] = $ipaddress;
|
$tids[$ipaddress['tid']] = $ipaddress['pid']; $uids[$ipaddress['uid']] = $ipaddress['pid']; $ipaddresses[$ipaddress['pid']] = $ipaddress;
|
}
| }
|
if(!empty($ipaddresses)) {
| if(!empty($ipaddresses)) {
|
Zeile 3931 | Zeile 3940 |
---|
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 4206 | Zeile 4215 |
---|
// Permission to edit this ban? if($mybb->user['uid'] != $ban['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
|
// Permission to edit this ban? if($mybb->user['uid'] != $ban['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
|
{ error_no_permission(); }
| { error_no_permission(); }
|
$plugins->run_hooks("modcp_liftban_start");
$query = $db->simple_select("users", "username", "uid = '{$ban['uid']}'");
| $plugins->run_hooks("modcp_liftban_start");
$query = $db->simple_select("users", "username", "uid = '{$ban['uid']}'");
|
Zeile 4217 | Zeile 4226 |
---|
$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(); log_moderator_action(array("uid" => $ban['uid'], "username" => $username), $lang->lifted_ban);
| $cache->update_moderators(); log_moderator_action(array("uid" => $ban['uid'], "username" => $username), $lang->lifted_ban);
|
Zeile 4243 | Zeile 4251 |
---|
}
// Editing an existing ban
|
}
// Editing an existing ban
|
| $existing_ban = false;
|
if($mybb->get_input('uid', MyBB::INPUT_INT)) { // Get the users info from their uid
| if($mybb->get_input('uid', MyBB::INPUT_INT)) { // Get the users info from their uid
|
Zeile 4254 | Zeile 4263 |
---|
"); $user = $db->fetch_array($query);
|
"); $user = $db->fetch_array($query);
|
$existing_ban = false; if($user['uid'])
| if($user)
|
{ $existing_ban = true; }
| { $existing_ban = true; }
|
Zeile 4278 | Zeile 4286 |
---|
);
$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 4288 | Zeile 4296 |
---|
if($user['uid'] == $mybb->user['uid']) { $errors[] = $lang->error_cannotbanself;
|
if($user['uid'] == $mybb->user['uid']) { $errors[] = $lang->error_cannotbanself;
|
}
| }
|
// Have permissions to ban this user? if(!modcp_can_manage_user($user['uid']))
| // Have permissions to ban this user? if(!modcp_can_manage_user($user['uid']))
|
Zeile 4298 | Zeile 4306 |
---|
// Check for an incoming reason if(empty($mybb->input['banreason']))
|
// Check for an incoming reason if(empty($mybb->input['banreason']))
|
{
| {
|
$errors[] = $lang->error_nobanreason;
|
$errors[] = $lang->error_nobanreason;
|
}
| }
|
// 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;
|
}
| }
|
// If this is a new ban, we check the user isn't already part of a banned group if(!$existing_ban && $user['uid']) {
|
// If this is a new ban, we check the user isn't already part of a banned group if(!$existing_ban && $user['uid']) {
|
$query = $db->simple_select("banned", "uid", "uid='{$user['uid']}'"); if($db->fetch_field($query, "uid"))
| $query = $db->simple_select("banned", "uid", "uid='{$user['uid']}'", array('limit' => 1)); if($db->num_rows($query) > 0)
|
{ $errors[] = $lang->error_useralreadybanned; }
| { $errors[] = $lang->error_useralreadybanned; }
|
Zeile 4330 | Zeile 4341 |
---|
if($mybb->get_input('liftafter') == '---') { $lifted = 0;
|
if($mybb->get_input('liftafter') == '---') { $lifted = 0;
|
}
| }
|
else { if(!isset($user['dateline']))
| else { if(!isset($user['dateline']))
|
Zeile 4338 | Zeile 4349 |
---|
$user['dateline'] = 0; } $lifted = ban_date2timestamp($mybb->get_input('liftafter'), $user['dateline']);
|
$user['dateline'] = 0; } $lifted = ban_date2timestamp($mybb->get_input('liftafter'), $user['dateline']);
|
}
| }
|
$banreason = my_substr($mybb->get_input('banreason'), 0, 255);
if($existing_ban) { $update_array = array(
|
$banreason = my_substr($mybb->get_input('banreason'), 0, 255);
if($existing_ban) { $update_array = array(
|
'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT), 'dateline' => TIME_NOW, 'bantime' => $db->escape_string($mybb->get_input('liftafter')), 'lifted' => $db->escape_string($lifted), 'reason' => $db->escape_string($banreason)
| 'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT), 'dateline' => TIME_NOW, 'bantime' => $db->escape_string($mybb->get_input('liftafter')), 'lifted' => $db->escape_string($lifted), 'reason' => $db->escape_string($banreason)
|
);
$db->update_query('banned', $update_array, "uid='{$user['uid']}'");
| );
$db->update_query('banned', $update_array, "uid='{$user['uid']}'");
|
Zeile 4360 | Zeile 4371 |
---|
'uid' => $user['uid'], 'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT), 'oldgroup' => (int)$user['usergroup'],
|
'uid' => $user['uid'], 'gid' => $mybb->get_input('usergroup', MyBB::INPUT_INT), 'oldgroup' => (int)$user['usergroup'],
|
'oldadditionalgroups' => (string)$user['additionalgroups'],
| 'oldadditionalgroups' => $db->escape_string($user['additionalgroups']),
|
'olddisplaygroup' => (int)$user['displaygroup'], 'admin' => (int)$mybb->user['uid'], 'dateline' => TIME_NOW,
| 'olddisplaygroup' => (int)$user['displaygroup'], 'admin' => (int)$mybb->user['uid'], 'dateline' => TIME_NOW,
|
Zeile 4368 | Zeile 4379 |
---|
'lifted' => $db->escape_string($lifted), 'reason' => $db->escape_string($banreason) );
|
'lifted' => $db->escape_string($lifted), 'reason' => $db->escape_string($banreason) );
|
|
|
$db->insert_query('banned', $insert_array); }
| $db->insert_query('banned', $insert_array); }
|
Zeile 4379 | Zeile 4390 |
---|
'additionalgroups' => '', ); $db->update_query('users', $update_array, "uid = {$user['uid']}");
|
'additionalgroups' => '', ); $db->update_query('users', $update_array, "uid = {$user['uid']}");
|
$cache->update_banned();
| |
// Log edit or add ban if($existing_ban)
| // Log edit or add ban if($existing_ban)
|
Zeile 4444 | Zeile 4453 |
---|
WHERE b.uid='{$mybb->input['uid']}' "); $banned = $db->fetch_array($query);
|
WHERE b.uid='{$mybb->input['uid']}' "); $banned = $db->fetch_array($query);
|
if($banned['username'])
| if(!empty($banned['username']))
|
{ $username = $banned['username'] = htmlspecialchars_uni($banned['username']); $banreason = htmlspecialchars_uni($banned['reason']);
| { $username = $banned['username'] = htmlspecialchars_uni($banned['username']); $banreason = htmlspecialchars_uni($banned['reason']);
|
Zeile 4456 | Zeile 4465 |
---|
}
// Permission to edit this ban?
|
}
// Permission to edit this ban?
|
if($banned['uid'] && $mybb->user['uid'] != $banned['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
| if(!empty($banned) && $banned['uid'] && $mybb->user['uid'] != $banned['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 4520 | Zeile 4529 |
---|
$groupscache = $cache->read("usergroups");
foreach($groupscache as $key => $group)
|
$groupscache = $cache->read("usergroups");
foreach($groupscache as $key => $group)
|
{
| {
|
if($group['isbannedgroup']) { $selected = "";
| if($group['isbannedgroup']) { $selected = "";
|
Zeile 4656 | Zeile 4665 |
---|
FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE p.visible='0' {$tflist} AND t.firstpost != p.pid
|
FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE p.visible='0' {$tflist} AND t.firstpost != p.pid
|
ORDER BY p.dateline DESC
| ORDER BY p.dateline DESC, p.pid DESC
|
LIMIT 1 "); $post = $db->fetch_array($query);
| LIMIT 1 "); $post = $db->fetch_array($query);
|
Zeile 4744 | Zeile 4753 |
---|
$modlogresults = ''; while($logitem = $db->fetch_array($query))
|
$modlogresults = ''; while($logitem = $db->fetch_array($query))
|
{
| {
|
$information = ''; $logitem['action'] = htmlspecialchars_uni($logitem['action']); $log_date = my_date('relative', $logitem['dateline']);
| $information = ''; $logitem['action'] = htmlspecialchars_uni($logitem['action']); $log_date = my_date('relative', $logitem['dateline']);
|
Zeile 4776 | Zeile 4785 |
---|
if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject']) { $data = my_unserialize($logitem['data']);
|
if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject']) { $data = my_unserialize($logitem['data']);
|
if($data['uid'])
| if(isset($data['uid']))
|
{ $information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid'])); }
|
{ $information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid'])); }
|
if($data['aid'])
| if(isset($data['aid']))
|
{ $data['subject'] = htmlspecialchars_uni($parser->parse_badwords($data['subject'])); $data['announcement'] = get_announcement_link($data['aid']);
| { $data['subject'] = htmlspecialchars_uni($parser->parse_badwords($data['subject'])); $data['announcement'] = get_announcement_link($data['aid']);
|
Zeile 4895 | Zeile 4904 |
---|
eval("\$bannedusers = \"".$templates->get("modcp_nobanned")."\";"); }
|
eval("\$bannedusers = \"".$templates->get("modcp_nobanned")."\";"); }
|
$modnotes = $cache->read("modnotes"); $modnotes = htmlspecialchars_uni($modnotes['modmessage']);
| $modnotes = ''; $modnotes_cache = $cache->read("modnotes"); if($modnotes_cache !== false) { $modnotes = htmlspecialchars_uni($modnotes_cache['modmessage']); }
|
$plugins->run_hooks("modcp_end");
| $plugins->run_hooks("modcp_end");
|