From 49866d5f3a99b5675b11310ffba4c2e50d967eb7 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 11 Jul 2007 13:10:12 +0000 Subject: [PATCH] Added Inherit all button to Workstation Servive - testing. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6835 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/class_workstationService.inc | 27 +++++++++++++++++++ plugins/admin/systems/workstationService.tpl | 3 +++ 2 files changed, 30 insertions(+) diff --git a/plugins/admin/systems/class_workstationService.inc b/plugins/admin/systems/class_workstationService.inc index 54af9393d..84c3b42c7 100644 --- a/plugins/admin/systems/class_workstationService.inc +++ b/plugins/admin/systems/class_workstationService.inc @@ -53,10 +53,18 @@ class workservice extends plugin var $XKbLayouts =array(); var $XKbVariants =array(); + var $member_of_ogroup = FALSE; + function workservice ($config, $dn= NULL, $parent= NULL) { plugin::plugin ($config, $dn, $parent); + + $ldap = $this->config->get_ldap_link(); + $ldap->cd ($this->config->current['BASE']); + $ldap->search("(&(objectClass=gosaGroupOfNames)(member=".$this->dn."))",array("cn")); + $this->member_of_ogroup = $ldap->count() >= 1; + $this->XResolutions= array( "640x480" => "640x480", "800x600" => "800x600", @@ -322,6 +330,8 @@ class workservice extends plugin $smarty->assign("hiddenState",""); } + $smarty->assign("member_of_ogroup",$this->member_of_ogroup); + /* Show main page */ return($smarty->fetch (get_template_path('workstationService.tpl',TRUE,dirname(__FILE__)))); } @@ -336,6 +346,10 @@ class workservice extends plugin { plugin::save_object(); + if(isset($_POST["inheritAll"])){ + $this->set_everything_to_inherited(); + } + if(isset($_POST['gotoXDriver']) && chkacl($this->acl,"AutoSync") == ""){ if(isset($_POST['AutoSync'])){ $this->AutoSync = true; @@ -429,6 +443,19 @@ class workservice extends plugin $this->handle_post_events("modify"); } + + function set_everything_to_inherited() + { + $this->gotoXKbLayout = "default"; + $this->gotoXKbModel = "default"; + $this->gotoXKbVariant = "default"; + + $this->gotoXDriver ="default"; + $this->gotoXResolution ="default"; + $this->gotoXColordepth ="default"; + $this->gotoXMouseType ="default"; + $this->gotoXMouseport ="default"; + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: diff --git a/plugins/admin/systems/workstationService.tpl b/plugins/admin/systems/workstationService.tpl index 3cc0357c3..fe10a2efe 100644 --- a/plugins/admin/systems/workstationService.tpl +++ b/plugins/admin/systems/workstationService.tpl @@ -1,3 +1,6 @@ +{if $member_of_ogroup} + +{/if}
-- 2.30.2