From 21adadc015f621d677026b1bc0535c0734f8715e Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 12 Jun 2007 11:03:34 +0000 Subject: [PATCH] Implemented acl check for copy & paste git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6570 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_CopyPasteHandler.inc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/include/class_CopyPasteHandler.inc b/include/class_CopyPasteHandler.inc index 613f05f17..c11849e2f 100644 --- a/include/class_CopyPasteHandler.inc +++ b/include/class_CopyPasteHandler.inc @@ -228,6 +228,7 @@ class CopyPasteHandler { Create unique names, ids, or what ever */ function execute() { + $ui = get_userinfo(); $type = $this->current['method']; if($type == "cut"){ if(isset($_POST['PerformCopyPaste'])){ @@ -236,7 +237,12 @@ class CopyPasteHandler { $this->_update_vars(); $msgs = $this->check(); - if(count ($msgs) ){ + $acl = $ui->get_category_permissions($this->current['dn'], $this->current['tab_acl_category']); + + /* Check permissions */ + if(!preg_match("/((c|w)|(w|c))/",$acl)){ + print_red(sprintf(_("You are not allowed to cut and paste the following object '%s'."),$this->current['dn'])); + }elseif(count ($msgs) ){ foreach( $msgs as $msg){ print_red($msg); } @@ -271,7 +277,13 @@ class CopyPasteHandler { if(isset($_POST['PerformCopyPaste'])){ $this->_update_vars(); $msgs = $this->check(); - if(count ($msgs) ){ + + $acl = $ui->get_category_permissions($this->current['dn'], $this->current['tab_acl_category']); + + /* Check permissions */ + if(!preg_match("/((c|w)|(w|c))/",$acl)){ + print_red(sprintf(_("You are not allowed to copy and paste the following object '%s'."),$this->current['dn'])); + }elseif(count ($msgs) ){ foreach( $msgs as $msg){ print_red($msg); } -- 2.30.2