Code

Added Inherit all button to Workstation Servive - testing.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 11 Jul 2007 13:10:12 +0000 (13:10 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 11 Jul 2007 13:10:12 +0000 (13:10 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6835 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_workstationService.inc
plugins/admin/systems/workstationService.tpl

index 54af9393d7f4567a411d4a39d24d587c35b5c3a4..84c3b42c7df79addf3f6d9ec5df98515da27660d 100644 (file)
@@ -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:
index 3cc0357c35fcdbc221d1a772b5a583c9a5939694..fe10a2efe7efabe8318a98035fa005d007088000 100644 (file)
@@ -1,3 +1,6 @@
+{if $member_of_ogroup}
+<input type='submit' name='inheritAll' value='{t}Inherit all{/t}'>
+{/if}
 <table style="width:100%;" summary="">
  <tr>
   <td style="width:33%; vertical-align:top;">