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 263 | Zeile 237 |
---|
if(!empty($nav_announcements) || !empty($nav_modqueue) || !empty($nav_reportcenter) || !empty($nav_modlogs)) {
|
if(!empty($nav_announcements) || !empty($nav_modqueue) || !empty($nav_reportcenter) || !empty($nav_modlogs)) {
|
$expaltext = (in_array("modcpforums", $collapse)) ? "[+]" : "[-]";
| $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)) ? "[+]" : "[-]";
| $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 328 | Zeile 302 |
---|
$rids = implode("','", $mybb->input['reports']);
$sql = "rid IN ('0','{$rids}')";
|
$rids = implode("','", $mybb->input['reports']);
$sql = "rid IN ('0','{$rids}')";
|
}
| }
|
$plugins->run_hooks("modcp_do_reports");
| $plugins->run_hooks("modcp_do_reports");
|
Zeile 416 | 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 532 | 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 553 | Zeile 528 |
---|
$post = get_post_link($report['id'])."#pid{$report['id']}"; $user = build_profile_link(htmlspecialchars_uni($postcache[$report['id']]['username']), $postcache[$report['id']]['uid']); $report_data['content'] = $lang->sprintf($lang->report_info_post, $post, $user);
|
$post = get_post_link($report['id'])."#pid{$report['id']}"; $user = build_profile_link(htmlspecialchars_uni($postcache[$report['id']]['username']), $postcache[$report['id']]['uid']); $report_data['content'] = $lang->sprintf($lang->report_info_post, $post, $user);
|
|
|
$thread_link = get_thread_link($postcache[$report['id']]['tid']); $thread_subject = htmlspecialchars_uni($parser->parse_badwords($postcache[$report['id']]['subject'])); $report_data['content'] .= $lang->sprintf($lang->report_info_post_thread, $thread_link, $thread_subject);
| $thread_link = get_thread_link($postcache[$report['id']]['tid']); $thread_subject = htmlspecialchars_uni($parser->parse_badwords($postcache[$report['id']]['subject'])); $report_data['content'] .= $lang->sprintf($lang->report_info_post_thread, $thread_link, $thread_subject);
|
Zeile 691 | Zeile 666 |
---|
} } $postcount = (int)$report_count;
|
} } $postcount = (int)$report_count;
|
$pages = $postcount / $perpage; $pages = ceil($pages);
if($mybb->get_input('page') == "last") { $page = $pages; }
if($page > $pages || $page <= 0) { $page = 1; }
| $pages = $postcount / $perpage; $pages = ceil($pages);
if($mybb->get_input('page') == "last") { $page = $pages; }
if($page > $pages || $page <= 0) { $page = 1; }
|
if($page) {
| if($page) {
|
Zeile 718 | Zeile 693 |
---|
$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=allreports"); $allreportspages = ''; if($postcount > $perpage)
|
$multipage = multipage($postcount, $perpage, $page, "modcp.php?action=allreports"); $allreportspages = ''; if($postcount > $perpage)
|
{
| {
|
eval("\$allreportspages = \"".$templates->get("modcp_reports_multipage")."\";"); }
| eval("\$allreportspages = \"".$templates->get("modcp_reports_multipage")."\";"); }
|
Zeile 741 | Zeile 716 |
---|
$allreports = ''; if(!$db->num_rows($query))
|
$allreports = ''; if(!$db->num_rows($query))
|
{
| {
|
eval("\$allreports = \"".$templates->get("modcp_reports_allnoreports")."\";"); } else
| eval("\$allreports = \"".$templates->get("modcp_reports_allnoreports")."\";"); } else
|
Zeile 764 | Zeile 739 |
---|
{ $user = build_profile_link(htmlspecialchars_uni($report['profileusername']), $report['id']); $report_data['content'] = $lang->sprintf($lang->report_info_profile, $user);
|
{ $user = build_profile_link(htmlspecialchars_uni($report['profileusername']), $report['id']); $report_data['content'] = $lang->sprintf($lang->report_info_profile, $user);
|
}
| }
|
else if($report['type'] == 'reputation') { $user = build_profile_link(htmlspecialchars_uni($report['repusername']), $report['id2']);
| else if($report['type'] == 'reputation') { $user = build_profile_link(htmlspecialchars_uni($report['repusername']), $report['id2']);
|
Zeile 774 | Zeile 749 |
---|
// Report reason and comment if($report['reasonid'] > 0)
|
// Report reason and comment if($report['reasonid'] > 0)
|
{
| {
|
$reason = htmlspecialchars_uni($lang->parse($report['title']));
if(empty($report['reason']))
| $reason = htmlspecialchars_uni($lang->parse($report['title']));
if(empty($report['reason']))
|
Zeile 819 | Zeile 794 |
---|
if($mybb->usergroup['canviewmodlogs'] == 0) { error_no_permission();
|
if($mybb->usergroup['canviewmodlogs'] == 0) { error_no_permission();
|
}
| }
|
if($nummodlogs == 0 && $mybb->usergroup['issupermod'] != 1) { error($lang->you_cannot_view_mod_logs);
| if($nummodlogs == 0 && $mybb->usergroup['issupermod'] != 1) { error($lang->you_cannot_view_mod_logs);
|
Zeile 838 | Zeile 813 |
---|
// Searching for entries by a particular user if($mybb->get_input('uid', MyBB::INPUT_INT))
|
// Searching for entries by a particular user if($mybb->get_input('uid', MyBB::INPUT_INT))
|
{
| {
|
$where .= " AND l.uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'"; }
| $where .= " AND l.uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'"; }
|
Zeile 986 | Zeile 961 |
---|
// Edited a user or managed announcement? if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])
|
// Edited a user or managed announcement? if(!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject'])
|
{
| {
|
$data = my_unserialize($logitem['data']); if(!empty($data['uid'])) {
| $data = my_unserialize($logitem['data']); if(!empty($data['uid'])) {
|
Zeile 999 | Zeile 974 |
---|
$data['announcement'] = get_announcement_link($data['aid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_announcement")."\";"); }
|
$data['announcement'] = get_announcement_link($data['aid']); eval("\$information .= \"".$templates->get("modcp_modlogs_result_announcement")."\";"); }
|
}
$plugins->run_hooks("modcp_modlogs_result");
| }
$plugins->run_hooks("modcp_modlogs_result");
|
eval("\$results .= \"".$templates->get("modcp_modlogs_result")."\";"); }
if(!$results) { eval("\$results = \"".$templates->get("modcp_modlogs_noresults")."\";");
|
eval("\$results .= \"".$templates->get("modcp_modlogs_result")."\";"); }
if(!$results) { eval("\$results = \"".$templates->get("modcp_modlogs_noresults")."\";");
|
}
| }
|
$plugins->run_hooks("modcp_modlogs_filter");
| $plugins->run_hooks("modcp_modlogs_filter");
|
Zeile 1041 | Zeile 1016 |
---|
$user['username'] = htmlspecialchars_uni($user['username']); eval("\$user_options .= \"".$templates->get("modcp_modlogs_user")."\";");
|
$user['username'] = htmlspecialchars_uni($user['username']); eval("\$user_options .= \"".$templates->get("modcp_modlogs_user")."\";");
|
}
| }
|
$forum_select = build_forum_jump("", $mybb->get_input('fid', MyBB::INPUT_INT), 1, '', 0, true, '', "fid");
|
$forum_select = build_forum_jump("", $mybb->get_input('fid', MyBB::INPUT_INT), 1, '', 0, true, '', "fid");
|
|
|
eval("\$modlogs = \"".$templates->get("modcp_modlogs")."\";"); output_page($modlogs); }
|
eval("\$modlogs = \"".$templates->get("modcp_modlogs")."\";"); output_page($modlogs); }
|
|
|
if($mybb->input['action'] == "do_delete_announcement")
|
if($mybb->input['action'] == "do_delete_announcement")
|
{ verify_post_check($mybb->get_input('my_post_key'));
if($mybb->usergroup['canmanageannounce'] == 0) { error_no_permission(); }
$aid = $mybb->get_input('aid'); $query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'"); $announcement = $db->fetch_array($query);
if(!$announcement) { error($lang->error_invalid_announcement); } if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums))) { error_no_permission(); }
$plugins->run_hooks("modcp_do_delete_announcement");
| { verify_post_check($mybb->get_input('my_post_key'));
if($mybb->usergroup['canmanageannounce'] == 0) { error_no_permission(); }
$aid = $mybb->get_input('aid'); $query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'"); $announcement = $db->fetch_array($query);
if(!$announcement) { error($lang->error_invalid_announcement); } if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums))) { error_no_permission(); }
$plugins->run_hooks("modcp_do_delete_announcement");
|
$db->delete_query("announcements", "aid='{$aid}'"); log_moderator_action(array("aid" => $announcement['aid'], "subject" => $announcement['subject']), $lang->announcement_deleted); $cache->update_forumsdisplay();
redirect("modcp.php?action=announcements", $lang->redirect_delete_announcement);
|
$db->delete_query("announcements", "aid='{$aid}'"); log_moderator_action(array("aid" => $announcement['aid'], "subject" => $announcement['subject']), $lang->announcement_deleted); $cache->update_forumsdisplay();
redirect("modcp.php?action=announcements", $lang->redirect_delete_announcement);
|
}
| }
|
if($mybb->input['action'] == "delete_announcement") { if($mybb->usergroup['canmanageannounce'] == 0)
| if($mybb->input['action'] == "delete_announcement") { if($mybb->usergroup['canmanageannounce'] == 0)
|
Zeile 1088 | Zeile 1063 |
---|
}
$aid = $mybb->get_input('aid');
|
}
$aid = $mybb->get_input('aid');
|
$query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
| $query = $db->simple_select("announcements", "aid, subject, fid", "aid='{$aid}'");
|
$announcement = $db->fetch_array($query); $announcement['subject'] = htmlspecialchars_uni($parser->parse_badwords($announcement['subject']));
|
$announcement = $db->fetch_array($query); $announcement['subject'] = htmlspecialchars_uni($parser->parse_badwords($announcement['subject']));
|
|
|
if(!$announcement) { error($lang->error_invalid_announcement);
|
if(!$announcement) { error($lang->error_invalid_announcement);
|
}
| }
|
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums))) { error_no_permission();
| if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums))) { error_no_permission();
|
Zeile 1114 | Zeile 1089 |
---|
verify_post_check($mybb->get_input('my_post_key'));
if($mybb->usergroup['canmanageannounce'] == 0)
|
verify_post_check($mybb->get_input('my_post_key'));
if($mybb->usergroup['canmanageannounce'] == 0)
|
{ error_no_permission(); }
| { error_no_permission(); }
|
$announcement_fid = $mybb->get_input('fid', MyBB::INPUT_INT); if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid, "canmanageannouncements")) || ($unviewableforums && in_array($announcement_fid, $unviewableforums)))
| $announcement_fid = $mybb->get_input('fid', MyBB::INPUT_INT); if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid, "canmanageannouncements")) || ($unviewableforums && in_array($announcement_fid, $unviewableforums)))
|
Zeile 1133 | Zeile 1108 |
---|
}
$mybb->input['message'] = $mybb->get_input('message');
|
}
$mybb->input['message'] = $mybb->get_input('message');
|
if(!trim($mybb->input['message'])) {
| if(!trim($mybb->input['message'])) {
|
$errors[] = $lang->error_missing_message; }
| $errors[] = $lang->error_missing_message; }
|
Zeile 1171 | Zeile 1146 |
---|
$mybb->input['starttime_month'] = $mybb->get_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'] = $mybb->get_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'] = '01'; }
|
$mybb->input['starttime_month'] = '01'; }
|
|
|
$localized_time_offset = (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
$startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, $mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) - $localized_time_offset; if(!checkdate($mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) || $startdate < 0 || $startdate == false) { $errors[] = $lang->error_invalid_start_date;
|
$localized_time_offset = (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
$startdate = gmmktime((int)$startdate[0], (int)$startdate[1], 0, $mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) - $localized_time_offset; if(!checkdate($mybb->get_input('starttime_month', MyBB::INPUT_INT), $mybb->get_input('starttime_day', MyBB::INPUT_INT), $mybb->get_input('starttime_year', MyBB::INPUT_INT)) || $startdate < 0 || $startdate == false) { $errors[] = $lang->error_invalid_start_date;
|
}
| }
|
if($mybb->get_input('endtime_type', MyBB::INPUT_INT) == 2) {
| if($mybb->get_input('endtime_type', MyBB::INPUT_INT) == 2) {
|
Zeile 1199 | Zeile 1174 |
---|
if(!checkdate($mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT)) || $enddate < 0 || $enddate == false) { $errors[] = $lang->error_invalid_end_date;
|
if(!checkdate($mybb->get_input('endtime_month', MyBB::INPUT_INT), $mybb->get_input('endtime_day', MyBB::INPUT_INT), $mybb->get_input('endtime_year', MyBB::INPUT_INT)) || $enddate < 0 || $enddate == false) { $errors[] = $lang->error_invalid_end_date;
|
}
| }
|
if($enddate <= $startdate) {
| if($enddate <= $startdate) {
|
Zeile 1208 | Zeile 1183 |
---|
}
if($mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT) == 1)
|
}
if($mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT) == 1)
|
{
| {
|
$allowhtml = 1;
|
$allowhtml = 1;
|
}
| }
|
else
|
else
|
{
| {
|
$allowhtml = 0; } if($mybb->get_input('allowmycode', MyBB::INPUT_INT) == 1) { $allowmycode = 1;
|
$allowhtml = 0; } if($mybb->get_input('allowmycode', MyBB::INPUT_INT) == 1) { $allowmycode = 1;
|
} else {
| } else {
|
$allowmycode = 0;
|
$allowmycode = 0;
|
}
| }
|
if($mybb->get_input('allowsmilies', MyBB::INPUT_INT) == 1) { $allowsmilies = 1;
|
if($mybb->get_input('allowsmilies', MyBB::INPUT_INT) == 1) { $allowsmilies = 1;
|
} else
| } else
|
{ $allowsmilies = 0; }
| { $allowsmilies = 0; }
|
Zeile 1255 | Zeile 1230 |
---|
'allowsmilies' => $allowsmilies ); $aid = $db->insert_query("announcements", $insert_announcement);
|
'allowsmilies' => $allowsmilies ); $aid = $db->insert_query("announcements", $insert_announcement);
|
|
|
log_moderator_action(array("aid" => $aid, "subject" => $mybb->input['title']), $lang->announcement_added);
$plugins->run_hooks("modcp_do_new_announcement_end");
| log_moderator_action(array("aid" => $aid, "subject" => $mybb->input['title']), $lang->announcement_added);
$plugins->run_hooks("modcp_do_new_announcement_end");
|
Zeile 1273 | Zeile 1248 |
---|
if($mybb->input['action'] == "new_announcement") { if($mybb->usergroup['canmanageannounce'] == 0)
|
if($mybb->input['action'] == "new_announcement") { if($mybb->usergroup['canmanageannounce'] == 0)
|
{ error_no_permission(); }
| { error_no_permission(); }
|
add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=announcements");
|
add_breadcrumb($lang->mcp_nav_announcements, "modcp.php?action=announcements");
|
add_breadcrumb($lang->add_announcement, "modcp.php?action=new_announcements");
| add_breadcrumb($lang->add_announcement, "modcp.php?action=new_announcements");
|
$announcement_fid = $mybb->get_input('fid', MyBB::INPUT_INT);
|
$announcement_fid = $mybb->get_input('fid', MyBB::INPUT_INT);
|
|
|
if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid, "canmanageannouncements")) || ($unviewableforums && in_array($announcement_fid, $unviewableforums)))
|
if(($mybb->usergroup['issupermod'] != 1 && $announcement_fid == -1) || ($announcement_fid != -1 && !is_moderator($announcement_fid, "canmanageannouncements")) || ($unviewableforums && in_array($announcement_fid, $unviewableforums)))
|
{ error_no_permission(); }
// Deal with inline errors if(!empty($errors) || isset($preview)) { if(!empty($errors)) { $errors = inline_error($errors); } else { $errors = ''; }
// Set $announcement to input stuff $announcement['subject'] = $mybb->input['title'];
| { error_no_permission(); }
// Deal with inline errors if(!empty($errors) || isset($preview)) { if(!empty($errors)) { $errors = inline_error($errors); } else { $errors = ''; }
// Set $announcement to input stuff $announcement['subject'] = $mybb->input['title'];
|
$announcement['message'] = $mybb->input['message']; $announcement['allowhtml'] = $allowhtml; $announcement['allowmycode'] = $allowmycode;
| $announcement['message'] = $mybb->input['message']; $announcement['allowhtml'] = $allowhtml; $announcement['allowmycode'] = $allowmycode;
|
Zeile 1314 | Zeile 1289 |
---|
$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']); $endday = $mybb->get_input('endtime_day', MyBB::INPUT_INT); $endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);
|
$enddateyear = htmlspecialchars_uni($mybb->input['endtime_year']); $endday = $mybb->get_input('endtime_day', MyBB::INPUT_INT); $endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);
|
}
| }
|
else { $localized_time = TIME_NOW + (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
| else { $localized_time = TIME_NOW + (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
|
Zeile 1334 | Zeile 1309 |
---|
);
$enddateyear = $startdateyear+1;
|
);
$enddateyear = $startdateyear+1;
|
}
// Generate form elements $startdateday = $enddateday = ''; for($day = 1; $day <= 31; ++$day) { if($startday == $day) { $selected = " selected=\"selected\""; eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";"); } else { $selected = ''; eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";"); }
if($endday == $day) { $selected = " selected=\"selected\""; eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";"); } else { $selected = ''; eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";"); } }
$startmonthsel = $endmonthsel = array(); foreach(array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12') as $month) { $startmonthsel[$month] = ''; $endmonthsel[$month] = ''; } $startmonthsel[$startmonth] = "selected=\"selected\""; $endmonthsel[$endmonth] = "selected=\"selected\"";
$startdatemonth = $enddatemonth = '';
eval("\$startdatemonth .= \"".$templates->get("modcp_announcements_month_start")."\";"); eval("\$enddatemonth .= \"".$templates->get("modcp_announcements_month_end")."\";");
| }
// Generate form elements $startdateday = $enddateday = ''; for($day = 1; $day <= 31; ++$day) { if($startday == $day) { $selected = " selected=\"selected\""; eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";"); } else { $selected = ''; eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";"); }
if($endday == $day) { $selected = " selected=\"selected\""; eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";"); } else { $selected = ''; eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";"); } }
$startmonthsel = $endmonthsel = array(); foreach(array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12') as $month) { $startmonthsel[$month] = ''; $endmonthsel[$month] = ''; } $startmonthsel[$startmonth] = "selected=\"selected\""; $endmonthsel[$endmonth] = "selected=\"selected\"";
$startdatemonth = $enddatemonth = '';
eval("\$startdatemonth .= \"".$templates->get("modcp_announcements_month_start")."\";"); eval("\$enddatemonth .= \"".$templates->get("modcp_announcements_month_end")."\";");
|
$title = htmlspecialchars_uni($announcement['subject']); $message = htmlspecialchars_uni($announcement['message']);
|
$title = htmlspecialchars_uni($announcement['subject']); $message = htmlspecialchars_uni($announcement['message']);
|
|
|
$html_sel = $mycode_sel = $smilies_sel = array('yes' => '', 'no' => '');
if($mybb->settings['announcementshtml']) { if($announcement['allowhtml'])
|
$html_sel = $mycode_sel = $smilies_sel = array('yes' => '', 'no' => '');
if($mybb->settings['announcementshtml']) { if($announcement['allowhtml'])
|
{
| {
|
$html_sel['yes'] = ' checked="checked"';
|
$html_sel['yes'] = ' checked="checked"';
|
}
| }
|
else { $html_sel['no'] = ' checked="checked"'; }
eval("\$allow_html = \"".$templates->get("modcp_announcements_allowhtml")."\";");
|
else { $html_sel['no'] = ' checked="checked"'; }
eval("\$allow_html = \"".$templates->get("modcp_announcements_allowhtml")."\";");
|
} else {
| } else {
|
$allow_html = '';
|
$allow_html = '';
|
}
| }
|
if($announcement['allowmycode']) { $mycode_sel['yes'] = ' checked="checked"';
|
if($announcement['allowmycode']) { $mycode_sel['yes'] = ' checked="checked"';
|
} else {
| } else {
|
$mycode_sel['no'] = ' checked="checked"';
|
$mycode_sel['no'] = ' checked="checked"';
|
}
| }
|
if($announcement['allowsmilies']) { $smilies_sel['yes'] = ' checked="checked"';
|
if($announcement['allowsmilies']) { $smilies_sel['yes'] = ' checked="checked"';
|
} else
| } else
|
{ $smilies_sel['no'] = ' checked="checked"'; }
| { $smilies_sel['no'] = ' checked="checked"'; }
|
Zeile 1422 | Zeile 1397 |
---|
if(!isset($mybb->input['endtime_type']) || $mybb->input['endtime_type'] == 2) { $end_type_sel['infinite'] = ' checked="checked"';
|
if(!isset($mybb->input['endtime_type']) || $mybb->input['endtime_type'] == 2) { $end_type_sel['infinite'] = ' checked="checked"';
|
}
| }
|
else { $end_type_sel['finite'] = ' checked="checked"';
| else { $end_type_sel['finite'] = ' checked="checked"';
|
Zeile 1437 | Zeile 1412 |
---|
$announcementarray = array( 'aid' => 0, 'fid' => $announcement_fid,
|
$announcementarray = array( 'aid' => 0, 'fid' => $announcement_fid,
|
'uid' => $mybb->user['uid'], 'subject' => $mybb->input['title'], 'message' => $mybb->input['message'], 'allowhtml' => $mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT), 'allowmycode' => $mybb->get_input('allowmycode', MyBB::INPUT_INT), 'allowsmilies' => $mybb->get_input('allowsmilies', MyBB::INPUT_INT), 'dateline' => TIME_NOW, 'userusername' => $mybb->user['username'], );
$array = $mybb->user; foreach($array as $key => $element) { $announcementarray[$key] = $element;
| 'uid' => $mybb->user['uid'], 'subject' => $mybb->input['title'], 'message' => $mybb->input['message'], 'allowhtml' => $mybb->settings['announcementshtml'] && $mybb->get_input('allowhtml', MyBB::INPUT_INT), 'allowmycode' => $mybb->get_input('allowmycode', MyBB::INPUT_INT), 'allowsmilies' => $mybb->get_input('allowsmilies', MyBB::INPUT_INT), 'dateline' => TIME_NOW, 'userusername' => $mybb->user['username'], );
$array = $mybb->user; foreach($array as $key => $element) { $announcementarray[$key] = $element;
|
}
// Gather usergroup data from the cache
| }
// Gather usergroup data from the cache
|
Zeile 1469 | Zeile 1444 |
---|
{ $announcementarray[$key] = $groupscache[$announcementarray['usergroup']][$field]; }
|
{ $announcementarray[$key] = $groupscache[$announcementarray['usergroup']][$field]; }
|
|
|
require_once MYBB_ROOT."inc/functions_post.php"; $postbit = build_postbit($announcementarray, 3); eval("\$preview = \"".$templates->get("previewpost")."\";");
|
require_once MYBB_ROOT."inc/functions_post.php"; $postbit = build_postbit($announcementarray, 3); eval("\$preview = \"".$templates->get("previewpost")."\";");
|
}
| }
|
else { $preview = '';
|
else { $preview = '';
|
}
$plugins->run_hooks("modcp_new_announcement");
| }
$plugins->run_hooks("modcp_new_announcement");
|
eval("\$announcements = \"".$templates->get("modcp_announcements_new")."\";"); output_page($announcements);
| eval("\$announcements = \"".$templates->get("modcp_announcements_new")."\";"); output_page($announcements);
|
Zeile 1488 | Zeile 1463 |
---|
if($mybb->input['action'] == "do_edit_announcement") { verify_post_check($mybb->get_input('my_post_key'));
|
if($mybb->input['action'] == "do_edit_announcement") { verify_post_check($mybb->get_input('my_post_key'));
|
|
|
if($mybb->usergroup['canmanageannounce'] == 0) { error_no_permission();
| if($mybb->usergroup['canmanageannounce'] == 0) { error_no_permission();
|
Zeile 1507 | Zeile 1482 |
---|
// Mod has permissions to edit this announcement if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))
|
// Mod has permissions to edit this announcement if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums)))
|
{
| {
|
error_no_permission(); }
|
error_no_permission(); }
|
|
|
$errors = array();
// Basic error checking $mybb->input['title'] = $mybb->get_input('title'); if(!trim($mybb->input['title']))
|
$errors = array();
// Basic error checking $mybb->input['title'] = $mybb->get_input('title'); if(!trim($mybb->input['title']))
|
{
| {
|
$errors[] = $lang->error_missing_title;
|
$errors[] = $lang->error_missing_title;
|
}
| }
|
$mybb->input['message'] = $mybb->get_input('message'); if(!trim($mybb->input['message'])) { $errors[] = $lang->error_missing_message;
|
$mybb->input['message'] = $mybb->get_input('message'); if(!trim($mybb->input['message'])) { $errors[] = $lang->error_missing_message;
|
}
| }
|
$mybb->input['starttime_time'] = $mybb->get_input('starttime_time'); $mybb->input['endtime_time'] = $mybb->get_input('endtime_time'); $startdate = @explode(" ", $mybb->input['starttime_time']);
| $mybb->input['starttime_time'] = $mybb->get_input('starttime_time'); $mybb->input['endtime_time'] = $mybb->get_input('endtime_time'); $startdate = @explode(" ", $mybb->input['starttime_time']);
|
Zeile 1674 | Zeile 1649 |
---|
if(!$announcement) { error($lang->error_invalid_announcement);
|
if(!$announcement) { error($lang->error_invalid_announcement);
|
}
| }
|
if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums))) { error_no_permission();
| if(($mybb->usergroup['issupermod'] != 1 && $announcement['fid'] == -1) || ($announcement['fid'] != -1 && !is_moderator($announcement['fid'], "canmanageannouncements")) || ($unviewableforums && in_array($announcement['fid'], $unviewableforums))) { error_no_permission();
|
Zeile 1692 | Zeile 1667 |
---|
$makeshift_end = true; $makeshift_time = TIME_NOW; if($announcement['startdate'])
|
$makeshift_end = true; $makeshift_time = TIME_NOW; if($announcement['startdate'])
|
{
| {
|
$makeshift_time = $announcement['startdate']; }
| $makeshift_time = $announcement['startdate']; }
|
Zeile 1729 | Zeile 1704 |
---|
$endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);
$errored = true;
|
$endtime_time = htmlspecialchars_uni($mybb->input['endtime_time']);
$errored = true;
|
}
| }
|
else { $localized_time_startdate = $announcement['startdate'] + (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
| else { $localized_time_startdate = $announcement['startdate'] + (float)$mybb->user['timezone']*3600 + $mybb->user['dst']*3600;
|
Zeile 1748 | Zeile 1723 |
---|
$enddateyear = gmdate('Y', $localized_time_enddate);
$errored = false;
|
$enddateyear = gmdate('Y', $localized_time_enddate);
$errored = false;
|
}
| }
|
// Generate form elements $startdateday = $enddateday = ''; for($day = 1; $day <= 31; ++$day) { if($startday == $day)
|
// Generate form elements $startdateday = $enddateday = ''; for($day = 1; $day <= 31; ++$day) { if($startday == $day)
|
{ $selected = " selected=\"selected\""; eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";"); } else
| { $selected = " selected=\"selected\""; eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";"); } else
|
{ $selected = ''; eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";");
| { $selected = ''; eval("\$startdateday .= \"".$templates->get("modcp_announcements_day")."\";");
|
Zeile 1768 | Zeile 1743 |
---|
if($endday == $day) { $selected = " selected=\"selected\"";
|
if($endday == $day) { $selected = " selected=\"selected\"";
|
eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";");
| eval("\$enddateday .= \"".$templates->get("modcp_announcements_day")."\";");
|
} else {
| } else {
|
Zeile 1787 | Zeile 1762 |
---|
$endmonthsel[$endmonth] = "selected=\"selected\"";
$startdatemonth = $enddatemonth = '';
|
$endmonthsel[$endmonth] = "selected=\"selected\"";
$startdatemonth = $enddatemonth = '';
|
|
|
eval("\$startdatemonth .= \"".$templates->get("modcp_announcements_month_start")."\";"); eval("\$enddatemonth .= \"".$templates->get("modcp_announcements_month_end")."\";");
| eval("\$startdatemonth .= \"".$templates->get("modcp_announcements_month_start")."\";"); eval("\$enddatemonth .= \"".$templates->get("modcp_announcements_month_end")."\";");
|
Zeile 1806 | Zeile 1781 |
---|
{ $html_sel['no'] = ' checked="checked"'; }
|
{ $html_sel['no'] = ' checked="checked"'; }
|
|
|
eval("\$allow_html = \"".$templates->get("modcp_announcements_allowhtml")."\";");
|
eval("\$allow_html = \"".$templates->get("modcp_announcements_allowhtml")."\";");
|
}
| }
|
else
|
else
|
{
| {
|
$allow_html = ''; }
if($announcement['allowmycode'])
|
$allow_html = ''; }
if($announcement['allowmycode'])
|
{
| {
|
$mycode_sel['yes'] = ' checked="checked"';
|
$mycode_sel['yes'] = ' checked="checked"';
|
}
| }
|
else
|
else
|
{
| {
|
$mycode_sel['no'] = ' checked="checked"'; }
if($announcement['allowsmilies'])
|
$mycode_sel['no'] = ' checked="checked"'; }
if($announcement['allowsmilies'])
|
{
| {
|
$smilies_sel['yes'] = ' checked="checked"'; } else
| $smilies_sel['yes'] = ' checked="checked"'; } else
|
Zeile 1840 | Zeile 1815 |
---|
else { $end_type_sel['finite'] = ' checked="checked"';
|
else { $end_type_sel['finite'] = ' checked="checked"';
|
}
| }
|
// MyCode editor $codebuttons = build_mycode_inserter(); $smilieinserter = build_clickable_smilies();
| // MyCode editor $codebuttons = build_mycode_inserter(); $smilieinserter = build_clickable_smilies();
|
Zeile 1859 | Zeile 1834 |
---|
'allowsmilies' => $mybb->get_input('allowsmilies', MyBB::INPUT_INT), 'dateline' => TIME_NOW, 'userusername' => $mybb->user['username'],
|
'allowsmilies' => $mybb->get_input('allowsmilies', MyBB::INPUT_INT), 'dateline' => TIME_NOW, 'userusername' => $mybb->user['username'],
|
);
| );
|
$array = $mybb->user; foreach($array as $key => $element)
| $array = $mybb->user; foreach($array as $key => $element)
|
Zeile 1896 | Zeile 1871 |
---|
$plugins->run_hooks("modcp_edit_announcement");
eval("\$announcements = \"".$templates->get("modcp_announcements_edit")."\";");
|
$plugins->run_hooks("modcp_edit_announcement");
eval("\$announcements = \"".$templates->get("modcp_announcements_edit")."\";");
|
output_page($announcements); }
| output_page($announcements); }
|
if($mybb->input['action'] == "announcements") { if($mybb->usergroup['canmanageannounce'] == 0)
|
if($mybb->input['action'] == "announcements") { if($mybb->usergroup['canmanageannounce'] == 0)
|
{
| {
|
error_no_permission();
|
error_no_permission();
|
}
| }
|
if($numannouncements == 0 && $mybb->usergroup['issupermod'] != 1) { error($lang->you_cannot_manage_announcements);
| if($numannouncements == 0 && $mybb->usergroup['issupermod'] != 1) { error($lang->you_cannot_manage_announcements);
|
Zeile 1924 | Zeile 1899 |
---|
continue; } $announcements[$announcement['fid']][$announcement['aid']] = $announcement;
|
continue; } $announcements[$announcement['fid']][$announcement['aid']] = $announcement;
|
}
| }
|
$announcements_global = ''; if($mybb->usergroup['issupermod'] == 1) {
| $announcements_global = ''; if($mybb->usergroup['issupermod'] == 1) {
|
Zeile 1935 | 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 1978 | Zeile 1953 |
---|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
|
|
if($mybb->usergroup['canmanagemodqueue'] == 0) { error_no_permission();
| if($mybb->usergroup['canmanagemodqueue'] == 0) { error_no_permission();
|
Zeile 2030 | Zeile 2005 |
---|
$moderation->delete_thread($tid); } log_moderator_action(array('tids' => $threads_to_delete), $lang->multi_delete_threads);
|
$moderation->delete_thread($tid); } log_moderator_action(array('tids' => $threads_to_delete), $lang->multi_delete_threads);
|
} }
| } }
|
$plugins->run_hooks("modcp_do_modqueue_end");
| $plugins->run_hooks("modcp_do_modqueue_end");
|
Zeile 2048 | Zeile 2023 |
---|
if(!isset($mybb->input['posts'][$post['pid']])) { continue;
|
if(!isset($mybb->input['posts'][$post['pid']])) { continue;
|
}
| }
|
$action = $mybb->input['posts'][$post['pid']]; if($action == "approve")
|
$action = $mybb->input['posts'][$post['pid']]; if($action == "approve")
|
{
| {
|
$posts_to_approve[] = $post['pid']; } else if($action == "delete" && $mybb->settings['soft_delete'] != 1) { $moderation->delete_post($post['pid']);
|
$posts_to_approve[] = $post['pid']; } else if($action == "delete" && $mybb->settings['soft_delete'] != 1) { $moderation->delete_post($post['pid']);
|
}
| }
|
else if($action == "delete") { $posts_to_delete[] = $post['pid'];
| else if($action == "delete") { $posts_to_delete[] = $post['pid'];
|
Zeile 2089 | 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 2105 | 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 2305 | 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 2505 | 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 2586 | 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'), "yahoo" => $mybb->get_input('yahoo'),
| |
"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 2617 | 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()) { $errors = $userhandler->get_friendly_errors(); $mybb->input['action'] = "editprofile";
|
// Validate the user and get any errors that might have occurred. if(!$userhandler->validate_user()) { $errors = $userhandler->get_friendly_errors(); $mybb->input['action'] = "editprofile";
|
}
| }
|
else { // Are we removing an avatar from this user?
| else { // Are we removing an avatar from this user?
|
Zeile 2637 | Zeile 2618 |
---|
); remove_avatars($user['uid']); }
|
); remove_avatars($user['uid']); }
|
|
|
// Moderator "Options" (suspend signature, suspend/moderate posting) $moderator_options = array( 1 => array(
| // Moderator "Options" (suspend signature, suspend/moderate posting) $moderator_options = array( 1 => array(
|
Zeile 2679 | Zeile 2660 |
---|
// Skip this option if we haven't selected it continue;
|
// Skip this option if we haven't selected it continue;
|
}
else {
| }
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; }
|
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; }
|
if(!is_array($errors))
| else
|
{ $suspend_length = fetch_time_length((int)$mybb->input[$option['time']], $mybb->input[$option['period']]);
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
|
{ $suspend_length = fetch_time_length((int)$mybb->input[$option['time']], $mybb->input[$option['period']]);
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") { // Temporary ban on action
|
// Permanent ban on action $extra_user_updates[$option['update_length']] = 0; } 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 2727 | Zeile 2707 |
---|
// 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"; }
|
Zeile 2743 | Zeile 2723 |
---|
// Continue with the update if there is no errors $user_info = $userhandler->update_user(); if(!empty($extra_user_updates))
|
// Continue with the update if there is no errors $user_info = $userhandler->update_user(); if(!empty($extra_user_updates))
|
{
| {
|
$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");
|
$plugins->run_hooks("modcp_do_editprofile_end");
|
|
|
redirect("modcp.php?action=finduser", $lang->redirect_user_updated); } }
| redirect("modcp.php?action=finduser", $lang->redirect_user_updated); } }
|
Zeile 2758 | Zeile 2738 |
---|
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) { error($lang->error_nomember);
|
$user = get_user($mybb->get_input('uid', MyBB::INPUT_INT)); 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();
|
}
| }
|
$userperms = user_permissions($user['uid']);
// Set display group
| $userperms = user_permissions($user['uid']);
// Set display group
|
Zeile 2788 | Zeile 2768 |
---|
$display_group = usergroup_displaygroup($user['displaygroup']); if(is_array($display_group))
|
$display_group = usergroup_displaygroup($user['displaygroup']); if(is_array($display_group))
|
{
| {
|
$userperms = array_merge($userperms, $display_group); }
|
$userperms = array_merge($userperms, $display_group); }
|
if(!my_validate_url($user['website'])) { $user['website'] = ''; }
if($user['icq'] != "0") { $user['icq'] = (int)$user['icq']; }
if(!$errors)
| if(!my_validate_url($user['website'])) { $user['website'] = ''; }
if(!$errors)
|
{ $mybb->input = array_merge($user, $mybb->input); $birthday = explode('-', $user['birthday']);
| { $mybb->input = array_merge($user, $mybb->input); $birthday = explode('-', $user['birthday']);
|
Zeile 2822 | Zeile 2797 |
---|
}
// Sanitize all input
|
}
// Sanitize all input
|
foreach(array('usertitle', 'website', 'icq', '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)); }
|
Zeile 2841 | Zeile 2816 |
---|
{ if($title['posts'] <= $user['postnum']) {
|
{ if($title['posts'] <= $user['postnum']) {
|
$defaulttitle = $title['title'];
| $defaulttitle = htmlspecialchars_uni($title['title']);
|
break; } }
| break; } }
|
Zeile 2875 | 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) { $awaycheck = array('', ''); if($errors)
|
if($mybb->settings['allowaway'] != 0) { $awaycheck = array('', ''); if($errors)
|
{ if($user['away'] == 1) { $awaycheck[1] = "checked=\"checked\""; } else { $awaycheck[0] = "checked=\"checked\"";
| { if($user['away'] == 1) { $awaycheck[1] = "checked=\"checked\""; } else { $awaycheck[0] = "checked=\"checked\"";
|
} $returndate = array(); $returndate[0] = $mybb->get_input('awayday');
| } $returndate = array(); $returndate[0] = $mybb->get_input('awayday');
|
Zeile 2903 | Zeile 2880 |
---|
$awaydate = my_date($mybb->settings['dateformat'], $user['awaydate']); $awaycheck[1] = "checked=\"checked\""; $awaynotice = $lang->sprintf($lang->away_notice_away, $awaydate);
|
$awaydate = my_date($mybb->settings['dateformat'], $user['awaydate']); $awaycheck[1] = "checked=\"checked\""; $awaynotice = $lang->sprintf($lang->away_notice_away, $awaydate);
|
} else
| } else
|
{ $awaynotice = $lang->away_notice; $awaycheck[0] = "checked=\"checked\"";
| { $awaynotice = $lang->away_notice; $awaycheck[0] = "checked=\"checked\"";
|
Zeile 2921 | Zeile 2898 |
---|
else { $selected = '';
|
else { $selected = '';
|
}
| }
|
eval("\$returndatesel .= \"".$templates->get("usercp_profile_day")."\";"); }
| eval("\$returndatesel .= \"".$templates->get("usercp_profile_day")."\";"); }
|
Zeile 2942 | 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
|
| $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 = '';
| $requiredfields = ''; $customfields = '';
|
Zeile 2979 | Zeile 2960 |
---|
$userfield = $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 3286 | 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'];
|
$user_yahoo = $mybb->input['yahoo'];
| |
$plugins->run_hooks("modcp_editprofile_end");
| $plugins->run_hooks("modcp_editprofile_end");
|
Zeile 3412 | 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 3486 | Zeile 3464 |
---|
$mybb->input['filter']['mod_uid'] = (int)$mod_user['uid']; $mybb->input['filter']['mod_username'] = htmlspecialchars_uni($mybb->input['filter']['mod_username']);
|
$mybb->input['filter']['mod_uid'] = (int)$mod_user['uid']; $mybb->input['filter']['mod_username'] = htmlspecialchars_uni($mybb->input['filter']['mod_username']);
|
} else {
| } else {
|
$mybb->input['filter']['mod_username'] = ''; } if(!empty($mybb->input['filter']['mod_uid']))
| $mybb->input['filter']['mod_username'] = ''; } if(!empty($mybb->input['filter']['mod_uid']))
|
Zeile 3500 | Zeile 3478 |
---|
$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 {
|
$mybb->input['filter']['mod_uid'] = ''; } if(!empty($mybb->input['filter']['reason']))
| $mybb->input['filter']['mod_uid'] = ''; } if(!empty($mybb->input['filter']['reason']))
|
Zeile 3512 | Zeile 3490 |
---|
$mybb->input['filter']['reason'] = htmlspecialchars_uni($mybb->input['filter']['reason']); } else
|
$mybb->input['filter']['reason'] = htmlspecialchars_uni($mybb->input['filter']['reason']); } else
|
{
| {
|
$mybb->input['filter']['reason'] = ''; } $sortbysel = array('username' => '', 'expires' => '', 'issuedby' => '', 'dateline' => '');
| $mybb->input['filter']['reason'] = ''; } $sortbysel = array('username' => '', 'expires' => '', 'issuedby' => '', 'dateline' => '');
|
Zeile 3525 | Zeile 3503 |
---|
case "username": $sortby = "u.username"; $sortbysel['username'] = ' selected="selected"';
|
case "username": $sortby = "u.username"; $sortbysel['username'] = ' selected="selected"';
|
break;
| break;
|
case "expires": $sortby = "w.expires"; $sortbysel['expires'] = ' selected="selected"';
|
case "expires": $sortby = "w.expires"; $sortbysel['expires'] = ' selected="selected"';
|
break;
| break;
|
case "issuedby": $sortby = "i.username"; $sortbysel['issuedby'] = ' selected="selected"';
| case "issuedby": $sortby = "i.username"; $sortbysel['issuedby'] = ' selected="selected"';
|
Zeile 3561 | Zeile 3539 |
---|
SELECT COUNT(wid) as count FROM ".TABLE_PREFIX."warnings w
|
SELECT COUNT(wid) as count FROM ".TABLE_PREFIX."warnings w
|
LEFT JOIN ".TABLE_PREFIX."warningtypes t ON (w.tid=t.tid) WHERE 1=1
| LEFT JOIN ".TABLE_PREFIX."warningtypes t ON (w.tid=t.tid) WHERE 1=1
|
{$where_sql} "; $query = $db->query($sql);
| {$where_sql} "; $query = $db->query($sql);
|
Zeile 3678 | 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 3695 | 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 3710 | Zeile 3690 |
---|
$plugins->run_hooks("modcp_ipsearch_posts_start");
if($post_ip_sql)
|
$plugins->run_hooks("modcp_ipsearch_posts_start");
if($post_ip_sql)
|
{
| {
|
$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})";
|
}
| }
|
if($inactiveforums) { $where_sql .= " AND p.fid NOT IN ({$inactiveforums})";
| if($inactiveforums) { $where_sql .= " AND p.fid NOT IN ({$inactiveforums})";
|
Zeile 3737 | Zeile 3717 |
---|
}
if(!empty($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)."))"; }
| $where_sql .= " AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))"; }
|
Zeile 3764 | Zeile 3744 |
---|
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($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 = -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)."))";
|
Zeile 3783 | Zeile 3763 |
---|
WHERE {$post_ip_sql}{$where_sql}{$visible_sql} "); $post_results = $db->fetch_field($query, "count");
|
WHERE {$post_ip_sql}{$where_sql}{$visible_sql} "); $post_results = $db->fetch_field($query, "count");
|
} }
| } }
|
// 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 3930 | 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 3959 | 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 4161 | Zeile 4142 |
---|
}
if($banned['lifted'] == 'perm' || $banned['lifted'] == '' || $banned['bantime'] == 'perm' || $banned['bantime'] == '---')
|
}
if($banned['lifted'] == 'perm' || $banned['lifted'] == '' || $banned['bantime'] == 'perm' || $banned['bantime'] == '---')
|
{
| {
|
$banlength = $lang->permanent; $timeremaining = $lang->na; }
| $banlength = $lang->permanent; $timeremaining = $lang->na; }
|
Zeile 4169 | Zeile 4150 |
---|
{ $banlength = $bantimes[$banned['bantime']]; $remaining = $banned['lifted']-TIME_NOW;
|
{ $banlength = $bantimes[$banned['bantime']]; $remaining = $banned['lifted']-TIME_NOW;
|
|
|
$timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false))."";
$banned_class = '';
| $timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false))."";
$banned_class = '';
|
Zeile 4187 | Zeile 4168 |
---|
else if($remaining < 86400) { $banned_class = "moderate_banned";
|
else if($remaining < 86400) { $banned_class = "moderate_banned";
|
}
| }
|
else if($remaining < 604800)
|
else if($remaining < 604800)
|
{
| {
|
$banned_class = "low_banned";
|
$banned_class = "low_banned";
|
}
| }
|
else { $banned_class = "normal_banned"; }
|
else { $banned_class = "normal_banned"; }
|
|
|
eval('$timeremaining = "'.$templates->get('modcp_banning_remaining').'";'); }
| eval('$timeremaining = "'.$templates->get('modcp_banning_remaining').'";'); }
|
Zeile 4220 | Zeile 4201 |
---|
verify_post_check($mybb->get_input('my_post_key'));
if($mybb->usergroup['canbanusers'] == 0)
|
verify_post_check($mybb->get_input('my_post_key'));
if($mybb->usergroup['canbanusers'] == 0)
|
{ error_no_permission(); }
| { error_no_permission(); }
|
$query = $db->simple_select("banned", "*", "uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'"); $ban = $db->fetch_array($query);
|
$query = $db->simple_select("banned", "*", "uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'"); $ban = $db->fetch_array($query);
|
|
|
if(!$ban)
|
if(!$ban)
|
{
| {
|
error($lang->error_invalidban);
|
error($lang->error_invalidban);
|
}
| }
|
// Permission to edit this ban?
|
// Permission to edit this ban?
|
if($mybb->user['uid'] != $ban['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1) { error_no_permission(); }
| if($mybb->user['uid'] != $ban['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1) { error_no_permission(); }
|
$plugins->run_hooks("modcp_liftban_start");
| $plugins->run_hooks("modcp_liftban_start");
|
Zeile 4245 | 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 4266 | Zeile 4246 |
---|
verify_post_check($mybb->get_input('my_post_key'));
if($mybb->usergroup['canbanusers'] == 0)
|
verify_post_check($mybb->get_input('my_post_key'));
if($mybb->usergroup['canbanusers'] == 0)
|
{
| {
|
error_no_permission(); }
// Editing an existing ban
|
error_no_permission(); }
// 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 4282 | 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;
|
}
| }
|
// Permission to edit this ban? if($existing_ban && $mybb->user['uid'] != $user['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1) { error_no_permission();
|
// Permission to edit this ban? if($existing_ban && $mybb->user['uid'] != $user['admin'] && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['cancp'] != 1) { error_no_permission();
|
} }
$errors = array();
| } }
$errors = array();
|
// Creating a new ban if(!$existing_ban) {
| // Creating a new ban if(!$existing_ban) {
|
Zeile 4307 | 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 4316 | 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'])) { $errors[] = $lang->error_cannotbanuser;
|
// Have permissions to ban this user? if(!modcp_can_manage_user($user['uid'])) { $errors[] = $lang->error_cannotbanuser;
|
}
| }
|
// Check for an incoming reason if(empty($mybb->input['banreason'])) {
| // Check for an incoming reason if(empty($mybb->input['banreason'])) {
|
Zeile 4332 | 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; }
|
Zeile 4342 | Zeile 4325 |
---|
// 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 4388 | 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 4407 | 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 4432 | Zeile 4413 |
---|
} } // Otherwise has errors, throw back to ban page
|
} } // Otherwise has errors, throw back to ban page
|
else
| else
|
{ $mybb->input['action'] = "banuser"; }
| { $mybb->input['action'] = "banuser"; }
|
Zeile 4470 | Zeile 4451 |
---|
FROM ".TABLE_PREFIX."banned b LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid) WHERE b.uid='{$mybb->input['uid']}'
|
FROM ".TABLE_PREFIX."banned b LEFT JOIN ".TABLE_PREFIX."users u ON (b.uid=u.uid) WHERE b.uid='{$mybb->input['uid']}'
|
");
| ");
|
$banned = $db->fetch_array($query);
|
$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 4484 | 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 4621 | Zeile 4602 |
---|
if($mybb->settings['enableattachments'] == 1 && ($nummodqueueattach > 0 || $mybb->usergroup['issupermod'] == 1)) { if($nummodqueueposts > 0 || $mybb->usergroup['issupermod'] == 1)
|
if($mybb->settings['enableattachments'] == 1 && ($nummodqueueattach > 0 || $mybb->usergroup['issupermod'] == 1)) { if($nummodqueueposts > 0 || $mybb->usergroup['issupermod'] == 1)
|
{
| {
|
$bgcolor = "trow1"; } else
| $bgcolor = "trow1"; } else
|
Zeile 4684 | 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 4804 | 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 4923 | 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");
|