Code

Included category matching
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 26 Jul 2006 09:13:04 +0000 (09:13 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 26 Jul 2006 09:13:04 +0000 (09:13 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4310 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_plugin.inc
plugins/admin/systems/class_systemManagement.inc
plugins/admin/users/tabs_user.inc

index a83cb1cea7635d4c1d774db435fadc04323287d4..de552c67d16d6c32f4564ed155aeb5426194e8f0 100644 (file)
@@ -109,6 +109,7 @@ class plugin
   var $saved_attributes= array();
 
   var $acl_base= "";
+  var $acl_category= "";
 
   /* Plugin identifier */
   var $plHeadline= "";
@@ -1410,38 +1411,44 @@ echo "FIXME: remove_snapshot uses old acl's<br>";
   }
 
 
+  function set_acl_category($category)
+  {
+    $this->acl_category= "$category/";
+  }
+
+
   function acl_is_writeable($attribute,$skip_write = FALSE)
   {
     $ui= get_userinfo();
-    return preg_match('/w/', $ui->get_permissions($this->acl_base, get_class($this), $attribute,$skip_write));
+    return preg_match('/w/', $ui->get_permissions($this->acl_base, $this->acl_category.get_class($this), $attribute, $skip_write));
   }
 
 
   function acl_is_readable($attribute)
   {
     $ui= get_userinfo();
-    return preg_match('/r/', $ui->get_permissions($this->acl_base, get_class($this), $attribute));
+    return preg_match('/r/', $ui->get_permissions($this->acl_base, $this->acl_category.get_class($this), $attribute));
   }
 
 
   function acl_is_createable()
   {
     $ui= get_userinfo();
-    return preg_match('/c/', $ui->get_permissions($this->acl_base, get_class($this), '0'));
+    return preg_match('/c/', $ui->get_permissions($this->acl_base, $this->acl_category.get_class($this), '0'));
   }
 
 
   function acl_is_removeable()
   {
     $ui= get_userinfo();
-    return preg_match('/d/', $ui->get_permissions($this->acl_base, get_class($this), '0'));
+    return preg_match('/d/', $ui->get_permissions($this->acl_base, $this->acl_category.get_class($this), '0'));
   }
 
 
   function acl_is_moveable()
   {
     $ui= get_userinfo();
-    return preg_match('/m/', $ui->get_permissions($this->acl_base, get_class($this), '0'));
+    return preg_match('/m/', $ui->get_permissions($this->acl_base, $this->acl_category.get_class($this), '0'));
   }
 
 
@@ -1453,7 +1460,7 @@ echo "FIXME: remove_snapshot uses old acl's<br>";
   function getacl($attribute,$skip_write= FALSE)
   {
     $ui= get_userinfo();
-    return  $ui->get_permissions($this->acl_base, get_class($this), $attribute,$skip_write);
+    return  $ui->get_permissions($this->acl_base, $this->acl_category.get_class($this), $attribute,$skip_write);
   }
 
 
index fcad7c7bdd06766339e200bc8db6f3029509f3aa..0f86b327eb134579f491232cd6e01baffd338b78 100644 (file)
@@ -395,8 +395,18 @@ class systems extends plugin
       if (count($message) == 0){
 
         /* Save terminal data to ldap */
-        gosa_log ("System object'".$this->dn."' has been saved");
+        if(isset($_SESSION['SelectedSystemType']['ogroup'])){
+          foreach (array("workservice", "termservice") as $cls){
+            if (isset($this->systab->by_object[$cls])){
+              $this->systab->by_object[$cls]->gotoXMouseport= "";
+              $this->systab->by_object[$cls]->gotoXMouseType= "";
+              $this->systab->by_object[$cls]->gotoXResolution= "";
+              $this->systab->by_object[$cls]->gotoXColordepth= "";
+            }
+          }
+        }
         $this->systab->save();
+        gosa_log ("System object'".$this->dn."' has been saved");
 
         /* Incoming behavior; you can select a system type and an ogroup membership. 
          * If this object is an Incoming object, $_SESSION['SelectedSystemType'] isset.
index 4e97558f5654a6d48b1f88717dd1fcdaf80ff1cd..c3d726f1e9a92dd596ec1488fa549c2d83b5fdcc 100644 (file)
@@ -12,6 +12,11 @@ class usertabs extends tabs
     /* Add references/acls/snapshots */
     $this->addSpecialTabs();
     $this->set_acl_base();
+
+    /* Set category for environment tab */
+    if (isset($this->by_object['environment'])){
+      $this->by_object['environment']->set_acl_category('users');
+    }
   }
 
   function save_object($save_current= FALSE)