"ban&delete"
This commit is contained in:
parent
ee6af9bfba
commit
a0ef70beab
9
mod.php
9
mod.php
@ -348,12 +348,13 @@
|
|||||||
header('Location: ' . $_SERVER['HTTP_REFERER'], true, REDIRECT_HTTP);
|
header('Location: ' . $_SERVER['HTTP_REFERER'], true, REDIRECT_HTTP);
|
||||||
else
|
else
|
||||||
header('Location: ?/' . sprintf(BOARD_PATH, $boardName) . FILE_INDEX, true, REDIRECT_HTTP);
|
header('Location: ?/' . sprintf(BOARD_PATH, $boardName) . FILE_INDEX, true, REDIRECT_HTTP);
|
||||||
} elseif(preg_match('/^\/' . $regex['board'] . 'ban\/(\d+)$/', $query, $matches)) {
|
} elseif(preg_match('/^\/' . $regex['board'] . 'ban(&delete)\/(\d+)$/', $query, $matches)) {
|
||||||
if($mod['type'] < MOD_DELETE) error(ERROR_NOACCESS);
|
if($mod['type'] < MOD_DELETE) error(ERROR_NOACCESS);
|
||||||
// Ban by post
|
// Ban by post
|
||||||
|
|
||||||
$boardName = $matches[1];
|
$boardName = $matches[1];
|
||||||
$post = $matches[2];
|
$delete = isset($matches[2]) && $matches[2] == '&delete';
|
||||||
|
$post = $matches[3];
|
||||||
// Open board
|
// Open board
|
||||||
if(!openBoard($boardName))
|
if(!openBoard($boardName))
|
||||||
error(ERROR_NOBOARD);
|
error(ERROR_NOBOARD);
|
||||||
@ -427,6 +428,10 @@
|
|||||||
}
|
}
|
||||||
$query->execute() or error(db_error($query));
|
$query->execute() or error(db_error($query));
|
||||||
|
|
||||||
|
// Delete too
|
||||||
|
if($delete)
|
||||||
|
deletePost($post['id']);
|
||||||
|
|
||||||
// Redirect
|
// Redirect
|
||||||
if(isset($_POST['continue']))
|
if(isset($_POST['continue']))
|
||||||
header('Location: ' . $_POST['continue'], true, REDIRECT_HTTP);
|
header('Location: ' . $_POST['continue'], true, REDIRECT_HTTP);
|
||||||
|
Loading…
Reference in New Issue
Block a user