From f7278e5a61f2617ae4d99d83529c82df048cc0b1 Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 6 May 2014 21:53:05 +0200 Subject: user moderation support --- post.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'post.php') diff --git a/post.php b/post.php index 91abe7e6..9603afac 100644 --- a/post.php +++ b/post.php @@ -52,10 +52,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']))); } -- cgit v1.3 From c2c7859a9ed4cb94b8f5e38091463ffb485b4545 Mon Sep 17 00:00:00 2001 From: Jano Slota Date: Sat, 10 May 2014 01:31:16 +0200 Subject: Fixed a little exiftool bug Conflicts: post.php --- post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'post.php') diff --git a/post.php b/post.php index 9603afac..008f8978 100644 --- a/post.php +++ b/post.php @@ -641,7 +641,7 @@ if (isset($_POST['delete'])) { if (!$config['redraw_image'] && $config['use_exiftool']) { if($error = shell_exec_error('exiftool -overwrite_original -ignoreMinorErrors -q -q -all= ' . escapeshellarg($upload))) - error('Could not strip EXIF metadata!', null, $error); + error(_('Could not strip EXIF metadata!'), null, $error); } else { $image->to($post['file']); $dont_copy_file = true; -- cgit v1.3