From: hickert Date: Fri, 2 Dec 2005 10:04:31 +0000 (+0000) Subject: Fixed Macro acls X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=074f7f4d11e38686387386f9e9b21fd89b64aaec;p=gosa.git Fixed Macro acls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2202 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/groups/acl_definition.inc b/plugins/admin/groups/acl_definition.inc index b4bff2ebb..2413e2205 100644 --- a/plugins/admin/groups/acl_definition.inc +++ b/plugins/admin/groups/acl_definition.inc @@ -315,5 +315,6 @@ $ACLD['conference'] = array( $ACLD['FAIclass'] = array( // Allow displaying of FAI menu element "FAIclass" => "FAI management enabled"); +$ACLD['goFonMacro'] =array("goFonMacro","edit","delete"); ?> diff --git a/plugins/gofon/macro/class_gofonMacro.inc b/plugins/gofon/macro/class_gofonMacro.inc index 051675f87..d33f8a605 100755 --- a/plugins/gofon/macro/class_gofonMacro.inc +++ b/plugins/gofon/macro/class_gofonMacro.inc @@ -77,6 +77,9 @@ class macro extends plugin $this->orig_cn=$this->cn; $this->base= dn2base($this->dn); } + $ui= get_userinfo(); + $acl= get_permissions ($ui->dn, $ui->subtreeACL); + $this->acl= get_module_permission($acl, "goFonMacro", $ui->dn); } /*! Execute this plugin */ @@ -327,7 +330,11 @@ class macro extends plugin { if (isset($_POST['displayName'])){ plugin::save_object(); - + } + foreach($this->attributes as $attr){ + if(isset($_POST[$attr])){ + $this->$attr= $_POST [$attr]; + } } } @@ -360,7 +367,7 @@ class macro extends plugin } foreach($this->attributes as $attr){ - if(chkacl($this->acl,$attr)){ + if(chkacl($this->acl,"edit")){ $str = sprintf( _("Insufficient permissions, can't change attribute '%s' in goFonMacro"),$attr) ; return(array($str)); } diff --git a/plugins/gofon/macro/class_gofonMacroManagement.inc b/plugins/gofon/macro/class_gofonMacroManagement.inc index c6f130323..0f5d78255 100755 --- a/plugins/gofon/macro/class_gofonMacroManagement.inc +++ b/plugins/gofon/macro/class_gofonMacroManagement.inc @@ -43,6 +43,9 @@ class gofonMacro extends plugin $macrofilter= array("depselect" => $base, "regex" => "*"); register_global("macrofilter", $macrofilter); } + + $acl= get_permissions ($ui->dn, $ui->subtreeACL); + $this->acl= get_module_permission($acl, "goFonMacro", $ui->dn); } function execute() @@ -154,7 +157,6 @@ class gofonMacro extends plugin /* Create new usertab object */ $this->macrotabs= new macrotabs($this->config,$this->config->data['TABS']['MACROTABS'], $this->dn); - $this->macrotabs->set_acl(array(':all')); } /* Cancel dialogs */ @@ -216,14 +218,9 @@ class gofonMacro extends plugin /* Lock the current entry, so everyone will get the above dialog */ add_lock ($this->dn, $this->ui->dn); - - /* Set up the users ACL's for this 'dn' */ - $acl= get_permissions ($this->dn, $this->ui->subtreeACL); - /* Register macrotabs to trigger edit dialog */ $this->macrotabs= new macrotabs($this->config, - $this->config->data['TABS']['MACROTABS'], $this->dn); - $this->macrotabs->set_acl($acl); + $this->config->data['TABS']['MACROTABS'], $this->dn); $_SESSION['objectinfo']= $this->dn; } @@ -236,7 +233,7 @@ class gofonMacro extends plugin /* Load permissions for selected 'dn' and check if we're allowed to remove this 'dn' */ $acl= get_permissions ($this->dn, $this->ui->subtreeACL); - $this->acl= get_module_permission($acl, "macro", $this->dn); + $this->acl= get_module_permission($acl, "goFonMacro", $this->dn); if (chkacl($this->acl, "delete") == ""){ /* Check locking, save current plugin in 'back_plugin', so diff --git a/plugins/gofon/macro/class_gofonMacroParameters.inc b/plugins/gofon/macro/class_gofonMacroParameters.inc index c9a97d783..e7e7b0d0a 100755 --- a/plugins/gofon/macro/class_gofonMacroParameters.inc +++ b/plugins/gofon/macro/class_gofonMacroParameters.inc @@ -101,7 +101,10 @@ class macroParameter extends plugin $this->goFonMacroParameter = $tmp2; $this->para_count = count ($tmp2); - + + $ui= get_userinfo(); + $acl= get_permissions ($ui->dn, $ui->subtreeACL); + $this->acl= get_module_permission($acl, "goFonMacro", $ui->dn); } //! Perform Parameter check @@ -320,7 +323,7 @@ class macroParameter extends plugin $message = array(); foreach($this->attributes as $attr){ - if(chkacl($this->acl,$attr)){ + if(chkacl($this->acl,"edit")){ $str = sprintf( _("Insufficient permissions, can't change attribute '%s' in goFonMacro."),$attr) ; return(array($str)); }