From 1541bcbf7deec5de938a1c7c71a4ead1d2de89f4 Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 26 Jul 2006 09:13:04 +0000 Subject: [PATCH] Included category matching git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4310 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_plugin.inc | 19 +++++++++++++------ .../admin/systems/class_systemManagement.inc | 12 +++++++++++- plugins/admin/users/tabs_user.inc | 5 +++++ 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/include/class_plugin.inc b/include/class_plugin.inc index a83cb1cea..de552c67d 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -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
"; } + 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
"; 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); } diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index fcad7c7bd..0f86b327e 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -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. diff --git a/plugins/admin/users/tabs_user.inc b/plugins/admin/users/tabs_user.inc index 4e97558f5..c3d726f1e 100644 --- a/plugins/admin/users/tabs_user.inc +++ b/plugins/admin/users/tabs_user.inc @@ -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) -- 2.30.2