Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: modcp.php 4038 2008-07-25 08:50:26Z dennis $
| * $Id: modcp.php 4111 2008-08-13 06:14:12Z Tikitiki $
|
*/
define("IN_MYBB", 1);
|
*/
define("IN_MYBB", 1);
|
| define('THIS_SCRIPT', 'modcp.php');
|
$templatelist = "modcp_reports,modcp_reports_report,modcp_reports_multipage,modcp_reports_allreport"; $templatelist .= ",modcp_reports_allnoreports,modcp_reports_noreports,modcp_banning,modcp_banning_ban";
| $templatelist = "modcp_reports,modcp_reports_report,modcp_reports_multipage,modcp_reports_allreport"; $templatelist .= ",modcp_reports_allnoreports,modcp_reports_noreports,modcp_banning,modcp_banning_ban";
|
Zeile 130 | Zeile 131 |
---|
$pages = ceil($pages);
if($mybb->input['page'] == "last")
|
$pages = ceil($pages);
if($mybb->input['page'] == "last")
|
|
|
{ $page = $pages; }
| { $page = $pages; }
|
Zeile 319 | Zeile 321 |
---|
if(!$allreports) { eval("\$allreports = \"".$templates->get("modcp_reports_allnoreports")."\";");
|
if(!$allreports) { eval("\$allreports = \"".$templates->get("modcp_reports_allnoreports")."\";");
|
}
| }
|
$plugins->run_hooks("modcp_reports");
eval("\$allreportedposts = \"".$templates->get("modcp_reports_allreports")."\";");
| $plugins->run_hooks("modcp_reports");
eval("\$allreportedposts = \"".$templates->get("modcp_reports_allreports")."\";");
|
Zeile 343 | Zeile 345 |
---|
if($mybb->input['uid']) { $where .= " AND l.uid='".intval($mybb->input['uid'])."'";
|
if($mybb->input['uid']) { $where .= " AND l.uid='".intval($mybb->input['uid'])."'";
|
}
| }
|
// Searching for entries in a specific forum if($mybb->input['fid'])
|
// Searching for entries in a specific forum if($mybb->input['fid'])
|
{
| {
|
$where .= " AND t.fid='".intval($mybb->input['fid'])."'"; }
| $where .= " AND t.fid='".intval($mybb->input['fid'])."'"; }
|
Zeile 356 | Zeile 358 |
---|
{ case "username": $sortby = "u.username";
|
{ case "username": $sortby = "u.username";
|
break;
| break;
|
case "forum": $sortby = "f.name";
|
case "forum": $sortby = "f.name";
|
break;
| break;
|
case "thread": $sortby = "t.subject"; break;
| case "thread": $sortby = "t.subject"; break;
|
Zeile 368 | Zeile 370 |
---|
} $order = $mybb->input['order']; if($order != "asc")
|
} $order = $mybb->input['order']; if($order != "asc")
|
{
| {
|
$order = "desc"; }
| $order = "desc"; }
|
Zeile 380 | Zeile 382 |
---|
WHERE 1=1 {$where} "); $rescount = $db->fetch_field($query, "count");
|
WHERE 1=1 {$where} "); $rescount = $db->fetch_field($query, "count");
|
|
|
// Figure out if we need to display multiple pages. if($mybb->input['page'] != "last") { $page = intval($mybb->input['page']); }
|
// Figure out if we need to display multiple pages. if($mybb->input['page'] != "last") { $page = intval($mybb->input['page']); }
|
|
|
$postcount = intval($rescount); $pages = $postcount / $perpage; $pages = ceil($pages);
if($mybb->input['page'] == "last")
|
$postcount = intval($rescount); $pages = $postcount / $perpage; $pages = ceil($pages);
if($mybb->input['page'] == "last")
|
{
| {
|
$page = $pages;
|
$page = $pages;
|
}
| }
|
if($page > $pages || $page <= 0)
|
if($page > $pages || $page <= 0)
|
{
| {
|
$page = 1; }
if($page) { $start = ($page-1) * $perpage;
|
$page = 1; }
if($page) { $start = ($page-1) * $perpage;
|
}
| }
|
else
|
else
|
{
| {
|
$start = 0; $page = 1;
|
$start = 0; $page = 1;
|
}
| }
|
$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=modlogs&perpage=$perpage&uid={$mybb->input['uid']}&fid={$mybb->input['fid']}&orderby=$mybb->input['sortby']&order={$mybb->input['order']}"); if($postcount > $perpage) { eval("\$resultspages = \"".$templates->get("modcp_modlogs_multipage")."\";");
|
$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=modlogs&perpage=$perpage&uid={$mybb->input['uid']}&fid={$mybb->input['fid']}&orderby=$mybb->input['sortby']&order={$mybb->input['order']}"); if($postcount > $perpage) { eval("\$resultspages = \"".$templates->get("modcp_modlogs_multipage")."\";");
|
} $query = $db->query("
| } $query = $db->query("
|
SELECT l.*, u.username, u.usergroup, u.displaygroup, t.subject AS tsubject, f.name AS fname, p.subject AS psubject FROM ".TABLE_PREFIX."moderatorlog l LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
| SELECT l.*, u.username, u.usergroup, u.displaygroup, t.subject AS tsubject, f.name AS fname, p.subject AS psubject FROM ".TABLE_PREFIX."moderatorlog l LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=l.uid)
|
Zeile 428 | Zeile 430 |
---|
LIMIT {$start}, {$perpage} "); while($logitem = $db->fetch_array($query))
|
LIMIT {$start}, {$perpage} "); while($logitem = $db->fetch_array($query))
|
{
| {
|
$information = ''; $log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']); $log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']);
| $information = ''; $log_date = my_date($mybb->settings['dateformat'], $logitem['dateline']); $log_time = my_date($mybb->settings['timeformat'], $logitem['dateline']);
|
Zeile 440 | Zeile 442 |
---|
$information = "<strong>{$lang->thread}</strong> <a href=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</a><br />"; } if($logitem['fname'])
|
$information = "<strong>{$lang->thread}</strong> <a href=\"".get_thread_link($logitem['tid'])."\" target=\"_blank\">".htmlspecialchars_uni($logitem['tsubject'])."</a><br />"; } if($logitem['fname'])
|
{
| {
|
$information .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($logitem['fid'])."\" target=\"_blank\">{$logitem['fname']}</a><br />";
|
$information .= "<strong>{$lang->forum}</strong> <a href=\"".get_forum_link($logitem['fid'])."\" target=\"_blank\">{$logitem['fname']}</a><br />";
|
}
| }
|
if($logitem['psubject']) { $information .= "<strong>{$lang->post}</strong> <a href=\"".get_post_link($logitem['pid'])."#pid{$logitem['pid']}\">".htmlspecialchars_uni($logitem['psubject'])."</a>";
| if($logitem['psubject']) { $information .= "<strong>{$lang->post}</strong> <a href=\"".get_post_link($logitem['pid'])."#pid{$logitem['pid']}\">".htmlspecialchars_uni($logitem['psubject'])."</a>";
|
Zeile 452 | Zeile 454 |
---|
}
if(!$results)
|
}
if(!$results)
|
{
| {
|
eval("\$results = \"".$templates->get("modcp_modlogs_noresults")."\";"); }
| eval("\$results = \"".$templates->get("modcp_modlogs_noresults")."\";"); }
|
Zeile 510 | Zeile 512 |
---|
}
if($mybb->input['action'] == "delete_announcement")
|
}
if($mybb->input['action'] == "delete_announcement")
|
{ $aid = intval($mybb->input['aid']);
| { $aid = intval($mybb->input['aid']);
|
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'"); $announcement = $db->fetch_array($query);
if(!$announcement['aid']) { error($lang->error_invalid_announcement);
|
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'"); $announcement = $db->fetch_array($query);
if(!$announcement['aid']) { error($lang->error_invalid_announcement);
|
}
| }
|
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid']))) { error_no_permission();
| if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid']))) { error_no_permission();
|
Zeile 534 | Zeile 536 |
---|
$announcement_fid = intval($mybb->input['fid']); if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid)))
|
$announcement_fid = intval($mybb->input['fid']); if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid)))
|
{
| {
|
error_no_permission();
|
error_no_permission();
|
}
| }
|
if(!trim($mybb->input['title'])) { $errors[] = $lang->error_missing_title;
|
if(!trim($mybb->input['title'])) { $errors[] = $lang->error_missing_title;
|
}
| }
|
if(!trim($mybb->input['message']))
|
if(!trim($mybb->input['message']))
|
{
| {
|
$errors[] = $lang->error_missing_message; }
if(!trim($mybb->input['fid'])) { $errors[] = $lang->error_missing_forum;
|
$errors[] = $lang->error_missing_message; }
if(!trim($mybb->input['fid'])) { $errors[] = $lang->error_missing_forum;
|
}
| }
|
$startdate = @explode(" ", $mybb->input['starttime_time']); $startdate = @explode(":", $startdate[0]); $enddate = @explode(" ", $mybb->input['endtime_time']); $enddate = @explode(":", $enddate[0]);
if(stristr($mybb->input['starttime_time'], "pm"))
|
$startdate = @explode(" ", $mybb->input['starttime_time']); $startdate = @explode(":", $startdate[0]); $enddate = @explode(" ", $mybb->input['endtime_time']); $enddate = @explode(":", $enddate[0]);
if(stristr($mybb->input['starttime_time'], "pm"))
|
{
| {
|
$startdate[0] = 12+$startdate[0]; if($startdate[0] >= 24) {
| $startdate[0] = 12+$startdate[0]; if($startdate[0] >= 24) {
|
Zeile 576 | Zeile 578 |
---|
} }
|
} }
|
$months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months)) { $mybb->input['starttime_month'] = 1; }
$startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year'])); if($startdate < 0 || $startdate == false) { $errors[] = $lang->error_invalid_start_date; }
if($mybb->input['endtime_type'] == "2") { $enddate = '0'; } else { if(!in_array($mybb->input['endtime_month'], $months)) { $mybb->input['endtime_month'] = 1; } $enddate = gmmktime($enddatehour, intval($mybb->input['endtime_time']), 0, (int)$mybb->input['endtime_month'], intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year'])); if($enddate < 0 || $enddate == false) { $errors[] = $lang->error_invalid_end_date; } elseif($enddate < $startdate) { $errors[] = $lang->error_end_before_start; }
| $months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months)) { $mybb->input['starttime_month'] = 1; }
$startdate = gmmktime(intval($startdate[0]), intval($startdate[1]), 0, (int)$mybb->input['starttime_month'], intval($mybb->input['starttime_day']), intval($mybb->input['starttime_year'])); if($startdate < 0 || $startdate == false) { $errors[] = $lang->error_invalid_start_date; }
if($mybb->input['endtime_type'] == "2") { $enddate = '0'; } else { if(!in_array($mybb->input['endtime_month'], $months)) { $mybb->input['endtime_month'] = 1; } $enddate = gmmktime($enddatehour, intval($mybb->input['endtime_time']), 0, (int)$mybb->input['endtime_month'], intval($mybb->input['endtime_day']), intval($mybb->input['endtime_year'])); if($enddate < 0 || $enddate == false) { $errors[] = $lang->error_invalid_end_date; } elseif($enddate < $startdate) { $errors[] = $lang->error_end_before_start; }
|
}
if(!$errors)
| }
if(!$errors)
|
Zeile 649 | Zeile 651 |
---|
if(is_array($errors)) { $errors = inline_error($errors);
|
if(is_array($errors)) { $errors = inline_error($errors);
|
|
|
// Set $announcement to input stuff
|
// Set $announcement to input stuff
|
$title = $mybb->input['title']; $message = $mybb->input['message']; $startmonth = intval($mybb->input['starttime_month']);
| $announcement['subject'] = $mybb->input['title']; $announcement['message'] = $mybb->input['message']; $announcement['allowhtml'] = $mybb->input['allowhtml']; $announcement['allowmycode'] = $mybb->input['allowmycode']; $announcement['allowsmilies'] = $mybb->input['allowsmilies']; $months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months)) { $mybb->input['starttime_month'] = 1; } if(!in_array($mybb->input['endtime_month'], $months)) { $mybb->input['endtime_month'] = 1; } $startmonth = $mybb->input['starttime_month'];
|
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']); $startday = intval($mybb->input['starttime_day']); $starttime_time = htmlspecialchars($mybb->input['starttime_time']);
|
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']); $startday = intval($mybb->input['starttime_day']); $starttime_time = htmlspecialchars($mybb->input['starttime_time']);
|
$endmonth = intval($mybb->input['endtime_month']);
| $endmonth = $mybb->input['endtime_month'];
|
$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']); $endday = intval($mybb->input['endtime_day']); $endtime_time = htmlspecialchars($mybb->input['endtime_time']);
| $enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']); $endday = intval($mybb->input['endtime_day']); $endtime_time = htmlspecialchars($mybb->input['endtime_time']);
|
Zeile 898 | Zeile 915 |
---|
$announcement['allowhtml'] = $mybb->input['allowhtml']; $announcement['allowmycode'] = $mybb->input['allowmycode']; $announcement['allowsmilies'] = $mybb->input['allowsmilies'];
|
$announcement['allowhtml'] = $mybb->input['allowhtml']; $announcement['allowmycode'] = $mybb->input['allowmycode']; $announcement['allowsmilies'] = $mybb->input['allowsmilies'];
|
$startmonth = intval($mybb->input['starttime_month']);
| $months = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'); if(!in_array($mybb->input['starttime_month'], $months)) { $mybb->input['starttime_month'] = 1; } if(!in_array($mybb->input['endtime_month'], $months)) { $mybb->input['endtime_month'] = 1; } $startmonth = $mybb->input['starttime_month'];
|
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']); $startday = intval($mybb->input['starttime_day']); $starttime_time = htmlspecialchars($mybb->input['starttime_time']);
|
$startdateyear = htmlspecialchars_uni($mybb->input['starttime_year']); $startday = intval($mybb->input['starttime_day']); $starttime_time = htmlspecialchars($mybb->input['starttime_time']);
|
$endmonth = intval($mybb->input['endtime_month']);
| $endmonth = $mybb->input['endtime_month'];
|
$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']); $endday = intval($mybb->input['endtime_day']); $endtime_time = htmlspecialchars($mybb->input['endtime_time']);
| $enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']); $endday = intval($mybb->input['endtime_day']); $endtime_time = htmlspecialchars($mybb->input['endtime_time']);
|
Zeile 1438 | Zeile 1467 |
---|
$user_permissions = user_permissions($user['uid']);
// Current user is only a local moderator, cannot edit super mods or admins
|
$user_permissions = user_permissions($user['uid']);
// Current user is only a local moderator, cannot edit super mods or admins
|
if($mybb->user['usergroup'] == 6 && ($user_permissions['issupermod'] == 1 || $user_permissions['canadmincp'] == 1))
| if($mybb->user['usergroup'] == 6 && ($user_permissions['issupermod'] == 1 || $user_permissions['cancp'] == 1))
|
{ error_no_permission(); } // Current user is a super mod or is an administrator and the user we are editing is a super admin, cannot edit admins
|
{ error_no_permission(); } // Current user is a super mod or is an administrator and the user we are editing is a super admin, cannot edit admins
|
else if($mybb->usergroup['issupermod'] == 1 && $user_permissions['canadmincp'] == 1 || (is_super_admin($user['uid']) && !is_super_admin($user['uid'])))
| else if($mybb->usergroup['issupermod'] == 1 && $user_permissions['cancp'] == 1 || (is_super_admin($user['uid']) && !is_super_admin($user['uid'])))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 1527 | Zeile 1556 |
---|
$user_permissions = user_permissions($user['uid']);
// Current user is only a local moderator, cannot edit super mods or admins
|
$user_permissions = user_permissions($user['uid']);
// Current user is only a local moderator, cannot edit super mods or admins
|
if($mybb->user['usergroup'] == 6 && ($user_permissions['issupermod'] == 1 || $user_permissions['canadmincp'] == 1))
| if($mybb->user['usergroup'] == 6 && ($user_permissions['issupermod'] == 1 || $user_permissions['cancp'] == 1))
|
{ error_no_permission(); } // Current user is a super mod or is an administrator and the user we are editing is a super admin, cannot edit admins
|
{ error_no_permission(); } // Current user is a super mod or is an administrator and the user we are editing is a super admin, cannot edit admins
|
else if($mybb->usergroup['issupermod'] == 1 && $user_permissions['canadmincp'] == 1 || (is_super_admin($user['uid']) && !is_super_admin($user['uid'])))
| else if($mybb->usergroup['issupermod'] == 1 && $user_permissions['cancp'] == 1 || (is_super_admin($user['uid']) && !is_super_admin($user['uid'])))
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 2335 | Zeile 2364 |
---|
// Only show the edit & lift links if current user created ban, or is super mod/admin $edit_link = '';
|
// Only show the edit & lift links if current user created ban, or is super mod/admin $edit_link = '';
|
if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['canadmincp'] == 1)
| if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1)
|
{ $edit_link = "<br /><span class=\"smalltext\"><a href=\"modcp.php?action=banuser&uid={$banned['uid']}\">{$lang->edit_ban}</a> | <a href=\"modcp.php?action=liftban&uid={$banned['uid']}&my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></span>"; }
| { $edit_link = "<br /><span class=\"smalltext\"><a href=\"modcp.php?action=banuser&uid={$banned['uid']}\">{$lang->edit_ban}</a> | <a href=\"modcp.php?action=liftban&uid={$banned['uid']}&my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></span>"; }
|
Zeile 2411 | Zeile 2440 |
---|
}
// Permission to edit this ban?
|
}
// Permission to edit this ban?
|
if($mybb->user['uid'] != $ban['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['canadmincp'] != 1)
| if($mybb->user['uid'] != $ban['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 2452 | Zeile 2481 |
---|
}
// Permission to edit this ban?
|
}
// Permission to edit this ban?
|
if($mybb->user['uid'] != $user['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['canadmincp'] != 1)
| if($mybb->user['uid'] != $user['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1)
|
{ error_no_permission(); }
| { error_no_permission(); }
|
Zeile 2835 | Zeile 2864 |
---|
// Only show the edit & lift links if current user created ban, or is super mod/admin $edit_link = '';
|
// Only show the edit & lift links if current user created ban, or is super mod/admin $edit_link = '';
|
if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['canadmincp'] == 1)
| if($mybb->user['uid'] == $banned['admin'] || !$banned['adminuser'] || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1)
|
{ $edit_link = "<br /><span class=\"smalltext\"><a href=\"modcp.php?action=banuser&uid={$banned['uid']}\">{$lang->edit_ban}</a> | <a href=\"modcp.php?action=liftban&uid={$banned['uid']}&my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></span>"; }
| { $edit_link = "<br /><span class=\"smalltext\"><a href=\"modcp.php?action=banuser&uid={$banned['uid']}\">{$lang->edit_ban}</a> | <a href=\"modcp.php?action=liftban&uid={$banned['uid']}&my_post_key={$mybb->post_code}\">{$lang->lift_ban}</a></span>"; }
|