Code

Systems Workstation Startup
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Jul 2007 06:20:19 +0000 (06:20 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 12 Jul 2007 06:20:19 +0000 (06:20 +0000)
Added inherit all button.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6839 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_workstationStartup.inc
plugins/admin/systems/workstationStartup.tpl

index be645996ff75d16e02a3f86fc9d94eb84cca98f3..837920e3ea4e5a669bc9f03dd01789623809df36 100644 (file)
@@ -32,6 +32,7 @@ class workstartup extends plugin
   var $customParameters   = "";
   var $orig_dn            = "";
   var $ignore_account     = TRUE;
+  var $member_of_ogroup   = FALSE;
  
   /* FAI class selection */ 
   var $FAIclass           = array();
@@ -65,6 +66,13 @@ class workstartup extends plugin
 
     plugin::plugin ($config, $dn, $parent);
 
+    if(!isset($this->parent->by_object['ogroup'])){
+      $ldap = $this->config->get_ldap_link();
+      $ldap->cd ($this->config->current['BASE']);
+      $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))",array("cn"));
+      $this->member_of_ogroup = $ldap->count() >= 1;
+    }
+
     /* Creating a list of valid Mirrors 
      * none will not be saved to ldap.
      */
@@ -792,6 +800,8 @@ class workstartup extends plugin
       $smarty->assign($value."ACL", chkacl($this->acl, "$value"));
     }
 
+    $smarty->assign("member_of_ogroup",$this->member_of_ogroup);
+
     /* Show main page */
     return($smarty->fetch (get_template_path('workstationStartup.tpl', TRUE,dirname(__FILE__))));
   }
@@ -930,6 +940,9 @@ class workstartup extends plugin
       $this->customParameters= $_POST["customParameters"];
     }
 
+    if(isset($_POST["inheritAll"])){
+      $this->set_everything_to_inherited();
+    }
   }
 
 
@@ -1145,6 +1158,13 @@ class workstartup extends plugin
     return($ret);
   }
 
+
+  function set_everything_to_inherited()
+  {
+    $this->gotoBootKernel = "default-inherited";
+    $this->gotoLdapServer = "default-inherited";
+    $this->FAIdebianMirror= "inherited";
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index 23878411926656b40f3a40f0cf43921637f92d59..446d7475f9239f45c10611a9bad09e8fba77c478 100644 (file)
@@ -1,3 +1,7 @@
+{if $member_of_ogroup}
+<input type='submit' name='inheritAll' value='{t}Inherit all{/t}'>
+{/if}
+
 <table summary="" style="width:100%;">
  <tr>
   <td style="width:50%; vertical-align:top;">