mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-27 17:00:52 +01:00
Merge remote-tracking branch 'origin/4.5'
This commit is contained in:
commit
cd15458a32
@ -1440,6 +1440,9 @@
|
||||
// 'db',
|
||||
// );
|
||||
|
||||
// Allow OP to remove arbitrary posts in his thread
|
||||
$config['user_moderation'] = false;
|
||||
|
||||
/*
|
||||
* ====================
|
||||
* Public post search
|
||||
|
13
post.php
13
post.php
@ -56,10 +56,19 @@ if (isset($_POST['delete'])) {
|
||||
$query->execute() or error(db_error($query));
|
||||
|
||||
if ($post = $query->fetch(PDO::FETCH_ASSOC)) {
|
||||
if ($password != '' && $post['password'] != $password)
|
||||
$thread = false;
|
||||
if ($config['user_moderation'] && $post['thread']) {
|
||||
$thread_query = prepare(sprintf("SELECT `time`,`password` FROM ``posts_%s`` WHERE `id` = :id", $board['uri']));
|
||||
$thread_query->bindValue(':id', $post['thread'], PDO::PARAM_INT);
|
||||
$thread_query->execute() or error(db_error($query));
|
||||
|
||||
$thread = $thread_query->fetch(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
if ($password != '' && $post['password'] != $password && (!$thread || $thread['password'] != $password))
|
||||
error($config['error']['invalidpassword']);
|
||||
|
||||
if ($post['time'] > time() - $config['delete_time']) {
|
||||
if ($post['time'] > time() - $config['delete_time'] && (!$thread || $thread['password'] != $password)) {
|
||||
error(sprintf($config['error']['delete_too_soon'], until($post['time'] + $config['delete_time'])));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user