Code

Made NBD's visible
[gosa.git] / gosa-plugins / goto / admin / systems / goto / class_terminalGeneric.inc
1 <?php
3 class termgeneric extends plugin
4 {
5   /* Generic terminal attributes */
6   var $gotoMode= "locked";
7   var $gotoTerminalPath= "";
8   var $gotoSwapServer= "";
9   var $gotoSyslogServer= "";
10   var $gotoSyslogServers = array();
11   var $gotoNtpServer= array();
12   var $gotoNtpServers= array();
13   var $gotoSndModule= "";
14   var $gotoFloppyEnable= "";
15   var $gotoCdromEnable= "";
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 $netConfigDNS;
26   
27   /* Needed values and lists */
28   var $base= "";
29   var $cn= "";
30   var $description= "";
31   var $orig_dn= "";
32   var $orig_cn= "";
33   var $orig_base= "";
35   var $inheritTimeServer = true;
37   /* Plugin side filled */
38   var $modes= array();
40   /* attribute list for save action */
41   var $ignore_account= TRUE;
42   var $attributes= array("gotoMode", "gotoTerminalPath", 
43       "gotoSwapServer", "gotoSyslogServer", "gotoNtpServer",
44       "gotoFloppyEnable", "gotoCdromEnable", "cn", "gotoSndModule",
45       "ghCpuType", "ghMemSize","ghUsbSupport", "description",
46       "ghGfxAdapter", "ghSoundAdapter", "gotoLastUser");
47   var $objectclasses= array("top", "gotoTerminal", "GOhard");
49   var $validActions   = array("reboot" => "", "rescan" => "", "wake" => "", "memcheck" => "", "sysinfo" => "");
51   var $fai_activated = FALSE;
52   var $view_logged = FALSE;
54   var $member_of_ogroup = FALSE;
56   var $kerberos_key_service = NULL;
59   function termgeneric (&$config, $dn= NULL, $parent= NULL)
60   {
61     /* Check if FAI is activated */
62     $tmp= $config->search("faiManagement", "CLASS",array('menu','tabs'));
63     if(!empty($tmp)){
64       $this->fai_activated = TRUE;
65     }
67     plugin::plugin ($config, $dn, $parent);
69     if(class_available("krbHostKeys")){
70       $this->kerberos_key_service = new krbHostKeys($this->config,$this);
71     }
73     if(!isset($this->parent->by_object['ogroup'])){
74       $ldap = $this->config->get_ldap_link();
75       $ldap->cd ($this->config->current['BASE']);
76       $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".LDAP::prepare4filter($this->dn)."))",array("cn"));
77       $this->member_of_ogroup = $ldap->count() >= 1;
78     }
80     $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses);
81     /* Read arrays */
82     foreach (array("ghNetNic", "ghIdeDev", "ghScsiDev") as $val){
83       if (!isset($this->attrs[$val])){
84         continue;
85       }
86       for ($i= 0; $i<$this->attrs[$val]['count']; $i++){
87         array_push($this->$val, $this->attrs[$val][$i]);
88       }
89     }
91     /* Create used ntp server array */
92     $this->gotoNtpServer= array();
93     if(isset($this->attrs['gotoNtpServer'])){
94       $this->inheritTimeServer = false;
95       for($i = 0 ; $i < $this->attrs['gotoNtpServer']['count']; $i++ ){
96         $server = $this->attrs['gotoNtpServer'][$i];
97         $this->gotoNtpServer[$server] = $server;
98       }
99     }
101     /* Set inherit checkbox state */
102     if((in_array("default",$this->gotoNtpServer)) || (count($this->gotoNtpServer)==0)){
103       $this->inheritTimeServer = true;
104       $this->gotoNtpServer=array();
105     }
107     /* You can't inherit the NTP service, if we are not member in an object group */
108     if(!$this->member_of_ogroup){
109       $this->inheritTimeServer = FALSE;
110     }
112     /* Create available ntp options */
113     $this->gotoNtpServers = $this->config->data['SERVERS']['NTP'];
114     foreach($this->gotoNtpServers as $key => $server){
115       if($server == "default"){
116         unset($this->gotoNtpServers[$key]);
117       }
118     }
120     $this->modes["locked"]= _("Locked");
121     $this->modes["active"]= _("Activated");
123     /* Set base */
124     if ($this->dn == "new"){
125       $ui= get_userinfo();
126       $this->base= dn2base($ui->dn);
127     } else {
128       $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("terminalRDN"))."/", "", $this->dn);
129     }
131     /* Create an array of all Syslog servers */
132     $tmp = $this->config->data['SERVERS']['SYSLOG'];
133     foreach($tmp as $server){
134       $visible = $server;
135       if($server == "default" && $this->member_of_ogroup) {
136         $visible = "["._("inherited")."]";
137       }
138       $this->gotoSyslogServers[$server] = $visible;
139     }
141     $this->orig_dn= $this->dn;
142     $this->orig_cn= $this->cn;
143     $this->orig_base= $this->base;
144   }
146   function set_acl_base($base)
147   {
148     plugin::set_acl_base($base);
149     $this->netConfigDNS->set_acl_base($base);
150   }
152   function set_acl_category($cat)
153   {
154     plugin::set_acl_category($cat);
155     $this->netConfigDNS->set_acl_category($cat);
156   }
158   function execute()
159   {
160     /* Call parent execute */
161     plugin::execute();
163     if($this->is_account && !$this->view_logged){
164       $this->view_logged = TRUE;
165       new log("view","terminal/".get_class($this),$this->dn);
166     }
168     /* Do we need to flip is_account state? */
169     if (isset($_POST['modify_state'])){
170       $this->is_account= !$this->is_account;
171     }
173     if (isset($_POST['action']) && $this->acl_is_writeable("FAIstate") && isset($this->validActions[$_POST['saction']])){
174       $action = $_POST['saction'];
176       /* Check if we have an DaemonEvent for this action */
177       if(class_available("DaemonEvent_".$action)){
178         $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT);
179         if(isset($events['TRIGGERED']["DaemonEvent_".$action])){
180           $evt = $events['TRIGGERED']["DaemonEvent_".$action];
181           $tmp = new $evt['CLASS_NAME']($this->config);
182           $tmp->add_targets(array($this->netConfigDNS->macAddress));
183           $tmp->set_type(TRIGGERED_EVENT);
184           $o_queue = new gosaSupportDaemon();
185           if(!$o_queue->append($tmp)){
186             msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
187           }
188         }
189       }else{
190         msg_dialog::display(_("Event error"),
191                     sprintf(_("Event '%s' is not available!"),$action),ERROR_DIALOG);
192       }
194     }
196     /* Base select dialog */
197     $once = true;
198     foreach($_POST as $name => $value){
199       if(preg_match("/^chooseBase/",$name) && $once && $this->acl_is_moveable()){
200         $once = false;
201         $this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases());
202         $this->dialog->setCurrentBase($this->base);
203       }
204     }
206     /* Dialog handling */
207     if(is_object($this->dialog)){
208       /* Must be called before save_object */
209       $this->dialog->save_object();
211       if($this->dialog->isClosed()){
212         $this->dialog = false;
213       }elseif($this->dialog->isSelected()){
215         /* A new base was selected, check if it is a valid one */
216         $tmp = $this->get_allowed_bases();
217         if(isset($tmp[$this->dialog->isSelected()])){
218           $this->base = $this->dialog->isSelected();
219         }
220         $this->dialog= false;
221       }else{
222         return($this->dialog->execute());
223       }
224     }
226     /* Do we represent a valid terminal? */
227     if (!$this->is_account && $this->parent === NULL){
228       $display= "<img alt=\"\" src=\"images/small-error.png\" align=middle>&nbsp;<b>".
229         msgPool::noValidExtension(_("terminal"))."</b>";
230       return($display);
231     }
233     /* Add new ntp Server to our list */
234     if((isset($_POST['addNtpServer'])) && (isset($_POST['gotoNtpServers'])) && $this->acl_is_writeable("gotoNtpServer")){
235       $this->gotoNtpServer[$_POST['gotoNtpServers']] = $_POST['gotoNtpServers'];
236     }
238     /* Delete selected NtpServer for list of used servers  */
239     if((isset($_POST['delNtpServer'])) && (isset($_POST['gotoNtpServerSelected'])) && $this->acl_is_writeable("gotoNtpServer")){
240       foreach($_POST['gotoNtpServerSelected'] as $name){
241         unset($this->gotoNtpServer[$name]);
242       } 
243     }
245     /* Fill templating stuff */
246     $smarty= get_smarty();
247     
248     $tmp = $this->plInfo();
249     foreach($tmp['plProvidedAcls'] as $name => $translation){
250       $smarty->assign($name."ACL",$this->getacl($name));
251     }
253     $smarty->assign("cn", $this->cn);
254     $smarty->assign("description", $this->description);
255     $smarty->assign("staticAddress", "");
257     $smarty->assign("bases", $this->get_allowed_bases());
259     /* tell smarty the inherit checkbox state */
260     $smarty->assign("inheritTimeServer",$this->inheritTimeServer);
262     /* Check if terminal is online */
263     if (gosaSupportDaemon::ping($this->netConfigDNS->macAddress)){
264       $smarty->assign("actions", array( "halt" => _("Switch off"), 
265                                         "reboot" => _("Reboot"),
266                                         #"memcheck" => _("Memory test"),
267                                         #"sysinfo"  => _("System analysis")
268                                         ));
269     } else {
270       $smarty->assign("actions", array("wake" => _("Wake up"),
271                                        #"memcheck" => _("Memory test"),
272                                        #"sysinfo"  => _("System analysis")
273                                         ));
274     }
276     /* Arrays */
277     $smarty->assign("modes", $this->modes);
279     $tmp2 = array(); 
280     $tmp2['!']= _("Local swap");
281     foreach($this->config->data['SERVERS']['NBD'] as $server){
282       if($server != "default"){
283         $tmp2[$server]= $server;
284       }else{
285         if($this->member_of_ogroup){
286           $tmp2[$server]="["._("inherited")."]";
287         }
288       }
289     }
290   
291     $smarty->assign("swapservers",     $tmp2);
292     $tmp2 = array(); 
293     foreach($this->config->data['SERVERS']['NFS'] as $server){
294       if($server != "default"){
295         $tmp2[$server]= $server;
296       }else{
297         if($this->member_of_ogroup){
298           $tmp2[$server]="["._("inherited")."]";
299         }
300       }
301     }
302   
303     $smarty->assign("nfsservers",     $tmp2);
304     $smarty->assign("syslogservers",  $this->gotoSyslogServers);
306     $tmp = array();
307     foreach($this->gotoNtpServers as $server){
308       if(!in_array($server,$this->gotoNtpServer)){
309         $tmp[$server] = $server;
310       }
311     }
312     
313     $smarty->assign("ntpservers",     $tmp);
314     $smarty->assign("fai_activated",$this->fai_activated);
316     /* Variables */
317     foreach(array("base", "gotoMode", "gotoTerminalPath", "gotoSwapServer","gotoSyslogServer", "gotoNtpServer") as $val){
318       $smarty->assign($val."_select", $this->$val);
319     }
321     $smarty->assign("member_of_ogroup",$this->member_of_ogroup);
323     /* Show main page */
324     $str = $this->netConfigDNS->execute();
325     if(is_object($this->netConfigDNS->dialog)){
326       return($str);
327     }
328     $smarty->assign("netconfig", $str);
330     /* Display kerberos host key options */  
331     $smarty->assign("host_key","");
332     if(is_object($this->kerberos_key_service)){
333       $smarty->assign("host_key",$this->kerberos_key_service->execute_by_prefix("host/"));
334     }
336     return($smarty->fetch (get_template_path('terminal.tpl', TRUE, dirname(__FILE__))));
337   }
339   function remove_from_parent()
340   {
341     if($this->acl_is_removeable()){   
342       $ldap= $this->config->get_ldap_link();
343       $ldap->cd($this->dn);
344       $ldap->cat($this->dn, array('dn'));
345       if($ldap->count()){
346         $this->netConfigDNS->remove_from_parent();
347         $ldap->rmDir($this->dn);
348   
349         new log("remove","terminal/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
350   
351         if (!$ldap->success()){
352           msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));
353         }
355         /* Remove kerberos key dependencies too */
356         if(is_object($this->kerberos_key_service)){
357           $this->kerberos_key_service->remove_from_parent_by_prefix("host/");
358         }
360         /* Optionally execute a command after we're done */
361         $this->handle_post_events("remove",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
363         /* Delete references to object groups */
364         $ldap->cd ($this->config->current['BASE']);
365         $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn"));
366         while ($ldap->fetch()){
367           $og= new ogroup($this->config, $ldap->getDN());
368           unset($og->member[$this->dn]);
369           $og->save ();
370         }
372         /* Remove all accessTo/trust dependencies */
373         update_accessTo($this->cn,"");
374       }
376       /* Clean queue form entries with this mac 
377        */
378       if(class_available("gosaSupportDaemon") && tests::is_mac($this->netConfigDNS->orig_macAddress)){
379         $q = new gosaSupportDaemon();
380         $q->clean_queue_from_mac($this->netConfigDNS->orig_macAddress);
381       }
382     }
383   }
386   /* Save data to object */
387   function save_object()
388   {
389     /* Create a base backup and reset the
390        base directly after calling plugin::save_object();
391        Base will be set seperatly a few lines below */
392     $base_tmp = $this->base;
393     plugin::save_object();
394     $this->base = $base_tmp;
396     /* Set new base if allowed */
397     $tmp = $this->get_allowed_bases();
398     if(isset($_POST['base'])){
399       if(isset($tmp[$_POST['base']])){
400         $this->base= $_POST['base'];
401       }
402     }
403     
404     $this->netConfigDNS->save_object();
406     /* Save terminal path to parent since it is used by termstartup, too */
407     if(isset($this->parent->by_object['termstartup'])){
408       $this->parent->by_object['termstartup']->gotoTerminalPath= $this->gotoTerminalPath;
409     }
410     
411     if(isset($_POST['termgeneric_posted'])){
412       if(isset($_POST["inheritTimeServer"]) && $this->member_of_ogroup){
413         $this->inheritTimeServer = true;
414       }else{
415         $this->inheritTimeServer = false;
416       }
417     }  
419     if(isset($_POST["inheritAll"])){
420       $this->set_everything_to_inherited();
421     }
423     /* Hanle kerberos host key plugin */
424     if(is_object($this->kerberos_key_service)){
425       $this->kerberos_key_service->save_object_by_prefix("host/");
426     }
427   }
430   /* Check supplied data */
431   function check()
432   {
433     /* Call common method to give check the hook */
434     $message= plugin::check();
436     /* Skip IP & Mac checks if this is a template */
437     if($this->cn != "default"){
438       $message= array_merge($message, $this->netConfigDNS->check());
439     }
441     /* Permissions for that base? */
442     $this->dn= "cn=".$this->cn.",".get_ou('terminalRDN').$this->base;
444     if ($this->cn == ""){
445       $message[]= msgPool::required(_("Name"));
446     }
448     /* Check if given name is a valid host/dns name */
449     if(!tests::is_dns_name($this->cn) ){
450       $message[] = msgPool::invalid(_("Name"));
451     }
453     if ($this->orig_dn == 'new'){
454       $ldap= $this->config->get_ldap_link();
455       $ldap->cd ($this->base);
457       /* It is possible to have a 'default' terminal on every base */
458       if($this->cn == "default"){
459         $ldap->cat($this->dn);
460       }else{
461         $ldap->search ("(&(objectClass=gotoTerminal)(cn=".$this->cn."))", array("cn"));
462       }
463       if ($ldap->count() != 0){
464         while ($attrs= $ldap->fetch()){
465           if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".normalizePreg(get_ou('systemIncomingRDN'))."/", $ldap->getDN())){
466             continue;
467           } else {
468             if ($attrs['dn'] != $this->orig_dn){
469               $message[]= msgPool::duplicated(_("Name"));
470               break;
471             }
472           }
473         }
474       }
475     }
477     /* Check for valid ntpServer selection */
478     if((!$this->inheritTimeServer) && (!count($this->gotoNtpServer))){
479       $message[]= msgPool::required(_("NTP server"));
480     }
482     /* Check if we are allowed to create or move this object
483      */
484     if($this->orig_dn == "new" && !$this->acl_is_createable($this->base)){
485       $message[] = msgPool::permCreate();
486     }elseif($this->orig_dn != "new" && $this->base != $this->orig_base && !$this->acl_is_moveable($this->base)){
487       $message[] = msgPool::permMove();
488     }
490     return ($message);
491   }
494   /* Save to LDAP */
495   function save()
496   {
497     /* Detect mode changes */
498     $activate= (isset($this->saved_attributes['gotoMode']) &&
499         $this->gotoMode != $this->saved_attributes['gotoMode'] &&
500         $this->gotoMode == "enabled" &&
501         tests::is_ip($this->netConfigDNS->ipHostNumber));
503     plugin::save();
505     /* Strip out 'default' values */
506     foreach (array("gotoTerminalPath", "gotoSwapServer", "gotoSyslogServer") as $val){
507       if(isset($this->attrs[$val])){
508         if ($this->attrs[$val] == "default"){
509           $this->attrs[$val]= array();
510         }
511       }
512     }
514     /* Add missing arrays */
515     foreach (array("ghScsiDev", "ghIdeDev", "ghNetNic") as $val){
516       if (isset ($this->$val) && count ($this->$val) != 0){
517         $this->attrs["$val"]= $this->$val;
518       }
519     }
521     /* Remove all empty values */
522     if ($this->orig_dn == 'new'){
523       $attrs= array();
524       foreach ($this->attrs as $key => $val){
525         if (is_array($val) && count($val) == 0){
526           continue;
527         }
528         $attrs[$key]= $val;
529       }
530       $this->attrs= $attrs;
531     }
533     /* Set ntpServers */
534     $this->attrs['gotoNtpServer'] = array();
535     if(!$this->inheritTimeServer){
536       foreach($this->gotoNtpServer as $server){
537         $this->attrs['gotoNtpServer'][] = $server;
538       }
539     }
541     /* cn=default and macAddress=- indicates that this is a template */
542     if($this->cn == "default"){
543       $this->netConfigDNS->macAddress = "-";
544     }
546     /* Write back to ldap */
547     $ldap= $this->config->get_ldap_link();
548     if ($this->orig_dn == 'new'){
549       $ldap->cd($this->config->current['BASE']);
550       $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
551       $ldap->cd($this->dn);
552       if (!count($this->attrs['gotoNtpServer'])){
553         unset($this->attrs['gotoNtpServer']);
554       }
555       $ldap->add($this->attrs);
556       new log("create","terminal/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
558       $this->netConfigDNS->cn = $this->cn;
559       $this->netConfigDNS->save();
561       $this->handle_post_events("add",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
562     } else {
563       $ldap->cd($this->dn);
564       $this->cleanup();
565       $ldap->modify ($this->attrs); 
566       new log("modify","terminal/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
568       $this->netConfigDNS->cn = $this->cn;
569       $this->netConfigDNS->save();
571       $this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
573       /* Update all accessTo/trust dependencies */
574       if($this->orig_cn != $this->cn){
575         update_accessTo($this->orig_cn,$this->cn);
576       }
577     }
578     
579     if (!$ldap->success()){
580       msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
581     }
583     /* Send installation activation
584      */
585     if ($activate && class_available("DaemonEvent")){
586       $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT);
587       $o_queue = new gosaSupportDaemon();
588       if(isset($events['TRIGGERED']['DaemonEvent_installation_activation'])){
589         $evt = $events['TRIGGERED']['DaemonEvent_installation_activation'];
590         $tmp = new $evt['CLASS_NAME']($this->config);
591         $tmp->set_type(TRIGGERED_EVENT);
592         $tmp->add_targets(array($this->netConfigDNS->macAddress));
593         if(!$o_queue->append($tmp)){
594           msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
595         }
596       }
597     }
598   }
601   /* Display generic part for server copy & paste */
602   function getCopyDialog()
603   {
604     $vars = array("cn");
605     $smarty = get_smarty();
606     $smarty->assign("cn" ,$this->cn);
607     $smarty->assign("object","terminal");
608     $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
609     $ret = array();
610     $ret['string'] = $str;
611     $ret['status'] = "";
612     return($ret);
613   }
616   function saveCopyDialog()
617   {
618     if(isset($_POST['cn'])){
619       $this->cn = $_POST['cn'];
620     }
621   }
624   function PrepareForCopyPaste($source)
625   {
626     plugin::PrepareForCopyPaste($source);
627     if(isset($source['macAddress'][0])){
628       $this->netConfigDNS->macAddress = $source['macAddress'][0];
629     }
630     if(isset($source['ipHostNumber'][0])){
631       $this->netConfigDNS->ipHostNumber = $source['ipHostNumber'][0];
632     }
634     /* Create used ntp server array */
635     $this->gotoNtpServer= array();
636     if(isset($source['gotoNtpServer'])){
637       $this->inheritTimeServer = false;
638       unset($source['gotoNtpServer']['count']);
639       foreach($source['gotoNtpServer'] as $server){
640         $this->gotoNtpServer[$server] = $server;
641       }
642     }
644     /* Set inherit checkbox state */
645     if((in_array("default",$this->gotoNtpServer)) || (count($this->gotoNtpServer)==0)){
646       $this->inheritTimeServer = true;
647       $this->gotoNtpServer=array();
648     }
649   }
652   /* Return plugin informations for acl handling */
653   static function plInfo()
654   {
655     return (array(
656           "plShortName"   => _("Terminal"),
657           "plDescription" => _("Terminal generic"),
658           "plSelfModify"  => FALSE,
659           "plDepends"     => array(),
660           "plPriority"    => 1,
661           "plSection"     => array("administration"),
662           "plCategory"    => array("terminal" => array( "description"  => _("Terminal"),
663                                                         "objectClass"  => "gotoTerminal")),
664           "plProvidedAcls"=> array(
665             "gotoMode"            => _("Mode"),
666             "gotoTerminalPath"    => _("Root server"),
667             "gotoSwapServer"      => _("Swap server"),
668             "gotoSyslogServer"    => _("Syslog server enabled"),
669             "gotoNtpServer"       => _("Ntp server settings"),
670             "base"                => _("Base"),
671             "cn"                  => _("Name"),
672             "description"         => _("Description"),
673             "gotoRootPasswd"      => _("Root password"),
674             "FAIstate"            => _("Action flag"))
675           ));
676   }
679   function set_everything_to_inherited()
680   {
681     $this->gotoTerminalPath  = "default";
682     $this->gotoSwapServer    = "default" ;
683     $this->gotoSyslogServer  = "default";
684     $this->inheritTimeServer = TRUE;
686     /* Set workstation service attributes to inherited */
687     if($this->member_of_ogroup && isset($this->parent->by_object['termservice'])){
688       foreach(array("gotoXKbLayout","gotoXKbModel","gotoXKbVariant",
689             "gotoXResolution","gotoXColordepth","gotoXMouseType","gotoXMouseport") as $name){
690         $this->parent->by_object['termservice']->$name = "default";
691       }
692     }
694     /* Set workstation startup attributes to inherited */
695     if($this->member_of_ogroup && isset($this->parent->by_object['termstartup'])){
696       $this->parent->by_object['termstartup']->gotoBootKernel = "default-inherited";
697       $this->parent->by_object['termstartup']->gotoLdapServer = "default-inherited";
699       $this->parent->by_object['workstartup']->gotoLdap_inherit = TRUE;
700       $this->parent->by_object['workstartup']->gotoLdapServers = array();
701     }
702   }
705 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
706 ?>