From: hickert Date: Thu, 2 Nov 2006 04:09:40 +0000 (+0000) Subject: removed not used acls X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a5f64969f79afcb758fda36cc56be10aff3fd2fb;p=gosa.git removed not used acls git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4979 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_SnapShotDialog.inc b/include/class_SnapShotDialog.inc index 4dd146636..957a0077c 100755 --- a/include/class_SnapShotDialog.inc +++ b/include/class_SnapShotDialog.inc @@ -39,30 +39,25 @@ class SnapShotDialog extends plugin $entry = base64_decode(preg_replace("/_[xy]$/","",$entry)); $acl = get_permissions ($entry, $this->ui->subtreeACL); - $this->acl = get_module_permission($acl, "snapshot", $entry ); - - if (chkacl($this->acl, "delete") == ""){ - $this->del_dn = $entry; - $smarty= get_smarty(); - $smarty->assign("intro", sprintf(_("You're about to delete the snapshot '%s'."), @LDAP::fix($this->del_dn))); - return($smarty->fetch (get_template_path('remove.tpl'))); - } else { - - /* Obviously the user isn't allowed to delete. Show message and - clean session. */ - print_red (_("You are not allowed to delete this snapshot!")); - } - } - } + $this->acl = get_module_permission($acl, "snapshot", $entry ); + + + $this->del_dn = $entry; + $smarty= get_smarty(); + $smarty->assign("intro", sprintf(_("You're about to delete the snapshot '%s'."), @LDAP::fix($this->del_dn))); + return($smarty->fetch (get_template_path('remove.tpl'))); + + /* Obviously the user isn't allowed to delete. Show message and + clean session. + print_red (_("You are not allowed to delete this snapshot!")); + */ + } + } - /* Remove snapshot */ - if(isset($_POST['delete_confirm']) && !empty($this->del_dn)){ - $acl = get_permissions ($this->del_dn, $this->ui->subtreeACL); - $this->acl = get_module_permission($acl, "snapshot", $this->del_dn); - if (chkacl($this->acl, "delete") == ""){ - $this->remove_snapshot($this->del_dn); - $this->del_dn = ""; - } + /* Remove snapshot */ + if(isset($_POST['delete_confirm']) && !empty($this->del_dn)){ + $this->remove_snapshot($this->del_dn); + $this->del_dn = ""; } /* We must restore a snapshot */ diff --git a/include/class_plugin.inc b/include/class_plugin.inc index 515c30d12..2f9041e1c 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -1121,12 +1121,11 @@ class plugin function remove_snapshot($dn) { -echo "FIXME: remove_snapshot uses old acl's
"; $ui = get_userinfo(); $acl = get_permissions ($dn, $ui->subtreeACL); $acl = get_module_permission($acl, "snapshot", $dn); - if (chkacl($this->acl, "delete") == ""){ + if($this->acl_is_removeable()) $ldap = $this->config->get_ldap_link(); $ldap->cd($this->config->current['BASE']); $ldap->rmdir_recursive($dn); diff --git a/include/functions.inc b/include/functions.inc index 6eda98aa4..84aa6eb68 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -933,14 +933,8 @@ function get_base_from_people($dn) function chkacl($acl, $name) { - echo "chkacl - to be removed
"; /* Look for attribute in ACL */ - if (preg_match("/#$name#/", $acl) || $acl == "#all#"){ - return (""); - } - - /* Optically disable html object for no match */ - return (" disabled "); + return ("'\"> CHKACL is deprecated use this::getacl() instead <\"'"); } diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc index a089e376c..0d9e395e7 100644 --- a/plugins/admin/groups/class_groupManagement.inc +++ b/plugins/admin/groups/class_groupManagement.inc @@ -226,9 +226,8 @@ class groupManagement 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, "group", $this->dn); - if (chkacl($this->acl, "delete") == ""){ + $acl = $this->ui->get_permission($this->dn,"groups/group"); + if(preg_match("/d/",$acl)){ /* Check locking, save current plugin in 'back_plugin', so the dialog knows where to return. */ @@ -258,7 +257,8 @@ class groupManagement extends plugin /* Some nice guy may send this as POST, so we've to check for the permissions again. */ - if (chkacl($this->acl, "delete") == ""){ + $acl = $this->ui->get_permission($this->dn,"groups/group"); + if(preg_match("/d/",$acl)){ /* Delete request is permitted, perform LDAP action */ $this->grouptab= new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $this->dn);