"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Upload/moderation.php" between
mybb_1821.zip and mybb_1822.zip

About: MyBB is a multilingual, standards-compliant and free forum (discussion board) software.

moderation.php  (mybb_1821):moderation.php  (mybb_1822)
skipping to change at line 2141 skipping to change at line 2141
output_page($movethread); output_page($movethread);
break; break;
// Actually move the threads in Inline moderation // Actually move the threads in Inline moderation
case "do_multimovethreads": case "do_multimovethreads":
// Verify incoming POST request // Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key')); verify_post_check($mybb->get_input('my_post_key'));
$moveto = $mybb->get_input('moveto', MyBB::INPUT_INT); $moveto = $mybb->get_input('moveto', MyBB::INPUT_INT);
$method = $mybb->get_input('method');
$threadlist = explode("|", $mybb->get_input('threads')); $threadlist = explode("|", $mybb->get_input('threads'));
if(!is_moderator_by_tids($threadlist, 'canmanagethreads')) if(!is_moderator_by_tids($threadlist, 'canmanagethreads'))
{ {
error_no_permission(); error_no_permission();
} }
foreach($threadlist as $tid) foreach($threadlist as $tid)
{ {
$tids[] = (int)$tid; $tids[] = (int)$tid;
} }
// Make sure moderator has permission to move to the new forum // Make sure moderator has permission to move to the new forum
skipping to change at line 2163 skipping to change at line 2165
{ {
error($lang->error_movetononmodforum, $lang->error); error($lang->error_movetononmodforum, $lang->error);
} }
$newforum = get_forum($moveto); $newforum = get_forum($moveto);
if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '') if(!$newforum || $newforum['type'] != "f" || $newforum['type'] == "f" && $newforum['linkto'] != '')
{ {
error($lang->error_invalidforum, $lang->error); error($lang->error_invalidforum, $lang->error);
} }
$moderation->move_threads($tids, $moveto); $plugins->run_hooks('moderation_do_multimovethreads');
log_moderator_action($modlogdata, $lang->multi_moved_threads); log_moderator_action($modlogdata, $lang->multi_moved_threads);
$expire = 0;
if($mybb->get_input('redirect_expire', MyBB::INPUT_INT) > 0)
{
$expire = TIME_NOW + ($mybb->get_input('redirect_expire',
MyBB::INPUT_INT) * 86400);
}
foreach($tids as $tid) {
$moderation->move_thread($tid, $moveto, $method, $expire)
;
}
moderation_redirect(get_forum_link($moveto), $lang->redirect_inli ne_threadsmoved); moderation_redirect(get_forum_link($moveto), $lang->redirect_inli ne_threadsmoved);
break; break;
// Delete posts - Inline moderation // Delete posts - Inline moderation
case "multideleteposts": case "multideleteposts":
add_breadcrumb($lang->nav_multi_deleteposts); add_breadcrumb($lang->nav_multi_deleteposts);
if($mybb->get_input('inlinetype') == 'search') if($mybb->get_input('inlinetype') == 'search')
{ {
skipping to change at line 3194 skipping to change at line 3205
} }
$custommod->execute($mybb->get_input('action', My BB::INPUT_INT), $tids); $custommod->execute($mybb->get_input('action', My BB::INPUT_INT), $tids);
$lang->custom_tool = $lang->sprintf($lang->custom _tool, $tool['name']); $lang->custom_tool = $lang->sprintf($lang->custom _tool, $tool['name']);
log_moderator_action($modlogdata, $lang->custom_t ool); log_moderator_action($modlogdata, $lang->custom_t ool);
if($mybb->get_input('inlinetype') == 'search') if($mybb->get_input('inlinetype') == 'search')
{ {
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
$lang->redirect_customtool_search = $lang ->sprintf($lang->redirect_customtool_search, $tool['name']); $lang->redirect_customtool_search = $lang ->sprintf($lang->redirect_customtool_search, $tool['name']);
$return_url = htmlspecialchars_uni($mybb- >get_input('url')); $return_url = htmlspecialchars_uni($mybb- >get_input('url'));
redirect($return_url, $lang->redirect_cus tomtool_search); moderation_redirect($return_url, $lang->r edirect_customtool_search);
} }
else else
{ {
clearinline($fid, "forum"); clearinline($fid, "forum");
$lang->redirect_customtool_forum = $lang- >sprintf($lang->redirect_customtool_forum, $tool['name']); $lang->redirect_customtool_forum = $lang- >sprintf($lang->redirect_customtool_forum, $tool['name']);
redirect(get_forum_link($fid), $lang->red irect_customtool_forum); redirect(get_forum_link($fid), $lang->red irect_customtool_forum);
} }
break; break;
} }
elseif($tool['type'] == 't' && $mybb->get_input('modtype' ) == 'thread') elseif($tool['type'] == 't' && $mybb->get_input('modtype' ) == 'thread')
skipping to change at line 3272 skipping to change at line 3283
} }
$ret = $custommod->execute($mybb->get_input('acti on', MyBB::INPUT_INT), $tids, $pids); $ret = $custommod->execute($mybb->get_input('acti on', MyBB::INPUT_INT), $tids, $pids);
$lang->custom_tool = $lang->sprintf($lang->custom _tool, $tool['name']); $lang->custom_tool = $lang->sprintf($lang->custom _tool, $tool['name']);
log_moderator_action($modlogdata, $lang->custom_t ool); log_moderator_action($modlogdata, $lang->custom_t ool);
if($mybb->get_input('inlinetype') == 'search') if($mybb->get_input('inlinetype') == 'search')
{ {
clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search'); clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
$lang->redirect_customtool_search = $lang ->sprintf($lang->redirect_customtool_search, $tool['name']); $lang->redirect_customtool_search = $lang ->sprintf($lang->redirect_customtool_search, $tool['name']);
$return_url = htmlspecialchars_uni($mybb- >get_input('url')); $return_url = htmlspecialchars_uni($mybb- >get_input('url'));
redirect($return_url, $lang->redirect_cus tomtool_search); moderation_redirect($return_url, $lang->r edirect_customtool_search);
} }
else else
{ {
clearinline($tid, 'thread'); clearinline($tid, 'thread');
if($ret == 'forum') if($ret == 'forum')
{ {
$lang->redirect_customtool_forum = $lang->sprintf($lang->redirect_customtool_forum, $tool['name']); $lang->redirect_customtool_forum = $lang->sprintf($lang->redirect_customtool_forum, $tool['name']);
moderation_redirect(get_forum_lin k($fid), $lang->redirect_customtool_forum); moderation_redirect(get_forum_lin k($fid), $lang->redirect_customtool_forum);
} }
else else
skipping to change at line 3521 skipping to change at line 3532
* Special redirect that takes a return URL into account * Special redirect that takes a return URL into account
* @param string $url URL * @param string $url URL
* @param string $message Message * @param string $message Message
* @param string $title Title * @param string $title Title
*/ */
function moderation_redirect($url, $message="", $title="") function moderation_redirect($url, $message="", $title="")
{ {
global $mybb; global $mybb;
if(!empty($mybb->input['url'])) if(!empty($mybb->input['url']))
{ {
redirect(htmlentities($mybb->input['url']), $message, $title); $url = htmlentities($mybb->input['url']);
} }
if(my_strpos($url, $mybb->settings['bburl'].'/') !== 0)
{
if(my_strpos($url, '/') === 0)
{
$url = my_substr($url, 1);
}
$url_segments = explode('/', $url);
$url = $mybb->settings['bburl'].'/'.end($url_segments);
}
redirect($url, $message, $title); redirect($url, $message, $title);
} }
 End of changes. 7 change blocks. 
4 lines changed or deleted 28 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)