Code

ACL: Skip listing system snapshot that we are not able to restore.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 30 Nov 2006 12:05:40 +0000 (12:05 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 30 Nov 2006 12:05:40 +0000 (12:05 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5272 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_systemManagement.inc

index 3100fd44503e4b72f2288e006c8b36b7a688cabe..1ab430adb90966e4ce224dde8f37136d48c9fc58 100644 (file)
@@ -604,8 +604,25 @@ class systems extends plugin
   function get_used_snapshot_bases()
   {
     $tmp = array();
-    foreach(array("phones","servers","printers","terminals","netdevices","workstations") as $ent){
-      $tmp[] = "ou=".$ent.",ou=systems,".$this->DivListSystem->selectedBase;
+
+    /* Check acls, if we are not allowed to create and write each plugin tab, skip this object */
+
+    $tabs = array(
+        "terminal"        => "ou=terminals,ou=systems,",
+        "workstation"     => "ou=workstations,ou=systems,",
+        "server"          => "ou=servers,ou=systems,",
+        "printer"         => "ou=printers,ou=systems,",
+        "phone"           => "ou=phones,ou=systems,",
+        "winworkstation"  => get_winstations_ou(),
+        "component"       => "ou=netdevices,ou=systems,"
+        ); 
+
+    foreach($tabs as $acl_cat => $dn){
+
+      $acl_all = $this->ui->has_complete_category_acls($dn.$this->DivListSystem->selectedBase,$acl_cat);
+      if(preg_match("/(c.*w|w.*c)/",$acl_all)){
+        $tmp[] = $dn.$this->DivListSystem->selectedBase;
+      }
     }
     return($tmp); 
   }