summaryrefslogtreecommitdiff
path: root/inc/auth.php
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-06-03 22:55:01 +0200
committerandi <andi@splitbrain.org>2005-06-03 22:55:01 +0200
commit8ef6b7cad0b5839ab823182392161af60f15fd69 (patch)
treee143cd40ad8581810fe78fcfac00dcb660a035da /inc/auth.php
parent5ef370d246543eb020ac46989b5ab8717e10a5b0 (diff)
downloadrpg-8ef6b7cad0b5839ab823182392161af60f15fd69.tar.gz
rpg-8ef6b7cad0b5839ab823182392161af60f15fd69.tar.bz2
Mediafile Deletion and Overwrite Handling #200
This patch enhances the ACL feature by adding another Permission called DELETE - this permission allows a user to delete or overwrite existing mediafiles. Users with UPLOAD permission are no longer allowed to overwrite media files. Users whith DELETE permissions now need to check an additional checkbox to overwrite existing files, this is to prevent accidently deletions. Please note: If no ACL is used UPLOAD rights are assumed for everybody - not DELETE rights. This changes the behaviour from previous versions as UPLOAD does not allow overwriting anymore. darcs-hash:20050603205501-9977f-1d219b23a79bb097ed0e0b8184dc6d5d8aad578b.gz
Diffstat (limited to 'inc/auth.php')
-rw-r--r--inc/auth.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/inc/auth.php b/inc/auth.php
index a948a544f..a55cfbc51 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -23,6 +23,7 @@
define('AUTH_EDIT',2);
define('AUTH_CREATE',4);
define('AUTH_UPLOAD',8);
+ define('AUTH_DELETE',16);
define('AUTH_ADMIN',255);
if($conf['useacl']){
@@ -249,7 +250,7 @@ function auth_aclcheck($id,$user,$groups){
foreach($matches as $match){
$match = preg_replace('/#.*$/','',$match); //ignore comments
$acl = preg_split('/\s+/',$match);
- if($acl[2] > AUTH_UPLOAD) $acl[2] = AUTH_UPLOAD; //no admins in the ACL!
+ if($acl[2] > AUTH_DELETE) $acl[2] = AUTH_DELETE; //no admins in the ACL!
if($acl[2] > $perm){
$perm = $acl[2];
}
@@ -273,7 +274,7 @@ function auth_aclcheck($id,$user,$groups){
foreach($matches as $match){
$match = preg_replace('/#.*$/','',$match); //ignore comments
$acl = preg_split('/\s+/',$match);
- if($acl[2] > AUTH_UPLOAD) $acl[2] = AUTH_UPLOAD; //no admins in the ACL!
+ if($acl[2] > AUTH_DELETE) $acl[2] = AUTH_DELETE; //no admins in the ACL!
if($acl[2] > $perm){
$perm = $acl[2];
}