From 206d0b94f4010e8a5cbce74c5afbae46adf03d74 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 9 Jan 2020 13:22:29 +0100 Subject: [permissionmanager] Make default roles "builtin" i.e. not modifiable --- inc/request.inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/request.inc.php b/inc/request.inc.php index a2dc9711..6104fafd 100644 --- a/inc/request.inc.php +++ b/inc/request.inc.php @@ -6,8 +6,16 @@ class Request { + /** + * Required and not empty + */ const REQUIRED = "\0\1\2REQ\0\1\2"; + /** + * Required, but might be empty + */ + const REQUIRED_EMPTY = "\0\3\4REQ\0\3\4"; + /** * * @param string $key Key of field to get from $_GET @@ -61,7 +69,7 @@ class Request private static function handle(&$array, $key, $default, $type) { if (!isset($array[$key])) { - if ($default === self::REQUIRED) { + if ($default === self::REQUIRED || $default === self::REQUIRED_EMPTY) { Message::addError('main.parameter-missing', $key); Util::redirect('?do=' . $_REQUEST['do']); } -- cgit v1.2.3-55-g7522