Allow mods to post in locked threads as per the config

This commit is contained in:
Savetheinternet 2011-01-03 01:33:57 +11:00
parent 5df6f85854
commit 8fe1846e56
2 changed files with 11 additions and 4 deletions

View File

@ -189,6 +189,8 @@
define('MOD_STICKY', MOD_MOD, true); define('MOD_STICKY', MOD_MOD, true);
// Lock a thread // Lock a thread
define('MOD_LOCK', MOD_MOD, true); define('MOD_LOCK', MOD_MOD, true);
// Post in a locked thread
define('MOD_POSTINLOCKED', MOD_MOD, true);
/* Administration */ /* Administration */
// Display the contents of instant-config.php // Display the contents of instant-config.php

View File

@ -70,9 +70,6 @@
if(!$OP && !threadExists($post['thread'])) if(!$OP && !threadExists($post['thread']))
error(ERROR_NONEXISTANT); error(ERROR_NONEXISTANT);
if(!$OP && threadLocked($post['thread']))
error(ERROR_LOCKED);
// Check for a file // Check for a file
if($OP) { if($OP) {
if(!isset($_FILES['file']['tmp_name']) || empty($_FILES['file']['tmp_name'])) if(!isset($_FILES['file']['tmp_name']) || empty($_FILES['file']['tmp_name']))
@ -102,6 +99,14 @@
if($post['locked'] && $mod['type'] < MOD_LOCK) error(ERROR_NOACCESS); if($post['locked'] && $mod['type'] < MOD_LOCK) error(ERROR_NOACCESS);
} }
// Check if thread is locked
// but allow mods to post
if(!$OP && threadLocked($post['thread'])) {
if(!$mod || $mod['type'] < MOD_POSTINLOCKED) {
error(ERROR_LOCKED);
}
}
if($post['has_file']) { if($post['has_file']) {
$size = $_FILES['file']['size']; $size = $_FILES['file']['size'];
if($size > MAX_FILESIZE) if($size > MAX_FILESIZE)