diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-08-08 11:47:06 +0200 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-08-08 11:48:58 +0200 |
commit | 218ccf51e38ad9b0654aa509f2bf8eec44d69c07 (patch) | |
tree | a5fed51509d35bf3da7672b7ca94bdbe47644090 /web/lib/pkgreqfuncs.inc.php | |
parent | d61b34f2557eb38142c879cbe2dea8598873dfb3 (diff) |
Add permission checks to the request feature
* Only show the request form to users that are logged in.
* Only show the close request form to Trusted Users and developers.
* Check for a valid login in pkgreq_file().
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/pkgreqfuncs.inc.php')
-rw-r--r-- | web/lib/pkgreqfuncs.inc.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/web/lib/pkgreqfuncs.inc.php b/web/lib/pkgreqfuncs.inc.php index 98fb0cb..9207043 100644 --- a/web/lib/pkgreqfuncs.inc.php +++ b/web/lib/pkgreqfuncs.inc.php @@ -91,6 +91,10 @@ function pkgreq_file($ids, $type, $merge_into, $comments) { global $AUR_REQUEST_ML; global $AUTO_ORPHAN_AGE; + if (!has_credential(CRED_PKGREQ_FILE)) { + return array(false, __("You must be logged in to file package requests.")); + } + if (!empty($merge_into) && !preg_match("/^[a-z0-9][a-z0-9\.+_-]*$/D", $merge_into)) { return array(false, __("Invalid name: only lowercase letters are allowed.")); } |