Bans should no longer be broken.
git-svn-id: http://kusabax.cultnet.net/svn/repo/stable@255 73d99b7e-4f53-4972-b7b7-2ecd3c4d89ee
This commit is contained in:
1 parent
5214c80705
commit
2e05709a5f
1 file changed
+20
-15
@@ -3095,6 +3095,7 @@ class Manage {
|
|||||||
/* Addition, modification, deletion, and viewing of bans */
|
/* Addition, modification, deletion, and viewing of bans */
|
||||||
function bans() {
|
function bans() {
|
||||||
global $tc_db, $tpl_page, $bans_class;
|
global $tc_db, $tpl_page, $bans_class;
|
||||||
|
|
||||||
$this->ModeratorsOnly();
|
$this->ModeratorsOnly();
|
||||||
$reason = KU_BANREASON;
|
$reason = KU_BANREASON;
|
||||||
$ban_ip = ''; $ban_hash = ''; $ban_parentid = 0; $multiban = Array();
|
$ban_ip = ''; $ban_hash = ''; $ban_parentid = 0; $multiban = Array();
|
||||||
@@ -3198,28 +3199,30 @@ class Manage {
|
|||||||
exitWithErrorPage(_gettext('That IP is on the whitelist'));
|
exitWithErrorPage(_gettext('That IP is on the whitelist'));
|
||||||
}
|
}
|
||||||
if ($bans_class->BanUser($ban_ip, $_SESSION['manageusername'], $ban_globalban, $ban_duration, $ban_boards, $ban_reason, $ban_note, $ban_appealat, $ban_type, $ban_allowread)) {
|
if ($bans_class->BanUser($ban_ip, $_SESSION['manageusername'], $ban_globalban, $ban_duration, $ban_boards, $ban_reason, $ban_note, $ban_appealat, $ban_type, $ban_allowread)) {
|
||||||
|
$regenerated = array();
|
||||||
if (((KU_BANMSG != '' || $_POST['banmsg'] != '') && isset($_POST['addbanmsg']) && (isset($_POST['quickbanpostid']) || isset($_POST['quickmultibanpostid']))) || $instantban ) {
|
if (((KU_BANMSG != '' || $_POST['banmsg'] != '') && isset($_POST['addbanmsg']) && (isset($_POST['quickbanpostid']) || isset($_POST['quickmultibanpostid']))) || $instantban ) {
|
||||||
$ban_msg = ((KU_BANMSG == $_POST['banmsg']) || empty($_POST['banmsg'])) ? KU_BANMSG : $_POST['banmsg'];
|
$ban_msg = ((KU_BANMSG == $_POST['banmsg']) || empty($_POST['banmsg'])) ? KU_BANMSG : $_POST['banmsg'];
|
||||||
if (isset($ban_post_id))
|
if (isset($ban_post_id))
|
||||||
$postids = Array($ban_post_id);
|
$postids = Array($ban_post_id);
|
||||||
else
|
else
|
||||||
$postids = unserialize($_POST['quickmultibanpostid']);
|
$postids = unserialize($_POST['quickmultibanpostid']);
|
||||||
$regenerated = array();
|
|
||||||
$results = $tc_db->GetAll("SELECT HIGH_PRIORITY `parentid`, `message` FROM `".KU_DBPREFIX."posts` WHERE `boardid` = " . $tc_db->qstr($ban_board_id) . " AND `id` = ".$tc_db->qstr($postids[$i])." LIMIT 1");
|
$results = $tc_db->GetAll("SELECT HIGH_PRIORITY `parentid`, `message` FROM `".KU_DBPREFIX."posts` WHERE `boardid` = " . $tc_db->qstr($ban_board_id) . " AND `id` = ".$tc_db->qstr($postids[$i])." LIMIT 1");
|
||||||
|
|
||||||
foreach($results AS $line) {
|
foreach($results AS $line) {
|
||||||
$tc_db->Execute("UPDATE `".KU_DBPREFIX."posts` SET `message` = ".$tc_db->qstr($line['message'] . $ban_msg)." WHERE `boardid` = " . $tc_db->qstr($ban_board_id) . " AND `id` = ".$tc_db->qstr($postids[$i]));
|
$tc_db->Execute("UPDATE `".KU_DBPREFIX."posts` SET `message` = ".$tc_db->qstr($line['message'] . $ban_msg)." WHERE `boardid` = " . $tc_db->qstr($ban_board_id) . " AND `id` = ".$tc_db->qstr($postids[$i]));
|
||||||
echo $ban_msg . ' Post ' . $i;
|
echo $ban_msg . ' Post ' . $i;
|
||||||
clearPostCache($postids[$i], $ban_board_id);
|
clearPostCache($postids[$i], $ban_board_id);
|
||||||
}
|
if ($line['parentid']==0) {
|
||||||
}
|
if (!in_array($postids, $regenerated)) {
|
||||||
if ($line['parentid']==0) {
|
$regenerated[] = $postids[$i];
|
||||||
if (!in_array(current($postids), $regenerated)) {
|
echo 'Line 3368';
|
||||||
$regenerated[] = current($postids);
|
}
|
||||||
}
|
} else {
|
||||||
} else {
|
if (!in_array($line['parentid'], $regenerated)) {
|
||||||
if (!in_array($line['parentid'], $regenerated)) {
|
$regenerated[] = $line['parentid'];
|
||||||
$regenerated[] = $line['parentid'];
|
echo 'Line 3373';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$tpl_page .= _gettext('Ban successfully placed.')."<br />";
|
$tpl_page .= _gettext('Ban successfully placed.')."<br />";
|
||||||
@@ -3235,12 +3238,14 @@ class Manage {
|
|||||||
$ban_ip = '';
|
$ban_ip = '';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$board_class = new Board($ban_board);
|
if (count($regenerated) > 0) {
|
||||||
foreach($regenerated as $thread) {
|
$board_class = new Board($ban_board);
|
||||||
$board_class->RegenerateThreads($thread);
|
foreach($regenerated as $thread) {
|
||||||
|
$board_class->RegenerateThreads($thread);
|
||||||
|
}
|
||||||
|
$board_class->RegeneratePages();
|
||||||
|
unset($board_class);
|
||||||
}
|
}
|
||||||
$board_class->RegeneratePages();
|
|
||||||
unset($board_class);
|
|
||||||
|
|
||||||
if(isset($_POST['deleteposts'])) {
|
if(isset($_POST['deleteposts'])) {
|
||||||
$tpl_page .= '<br />';
|
$tpl_page .= '<br />';
|
||||||
|
|||||||
Reference in new issue
Block a user