Code

Fixed Translation Strings.
[gosa.git] / gosa-plugins / goto / admin / systems / goto / class_workstationGeneric.inc
1 <?php
3 class workgeneric extends plugin
4 {
5   /* Generic terminal attributes */
6   var $gotoMode= "locked";
7   var $initial_gotoMode= "locked";
8   var $gotoSyslogServer= "";
9   var $gotoSyslogServers= array();
10   var $gotoNtpServer= array();
11   var $gotoNtpServers= array();
12   var $gotoSndModule= "";
13   var $gotoFloppyEnable= "";
14   var $gotoCdromEnable= "";
15   var $description= "";
16   var $ghCpuType= "-";
17   var $ghMemSize= "-";
18   var $ghUsbSupport= "-";
19   var $ghNetNic= array();
20   var $ghIdeDev= array();
21   var $ghScsiDev= array();
22   var $ghGfxAdapter= "-";
23   var $ghSoundAdapter= "-";
24   var $gotoLastUser= "-";
25   var $FAIscript= "";
26   var $view_logged = FALSE;
28   /* Needed values and lists */
29   var $base= "";
30   var $cn= "";
31   var $l= "";
32   var $orig_dn= "";
34   /* Plugin side filled */
35   var $modes= array();
37   var $netConfigDNS;
39   var $inheritTimeServer = true;
41   /* attribute list for save action */
42   var $ignore_account= TRUE;
43   var $attributes= array("gotoMode", "gotoSyslogServer", "gotoNtpServer",
44       "gotoFloppyEnable", "gotoCdromEnable", "cn", "gotoSndModule",
45       "ghCpuType", "ghMemSize", "ghUsbSupport", "description",
46       "ghGfxAdapter", "ghSoundAdapter", "gotoLastUser", "l","FAIscript");
47   var $objectclasses= array("top", "gotoWorkstation", "GOhard");
49   var $validActions   = array("reboot" => "", "localboot" => "", "halt" => "", "update" => "", "reinstall" => "",
50                             "rescan" => "", "wake" => "", "memcheck" => "", "sysinfo" => "");
51   
52   var $fai_activated = FALSE;
54   var $member_of_ogroup = FALSE;
56   var $currently_installing = FALSE;
57   var $currently_installing_warned = FALSE;
59   function workgeneric (&$config, $dn= NULL, $parent= NULL)
60   {
61     $tmp= $config->search("faiManagement", "CLASS",array('menu','tabs'));
62     if(!empty($tmp)){
63       $this->fai_activated = TRUE;
64     }
66     plugin::plugin ($config, $dn, $parent);
68     if(!isset($this->parent->by_object['ogroup'])){
69       $ldap = $this->config->get_ldap_link();
70       $ldap->cd ($this->config->current['BASE']);
71       $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".LDAP::prepare4filter($this->dn)."))",array("cn"));
72       $this->member_of_ogroup = $ldap->count() >= 1;
73     }
75     $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses);
77     /* Check if this host is currently in installation process*/
78     if(class_available("gosaSupportDaemon") && class_available("DaemonEvent")){
79       $o = new gosaSupportDaemon();
80       $e_types = DaemonEvent::get_event_types(USER_EVENT | SYSTEM_EVENT | HIDDEN_EVENT);
81       $evts = $o->get_entries_by_mac(array($this->netConfigDNS->macAddress));
82       foreach($evts as $evt){
83         if(isset($e_types['QUEUED'][$evt['HEADERTAG']]) && $evt['STATUS'] == "processing" &&
84             $e_types['QUEUED'][$evt['HEADERTAG']] == "DaemonEvent_reinstall"){
85           $this->currently_installing =TRUE;
86         }
87       }
88     }
90     /* Read arrays */
91     foreach (array("ghNetNic", "ghIdeDev", "ghScsiDev") as $val){
92       if (!isset($this->attrs[$val])){
93         continue;
94       }
95       for ($i= 0; $i<$this->attrs[$val]['count']; $i++){
96         array_push($this->$val, $this->attrs[$val][$i]);
97       }
98     }
100     /* Create used ntp server array */
101     $this->gotoNtpServer= array();
102     if(isset($this->attrs['gotoNtpServer'])){
103       $this->inheritTimeServer = false;
104       unset($this->attrs['gotoNtpServer']['count']);
105       foreach($this->attrs['gotoNtpServer'] as $server){
106         $this->gotoNtpServer[$server] = $server;
107       }
108     }
110     /* Set inherit checkbox state */
111     if((in_array("default",$this->gotoNtpServer)) || (count($this->gotoNtpServer) == 0)){
112       $this->inheritTimeServer = true;
113       $this->gotoNtpServer=array();
114     }
116     /* You can't inherit the NTP service, if we are not member in an object group */
117     if(!$this->member_of_ogroup){
118       $this->inheritTimeServer = FALSE;
119     }
121     /* Create available ntp options */
122     $tmp = $this->config->data['SERVERS']['NTP'];
123     $this->gotoNtpServers = array();
124     foreach($tmp as $key => $server){
125       if($server == "default") continue;
126       $this->gotoNtpServers[$server] = $server;
127     }
129     $this->modes["active"]= _("Activated");
130     $this->modes["locked"]= _("Locked");
132     /* Set base */
133     if ($this->dn == "new"){
134       $ui= get_userinfo();
135       $this->base= dn2base($ui->dn);
136     } else {
137       $this->base= preg_replace ("/^[^,]+,[^,]+,[^,]+,/", "", $this->dn);
138     }
140     /* Create an array of all Syslog servers */
141     $tmp = $this->config->data['SERVERS']['SYSLOG'];
142     foreach($tmp as $server){
143       $visible = $server;
144       if($server == "default" && $this->member_of_ogroup) {
145         $visible = "["._("inherited")."]";
146       }
147       $this->gotoSyslogServers[$server] = $visible;
148     }
150     $this->initial_gotoMode = $this->gotoMode;
152     /* Save 'dn' for later referal */
153     $this->orig_dn= $this->dn;
154   }
157   function set_acl_base($base)
158   {
159     plugin::set_acl_base($base);
160     $this->netConfigDNS->set_acl_base($base);
161   }
163   function set_acl_category($cat)
164   {
165     plugin::set_acl_category($cat);
166     $this->netConfigDNS->set_acl_category($cat);
167   }
169   function execute()
170   {
171     /* Call parent execute */
172     plugin::execute();
174     if($this->is_account && !$this->view_logged){
175       $this->view_logged = TRUE;
176       new log("view","workstation/".get_class($this),$this->dn);
177     }
179     /* Do we need to flip is_account state? */
180     if(isset($_POST['modify_state'])){
181       if($this->is_account && $this->acl_is_removeable()){
182         $this->is_account= FALSE;
183       }elseif(!$this->is_account && $this->acl_is_createable()){
184         $this->is_account= TRUE;
185       }
186     }
188     if ((isset($_POST['action'])) && ($this->acl_is_writeable("FAIstate")) && isset($this->validActions[$_POST['saction']]) ){
189       $action= $_POST['saction'];
191       /* Check if we have an DaemonEvent for this action */ 
192       if(class_available("DaemonEvent")){
193         $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT);
194         if(isset($events['TRIGGERED']["DaemonEvent_".$action])){
195           $evt = $events['TRIGGERED']["DaemonEvent_".$action];
196           $tmp = new $evt['CLASS_NAME']($this->config);
197           $tmp->add_targets(array($this->netConfigDNS->macAddress));
198           $tmp->set_type(TRIGGERED_EVENT);
199           $o_queue = new gosaSupportDaemon();
200           if(!$o_queue->append($tmp)){
201             msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
202           }
203         }
204       } else {
205         msg_dialog::display(_("Event error"),
206                     sprintf(_("Event '%s' is not available!"),$action),ERROR_DIALOG);
207       }
210     }
212     /* Do we represent a valid terminal? */
213     if (!$this->is_account && $this->parent === NULL){
214       $display= "<img alt=\"\" src=\"images/stop.png\" align=middle>&nbsp;<b>".
215         msgPool::noValidExtension(_("workstation"))."</b>";
216       return($display);
217     }
219     /* Base select dialog */
220     $once = true;
221     foreach($_POST as $name => $value){
222       if(preg_match("/^chooseBase/",$name) && $once && $this->acl_is_writeable("base")){
223         $once = false;
224         $this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases());
225         $this->dialog->setCurrentBase($this->base);
226       }
227     }
229     /* Dialog handling */
230     if(is_object($this->dialog)){
231       /* Must be called before save_object */
232       $this->dialog->save_object();
234       if($this->dialog->isClosed()){
235         $this->dialog = false;
236       }elseif($this->dialog->isSelected()){
238         /* A new base was selected, check if it is a valid one */
239         $tmp = $this->get_allowed_bases();
240         if(isset($tmp[$this->dialog->isSelected()])){
241           $this->base = $this->dialog->isSelected();
242         }
244         $this->dialog= false;
245       }else{
246         return($this->dialog->execute());
247       }
248     }
250     /* Add new ntp Server to our list */ 
251     if((isset($_POST['addNtpServer'])) && (isset($_POST['gotoNtpServers'])) && $this->acl_is_writeable("gotoNtpServer")){
252       $this->gotoNtpServer[$_POST['gotoNtpServers']] = $_POST['gotoNtpServers'];
253     }
255     /* Delete selected NtpServer for list of used servers  */
256     if((isset($_POST['delNtpServer'])) && (isset($_POST['gotoNtpServerSelected'])) && $this->acl_is_writeable("gotoNtpServer")){
257       foreach($_POST['gotoNtpServerSelected'] as $name){
258         unset($this->gotoNtpServer[$name]);
259       }
260     }
262     /* Fill templating stuff */
263     $smarty= get_smarty();
265     /* Set acls */
266     $tmp = $this->plInfo();
267     foreach($tmp['plProvidedAcls'] as $name => $translation){
268       $smarty->assign($name."ACL",$this->getacl($name));
269     }
271     $smarty->assign("cn", $this->cn);
272     $smarty->assign("description", $this->description);
273     $smarty->assign("l", $this->l);
274     $smarty->assign("bases", $this->get_allowed_bases());
275     $smarty->assign("staticAddress", "");
277     $tmp = array();
278     foreach($this->gotoNtpServers as $server){
279       if(!in_array($server,$this->gotoNtpServer)){
280         $tmp[$server] = $server;
281       }
282     }
283     $smarty->assign("gotoNtpServers",$tmp);
284         
285     /* Check if workstation is online */
286     if (gosaSupportDaemon::ping($this->netConfigDNS->macAddress)){
287       $smarty->assign("actions", array("halt" => _("Switch off"), "reboot" => _("Reboot"),
288                                        "update" => _("System update"),
289                                        "reinstall" => _("Reinstall"),
290                                        "rescan" => _("Rescan hardware"),
291                                        "memcheck" => _("Memory test"),
292                                        "localboot" => _("Force localboot"),
293                                        "sysinfo"  => _("System analysis")));
294     } else {
295       $smarty->assign("actions", array("wake" => _("Wake up"),
296                                        "reinstall" => _("Reinstall"),
297                                        "update" => _("System update"),
298                                        "memcheck" => _("Memory test"),
299                                        "localboot" => _("Force localboot"),
300                                        "sysinfo"  => _("System analysis")));
301     }
302     /* Arrays */
303     $smarty->assign("modes", $this->modes);
304     $smarty->assign("nfsservers", $this->config->data['SERVERS']['NFS']);
305     $smarty->assign("syslogservers", $this->gotoSyslogServers);
306     $smarty->assign("fai_activated",$this->fai_activated);
308     $ntpser = array();
309     foreach($this->gotoNtpServers as $server){
310       if(!in_array($server,$this->gotoNtpServer)){
311         $ntpser[$server] = $server;
312       }
313     }
314     $smarty->assign("gotoNtpServers", $ntpser);
316     /* Variables */
317     foreach(array("base", "gotoMode", "gotoSyslogServer", "gotoNtpServer") as $val){
318       $smarty->assign($val."_select", $this->$val);
319     }
321     /* tell smarty the inherit checkbox state */
322     $smarty->assign("inheritTimeServer",$this->inheritTimeServer);
323     $smarty->assign("member_of_ogroup",$this->member_of_ogroup);
325     $str = $this->netConfigDNS->execute();
326     if(is_object($this->netConfigDNS->dialog)){
327       return($str);
328     }
329     $smarty->assign("netconfig", $str);
331     /* Show main page */
332     $smarty->assign("currently_installing", $this->currently_installing);
333     return($smarty->fetch (get_template_path('workstation.tpl', TRUE, dirname(__FILE__))));
334   }
336   function remove_from_parent()
337   {
338     if($this->acl_is_removeable()){
340       $this->netConfigDNS->remove_from_parent();
341       $ldap= $this->config->get_ldap_link();
342       $ldap->rmdir($this->dn);
343       new log("remove","workstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
344       if (!$ldap->success()){
345         msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));
346       }
348       /* Optionally execute a command after we're done */
349       $this->handle_post_events("remove", array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
351       /* Delete references to object groups */
352       $ldap->cd ($this->config->current['BASE']);
353       $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn"));
354       while ($ldap->fetch()){
355         $og= new ogroup($this->config, $ldap->getDN());
356         unset($og->member[$this->dn]);
357         $og->save ();
358       }
359     }
361     /* Clean queue form entries with this mac 
362      */
363     if(class_available("gosaSupportDaemon") && tests::is_mac($this->netConfigDNS->orig_macAddress)){
364       $q = new gosaSupportDaemon();
365       $q->clean_queue_from_mac($this->netConfigDNS->orig_macAddress);
366     }
368     if(isset($_POST["inheritAll"])){
369       $this->set_everything_to_inherited();
370     }
371   }
374   /* Save data to object */
375   function save_object()
376   {
378     /* Create a base backup and reset the
379        base directly after calling plugin::save_object();
380        Base will be set seperatly a few lines below */
381     $base_tmp = $this->base;
382     plugin::save_object();
383     $this->base = $base_tmp;
385     /* Save base, since this is no LDAP attribute */
386     $tmp = $this->get_allowed_bases();
387     if(isset($_POST['base'])){
388       if(isset($tmp[$_POST['base']])){
389         $this->base= $_POST['base'];
390       }
391     }
393     $this->netConfigDNS->save_object();
395     /* Set inherit mode */
396     if((isset($_POST['workgeneric_posted'])) && ($this->acl_is_writeable("gotoNtpServer"))){
397       if(isset($_POST["inheritTimeServer"]) && $this->member_of_ogroup){
398         $this->inheritTimeServer = true;
399       }else{
400         $this->inheritTimeServer = false;
401       }
402     }
403     
404     if(isset($_POST["inheritAll"])){
405       $this->set_everything_to_inherited();
406     }
407   }
410   /* Check supplied data */
411   function check()
412   {
413     /* Call common method to give check the hook */
414     $message= plugin::check();
415  
416     /* Skip IP & Mac checks if this is a template */
417     if($this->cn != "wdefault"){
418       $message= array_merge($message, $this->netConfigDNS->check());
419     }
421     $this->dn= "cn=".$this->cn.",".get_ou('workstationou').$this->base;
423     if ($this->cn == ""){
424       $message[]= msgPool::required(_("Name"));
425     }
427     /* Check if given name is a valid host/dns name */
428     if(!tests::is_dns_name($this->cn)){
429       $message[] = msgPool::invalid(_("Name"));
430     }
432     if ($this->orig_dn != $this->dn){
433       $ldap= $this->config->get_ldap_link();
434       $ldap->cd ($this->base);
436       if($this->cn == "wdefault"){
437         $ldap->cat($this->dn);
438       }else{
439         $ldap->search ("(&(cn=".$this->cn.")(objectClass=gotoWorkstation))", array("cn"));
440       }
441       if ($ldap->count() != 0){
442         while ($attrs= $ldap->fetch()){
443           if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".get_ou('incomingou')."/", $ldap->getDN())){
444             continue;
445           } else {
446             if ($attrs['dn'] != $this->orig_dn){
447               $message[]= msgPool::duplicated(_("Name"));
448               break;
449             }
450           }
451         }
452       }
453     }
455     /* Check for valid ntpServer selection */
456     if((!$this->inheritTimeServer) && (!count($this->gotoNtpServer))){
457       $message[]= msgPool::required(_("NTP server"));
458     }
460     /* Only systems with a valid ldap handle can be activated 
461      */
462     if($this->gotoMode == "active" && $this->initial_gotoMode != "active"){
464       if(isset($this->parent->by_object['workstartup']) && !count($this->parent->by_object['workstartup']->gotoLdapServers)){
465         $message[] = _("In order to activate this system a valid ldap handle is required, please select at least one ldap URI in the workstation startup tab.");
466       }
467     }else{
468       /* Warn the user, that this host is currently installing */
469       if($this->currently_installing && !$this->currently_installing_warned){
470         $this->currently_installing_warned = TRUE;
471         $message[] = _("This host is currently installing, if you really want to save it, save again.");
472       }
473     }
474   
475     return ($message);
476   }
479   /* Save to LDAP */
480   function save()
481   {
482     /* Detect mode changes */
483     $activate= (isset($this->saved_attributes['gotoMode']) &&
484         $this->gotoMode != $this->saved_attributes['gotoMode'] &&
485         $this->gotoMode == "active" &&
486         tests::is_ip($this->netConfigDNS->ipHostNumber));
487     plugin::save();
489     /* Strip out 'default' values */
490     foreach (array("gotoSyslogServer") as $val){
492       if (isset($this->attrs[$val]) && $this->attrs[$val] == "default"){
493         $this->attrs[$val]= array();
494       }
495     }
497     /* Add missing arrays */
498     foreach (array("ghScsiDev", "ghIdeDev", "ghNetNic") as $val){
499       if (isset ($this->$val) && count ($this->$val) != 0){
500         $this->attrs["$val"]= $this->$val;
501       }
502     }
504     /* Remove all empty values */
505     if ($this->orig_dn == 'new'){
506       $attrs= array();
507       foreach ($this->attrs as $key => $val){
508         if (is_array($val) && count($val) == 0){
509           continue;
510         }
511         $attrs[$key]= $val;
512       }
513       $this->attrs= $attrs;
514     }
516     /* Update ntp server settings */
517     if($this->inheritTimeServer){
518       if($this->is_new){
519         if(isset($this->attrs['gotoNtpServer'])){
520           unset($this->attrs['gotoNtpServer']);
521         }
522       }else{
523         $this->attrs['gotoNtpServer'] = array();
524       }
525     }else{
526       /* Set ntpServers */
527       $this->attrs['gotoNtpServer'] = array();
528       foreach($this->gotoNtpServer as $server){
529         $this->attrs['gotoNtpServer'][] = $server;
530       }
531     }
533     /* Write back to ldap */
534     $ldap= $this->config->get_ldap_link();
535     if ($this->orig_dn == 'new'){
536       $ldap->cd($this->config->current['BASE']);
537       $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
538       $ldap->cd($this->dn);
539       $ldap->add($this->attrs);
540       new log("create","workstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
541       if (!$ldap->success()){
542         msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
543       }
544       $this->handle_post_events("add",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
545     } else {
546       if ($this->orig_dn != $this->dn){
547         $this->move($this->orig_dn, $this->dn);
548       }
549       $ldap->cd($this->dn);
550       $this->cleanup();
551       $ldap->modify ($this->attrs); 
552       if (!$ldap->success()){
553         msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
554       }
555       new log("modify","workstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
557       $this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
558     }
560     /* cn=default and macAddress=- indicates that this is a template */
561     if($this->cn == "wdefault"){
562       $this->netConfigDNS->macAddress = "-";
563     }
565     $this->netConfigDNS->cn = $this->cn;
566     $this->netConfigDNS->save();
568     if ($activate && class_available("DaemonEvent")){
570       /* Send installation activation
571        */
572       $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT);
573       $o_queue = new gosaSupportDaemon();
574       if(isset($events['TRIGGERED']['DaemonEvent_installation_activation'])){
575         $evt = $events['TRIGGERED']['DaemonEvent_installation_activation'];
576         $tmp = new $evt['CLASS_NAME']($this->config);
577         $tmp->set_type(TRIGGERED_EVENT);
578         $tmp->add_targets(array($this->netConfigDNS->macAddress));
579         if(!$o_queue->append($tmp)){
580           msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
581         }
582       }
583     }
584   }
587   /* Display generic part for server copy & paste */
588   function getCopyDialog()
589   {
590     $vars = array("cn");
591     $smarty = get_smarty();
592     $smarty->assign("cn" ,$this->cn);
593     $smarty->assign("object","workstation");
594     $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
595     $ret = array();
596     $ret['string'] = $str;
597     $ret['status'] = "";
598     return($ret);
599   }
602   function saveCopyDialog()
603   {
604     if(isset($_POST['cn'])){
605       $this->cn = $_POST['cn'];
606     }
607   }
610   function PrepareForCopyPaste($source)
611   {
612     plugin::PrepareForCopyPaste($source);
613     if(isset($source['macAddress'][0])){
614       $this->netConfigDNS->macAddress = $source['macAddress'][0];
615     }
616     if(isset($source['ipHostNumber'][0])){
617       $this->netConfigDNS->ipHostNumber = $source['ipHostNumber'][0];
618     }
620     /* Create used ntp server array */
621     $this->gotoNtpServer= array();
622     if(isset($source['gotoNtpServer'])){
623       $this->inheritTimeServer = false;
624       unset($source['gotoNtpServer']['count']);
625       foreach($source['gotoNtpServer'] as $server){
626         $this->gotoNtpServer[$server] = $server;
627       }
628     }
630     /* Set inherit checkbox state */
631     if((in_array("default",$this->gotoNtpServer)) || (count($this->gotoNtpServer)==0)){
632       $this->inheritTimeServer = true;
633       $this->gotoNtpServer=array();
634     }
635   }
638   /* Return plugin informations for acl handling 
639       #FIXME FAIscript seams to ununsed within this class... */ 
640   static function plInfo()
641   {
642     return (array(  
643           "plShortName"   => _("Generic"),
644           "plDescription" => _("Workstation generic"),
645           "plSelfModify"  => FALSE,
646           "plDepends"     => array(),
647           "plPriority"    => 0,
648           "plSection"     => array("administration"),
649           "plCategory"    => array("workstation" => array("description"  => _("Workstation"),
650                                                           "objectClass"  => "gotoWorkstation")),
651           "plProvidedAcls"=> array(
652             "cn"                  => _("Workstation name"),
653             "description"         => _("Description") ,
654             "l"                   => _("Location") ,
655             "base"                => _("Base") ,
656             "gotoMode"            => _("Goto mode"), 
657             "gotoSyslogServer"    => _("Syslog server"), 
658             "gotoNtpServer"       => _("Ntp server"), 
659             "gotoRootPasswd"      => _("Root password"),
660             "FAIstate"            => _("Action flag"))
661           ));
662   }
664   function set_everything_to_inherited()
665   {
666     $this->gotoSyslogServer  = "default";
667     $this->inheritTimeServer = TRUE;
669     /* Set workstation service attributes to inherited */
670     if($this->member_of_ogroup && isset($this->parent->by_object['workservice'])){
671       foreach(array("gotoXKbLayout","gotoXKbModel","gotoXKbVariant",
672             "gotoXResolution","gotoXColordepth","gotoXMouseType","gotoXMouseport") as $name){
673         $this->parent->by_object['workservice']->$name = "default"; 
674       }
675     }
677     /* Set workstation startup attributes to inherited */
678     if($this->member_of_ogroup && isset($this->parent->by_object['workstartup'])){
679       $this->parent->by_object['workstartup']->gotoBootKernel = "default-inherited";
680       $this->parent->by_object['workstartup']->gotoLdapServer = "default-inherited";
681       $this->parent->by_object['workstartup']->FAIdebianMirror= "inherited";
682     }
683   }
685   // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
686 ?>