Zeile 2710 | Zeile 2710 |
---|
// Soft delete posts - Inline moderation case "multisoftdeleteposts":
|
// Soft delete posts - Inline moderation case "multisoftdeleteposts":
|
| |
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if($mybb->get_input('inlinetype') == 'search') { $posts = getids($mybb->get_input('searchid'), 'search');
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
if($mybb->get_input('inlinetype') == 'search') { $posts = getids($mybb->get_input('searchid'), 'search');
|
}
| }
|
else
|
else
|
{
| {
|
$posts = getids($tid, 'thread'); }
if(count($posts) < 1)
|
$posts = getids($tid, 'thread'); }
if(count($posts) < 1)
|
{
| {
|
error($lang->error_inline_nopostsselected); } $pids = array();
if(!is_moderator_by_pids($posts, "cansoftdeleteposts"))
|
error($lang->error_inline_nopostsselected); } $pids = array();
if(!is_moderator_by_pids($posts, "cansoftdeleteposts"))
|
{
| {
|
error_no_permission();
|
error_no_permission();
|
}
| }
|
foreach($posts as $pid) { $pids[] = (int)$pid;
|
foreach($posts as $pid) { $pids[] = (int)$pid;
|
}
| }
|
$moderation->soft_delete_posts($pids);
|
$moderation->soft_delete_posts($pids);
|
| log_moderator_action($modlogdata, $lang->multi_soft_delete_posts);
|
|
|
log_moderator_action($modlogdata, $lang->multi_soft_delete_posts);
| |
if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
|
if($mybb->get_input('inlinetype') == 'search') { clearinline($mybb->get_input('searchid', MyBB::INPUT_INT), 'search');
|
}
| }
|
else { clearinline($tid, 'thread');
| else { clearinline($tid, 'thread');
|
Zeile 2757 | Zeile 2756 |
---|
$groups = explode(",", $mybb->settings['purgespammergroups']); if(!in_array($mybb->user['usergroup'], $groups))
|
$groups = explode(",", $mybb->settings['purgespammergroups']); if(!in_array($mybb->user['usergroup'], $groups))
|
{
| {
|
error_no_permission(); }
$uid = $mybb->input['uid']; $user = get_user($uid); if(!$user['uid'] || !purgespammer_show($user['postnum'], $user['usergroup'], $user['uid']))
|
error_no_permission(); }
$uid = $mybb->input['uid']; $user = get_user($uid); if(!$user['uid'] || !purgespammer_show($user['postnum'], $user['usergroup'], $user['uid']))
|
{
| {
|
error($lang->purgespammer_invalid_user); }
if($mybb->input['action'] == "do_purgespammer") { verify_post_check($mybb->get_input('my_post_key'));
|
error($lang->purgespammer_invalid_user); }
if($mybb->input['action'] == "do_purgespammer") { verify_post_check($mybb->get_input('my_post_key'));
|
|
|
$user_deleted = false;
// Run the hooks first to avoid any issues when we delete the user
| $user_deleted = false;
// Run the hooks first to avoid any issues when we delete the user
|
Zeile 2791 | Zeile 2790 |
---|
if($db->num_rows($query) > 0) { $banupdate = array(
|
if($db->num_rows($query) > 0) { $banupdate = array(
|
"reason" => $db->escape_string($mybb->settings['purgespammerbanreason'])
| "reason" => $db->escape_string($mybb->settings['purgespammerbanreason'])
|
); $db->update_query('banned', $banupdate, "uid = '{$uid}'"); }
| ); $db->update_query('banned', $banupdate, "uid = '{$uid}'"); }
|
Zeile 2818 | Zeile 2817 |
---|
$ip = my_inet_ntop($db->unescape_binary($ip)); $query = $db->simple_select("banfilters", "type", "type = 1 AND filter = '".$db->escape_string($ip)."'"); if($db->num_rows($query) == 0)
|
$ip = my_inet_ntop($db->unescape_binary($ip)); $query = $db->simple_select("banfilters", "type", "type = 1 AND filter = '".$db->escape_string($ip)."'"); if($db->num_rows($query) == 0)
|
{
| {
|
$insert = array( "filter" => $db->escape_string($ip), "type" => 1,
| $insert = array( "filter" => $db->escape_string($ip), "type" => 1,
|
Zeile 2979 | Zeile 2978 |
---|
else { $lang->redirect_customtool_thread = $lang->sprintf($lang->redirect_customtool_thread, $tool['name']);
|
else { $lang->redirect_customtool_thread = $lang->sprintf($lang->redirect_customtool_thread, $tool['name']);
|
moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_customtool_thread); } break;
| moderation_redirect(get_thread_link($thread['tid']), $lang->redirect_customtool_thread); } break;
|
} elseif($tool['type'] == 'p' && $mybb->get_input('modtype') == 'inlinepost') {
| } elseif($tool['type'] == 'p' && $mybb->get_input('modtype') == 'inlinepost') {
|
Zeile 3047 | Zeile 3046 |
---|
break; }
|
break; }
|
// Some little handy functions for our inline moderation
| /** * Some little handy functions for our inline moderation * * @param int $id * @param string $type * * @return array */
|
function getids($id, $type) { global $mybb;
|
function getids($id, $type) { global $mybb;
|
|
|
$newids = array(); $cookie = "inlinemod_".$type.$id; if(isset($mybb->cookies[$cookie]))
| $newids = array(); $cookie = "inlinemod_".$type.$id; if(isset($mybb->cookies[$cookie]))
|
Zeile 3063 | Zeile 3069 |
---|
if(empty($cookie_id)) { continue;
|
if(empty($cookie_id)) { continue;
|
}
| }
|
if($cookie_id == 'ALL') {
| if($cookie_id == 'ALL') {
|
Zeile 3075 | Zeile 3081 |
---|
} } }
|
} } }
|
|
|
return $newids; }
|
return $newids; }
|
| /** * @param int $id * @param string $type * * @return array */
|
function getallids($id, $type) { global $db, $mybb;
| function getallids($id, $type) { global $db, $mybb;
|
Zeile 3140 | Zeile 3152 |
---|
return $ids; }
|
return $ids; }
|
| /** * @param int $id * @param string $type */
|
function clearinline($id, $type) { my_unsetcookie("inlinemod_".$type.$id);
|
function clearinline($id, $type) { my_unsetcookie("inlinemod_".$type.$id);
|
my_unsetcookie("inlinemod_".$type.$id."_removed");
| my_unsetcookie("inlinemod_{$type}{$id}_removed");
|
}
|
}
|
| /** * @param int $id * @param string $type */
|
function extendinline($id, $type) {
|
function extendinline($id, $type) {
|
my_setcookie("inlinemod_$type$id", '', TIME_NOW+3600); my_setcookie("inlinemod_$type$id_removed", '', TIME_NOW+3600);
| my_setcookie("inlinemod_{$type}{$id}", '', TIME_NOW+3600); my_setcookie("inlinemod_{$type}{$id}_removed", '', TIME_NOW+3600);
|
}
/**
| }
/**
|
Zeile 3158 | Zeile 3178 |
---|
* Note: If no posts are specified, this function will return true. It is the * responsibility of the calling script to error-check this case if necessary. *
|
* Note: If no posts are specified, this function will return true. It is the * responsibility of the calling script to error-check this case if necessary. *
|
* @param array Array of post IDs * @param string Permission to check * @returns bool True if moderator of all; false otherwise
| * @param array $posts Array of post IDs * @param string $permission Permission to check * @return bool True if moderator of all; false otherwise
|
*/ function is_moderator_by_pids($posts, $permission='') {
| */ function is_moderator_by_pids($posts, $permission='') {
|
Zeile 3202 | Zeile 3222 |
---|
* Note: If no threads are specified, this function will return true. It is the * responsibility of the calling script to error-check this case if necessary. *
|
* Note: If no threads are specified, this function will return true. It is the * responsibility of the calling script to error-check this case if necessary. *
|
* @param array Array of thread IDs * @param string Permission to check * @returns bool True if moderator of all; false otherwise
| * @param array $threads Array of thread IDs * @param string $permission Permission to check * @return bool True if moderator of all; false otherwise
|
*/ function is_moderator_by_tids($threads, $permission='') {
| */ function is_moderator_by_tids($threads, $permission='') {
|
Zeile 3242 | Zeile 3262 |
---|
/** * Special redirect that takes a return URL into account
|
/** * Special redirect that takes a return URL into account
|
* @param string URL * @param string Message * @param string Title
| * @param string $url URL * @param string $message Message * @param string $title Title
|
*/ function moderation_redirect($url, $message="", $title="") {
| */ function moderation_redirect($url, $message="", $title="") {
|