Code

removed not used acls
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 2 Nov 2006 04:09:40 +0000 (04:09 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 2 Nov 2006 04:09:40 +0000 (04:09 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4979 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_SnapShotDialog.inc
include/class_plugin.inc
include/functions.inc
plugins/admin/groups/class_groupManagement.inc

index 4dd1466360bfce1857096b691f3c71737f30a170..957a0077c72c16137c853273678a55657b2914fc 100755 (executable)
@@ -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 */
index 515c30d12a6ba40186dc4bd99d3a18bbd1d518a7..2f9041e1c81856dde5202bbf9686779959594af5 100644 (file)
@@ -1121,12 +1121,11 @@ class plugin
 
   function remove_snapshot($dn)
   {
-echo "FIXME: remove_snapshot uses old acl's<br>";
     $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);
index 6eda98aa4bc95f3afb0029a6819c388369b4a30e..84aa6eb682f1647a50cfe6f40d6ff8ef229c73e9 100644 (file)
@@ -933,14 +933,8 @@ function get_base_from_people($dn)
 
 function chkacl($acl, $name)
 {
-  echo "chkacl - to be removed<br>";
   /* 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 <\"'");
 }
 
 
index a089e376c213d40a4067a728a323e966451614d4..0d9e395e7a5ec76f7f6c5b7b9716f7f6d8130140 100644 (file)
@@ -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);