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= "";
33 var $orig_cn= "";
35 /* Plugin side filled */
36 var $modes= array();
38 var $netConfigDNS;
40 var $inheritTimeServer = true;
42 /* attribute list for save action */
43 var $ignore_account= TRUE;
44 var $attributes= array("gotoMode", "gotoSyslogServer", "gotoNtpServer",
45 "gotoFloppyEnable", "gotoCdromEnable", "cn", "gotoSndModule",
46 "ghCpuType", "ghMemSize", "ghUsbSupport", "description",
47 "ghGfxAdapter", "ghSoundAdapter", "gotoLastUser", "l","FAIscript");
48 var $objectclasses= array("top", "gotoWorkstation", "GOhard");
50 var $validActions = array("reboot" => "", "localboot" => "", "halt" => "", "update" => "", "reinstall" => "",
51 "rescan" => "", "wake" => "", "memcheck" => "", "sysinfo" => "");
53 var $fai_activated = FALSE;
55 var $member_of_ogroup = FALSE;
57 var $currently_installing = FALSE;
58 var $currently_installing_warned = FALSE;
60 function workgeneric (&$config, $dn= NULL, $parent= NULL)
61 {
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(!isset($this->parent->by_object['ogroup'])){
70 $ldap = $this->config->get_ldap_link();
71 $ldap->cd ($this->config->current['BASE']);
72 $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".LDAP::prepare4filter($this->dn)."))",array("cn"));
73 $this->member_of_ogroup = $ldap->count() >= 1;
74 }
76 $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses);
78 /* Check if this host is currently in installation process*/
79 if(class_available("gosaSupportDaemon") && class_available("DaemonEvent")){
80 $o = new gosaSupportDaemon();
81 $e_types = DaemonEvent::get_event_types(USER_EVENT | SYSTEM_EVENT | HIDDEN_EVENT);
82 $evts = $o->get_entries_by_mac(array($this->netConfigDNS->macAddress));
83 foreach($evts as $evt){
84 if(isset($e_types['QUEUED'][$evt['HEADERTAG']]) && $evt['STATUS'] == "processing" &&
85 $e_types['QUEUED'][$evt['HEADERTAG']] == "DaemonEvent_reinstall"){
86 $this->currently_installing =TRUE;
87 }
88 }
89 }
91 /* Read arrays */
92 foreach (array("ghNetNic", "ghIdeDev", "ghScsiDev") as $val){
93 if (!isset($this->attrs[$val])){
94 continue;
95 }
96 for ($i= 0; $i<$this->attrs[$val]['count']; $i++){
97 array_push($this->$val, $this->attrs[$val][$i]);
98 }
99 }
101 /* Create used ntp server array */
102 $this->gotoNtpServer= array();
103 if(isset($this->attrs['gotoNtpServer'])){
104 $this->inheritTimeServer = false;
105 unset($this->attrs['gotoNtpServer']['count']);
106 foreach($this->attrs['gotoNtpServer'] as $server){
107 $this->gotoNtpServer[$server] = $server;
108 }
109 }
111 /* Set inherit checkbox state */
112 if((in_array("default",$this->gotoNtpServer)) || (count($this->gotoNtpServer) == 0)){
113 $this->inheritTimeServer = true;
114 $this->gotoNtpServer=array();
115 }
117 /* You can't inherit the NTP service, if we are not member in an object group */
118 if(!$this->member_of_ogroup){
119 $this->inheritTimeServer = FALSE;
120 }
122 /* Create available ntp options */
123 $tmp = $this->config->data['SERVERS']['NTP'];
124 $this->gotoNtpServers = array();
125 foreach($tmp as $key => $server){
126 if($server == "default") continue;
127 $this->gotoNtpServers[$server] = $server;
128 }
130 $this->modes["active"]= _("Activated");
131 $this->modes["locked"]= _("Locked");
133 /* Set base */
134 if ($this->dn == "new"){
135 $ui= get_userinfo();
136 $this->base= dn2base($ui->dn);
137 } else {
138 $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("workstationou"))."/i", "", $this->dn);
139 }
141 /* Create an array of all Syslog servers */
142 $tmp = $this->config->data['SERVERS']['SYSLOG'];
143 foreach($tmp as $server){
144 $visible = $server;
145 if($server == "default" && $this->member_of_ogroup) {
146 $visible = "["._("inherited")."]";
147 }
148 $this->gotoSyslogServers[$server] = $visible;
149 }
151 $this->initial_gotoMode = $this->gotoMode;
153 /* Save 'dn' for later referal */
154 $this->orig_dn= $this->dn;
155 $this->orig_cn= $this->cn;
156 }
159 function set_acl_base($base)
160 {
161 plugin::set_acl_base($base);
162 $this->netConfigDNS->set_acl_base($base);
163 }
165 function set_acl_category($cat)
166 {
167 plugin::set_acl_category($cat);
168 $this->netConfigDNS->set_acl_category($cat);
169 }
171 function execute()
172 {
173 /* Call parent execute */
174 plugin::execute();
176 if($this->is_account && !$this->view_logged){
177 $this->view_logged = TRUE;
178 new log("view","workstation/".get_class($this),$this->dn);
179 }
181 /* Do we need to flip is_account state? */
182 if(isset($_POST['modify_state'])){
183 if($this->is_account && $this->acl_is_removeable()){
184 $this->is_account= FALSE;
185 }elseif(!$this->is_account && $this->acl_is_createable()){
186 $this->is_account= TRUE;
187 }
188 }
190 if ((isset($_POST['action'])) && ($this->acl_is_writeable("FAIstate")) && isset($this->validActions[$_POST['saction']]) ){
191 $action= $_POST['saction'];
193 /* Check if we have an DaemonEvent for this action */
194 if(class_available("DaemonEvent")){
195 $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT);
196 if(isset($events['TRIGGERED']["DaemonEvent_".$action])){
197 $evt = $events['TRIGGERED']["DaemonEvent_".$action];
198 $tmp = new $evt['CLASS_NAME']($this->config);
199 $tmp->add_targets(array($this->netConfigDNS->macAddress));
200 $tmp->set_type(TRIGGERED_EVENT);
201 $o_queue = new gosaSupportDaemon();
202 if(!$o_queue->append($tmp)){
203 msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
204 }
205 }
206 } else {
207 msg_dialog::display(_("Event error"),
208 sprintf(_("Event '%s' is not available!"),$action),ERROR_DIALOG);
209 }
212 }
214 /* Do we represent a valid terminal? */
215 if (!$this->is_account && $this->parent === NULL){
216 $display= "<img alt=\"\" src=\"images/stop.png\" align=middle> <b>".
217 msgPool::noValidExtension(_("workstation"))."</b>";
218 return($display);
219 }
221 /* Base select dialog */
222 $once = true;
223 foreach($_POST as $name => $value){
224 if(preg_match("/^chooseBase/",$name) && $once && $this->acl_is_writeable("base")){
225 $once = false;
226 $this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases());
227 $this->dialog->setCurrentBase($this->base);
228 }
229 }
231 /* Dialog handling */
232 if(is_object($this->dialog)){
233 /* Must be called before save_object */
234 $this->dialog->save_object();
236 if($this->dialog->isClosed()){
237 $this->dialog = false;
238 }elseif($this->dialog->isSelected()){
240 /* A new base was selected, check if it is a valid one */
241 $tmp = $this->get_allowed_bases();
242 if(isset($tmp[$this->dialog->isSelected()])){
243 $this->base = $this->dialog->isSelected();
244 }
246 $this->dialog= false;
247 }else{
248 return($this->dialog->execute());
249 }
250 }
252 /* Add new ntp Server to our list */
253 if((isset($_POST['addNtpServer'])) && (isset($_POST['gotoNtpServers'])) && $this->acl_is_writeable("gotoNtpServer")){
254 $this->gotoNtpServer[$_POST['gotoNtpServers']] = $_POST['gotoNtpServers'];
255 }
257 /* Delete selected NtpServer for list of used servers */
258 if((isset($_POST['delNtpServer'])) && (isset($_POST['gotoNtpServerSelected'])) && $this->acl_is_writeable("gotoNtpServer")){
259 foreach($_POST['gotoNtpServerSelected'] as $name){
260 unset($this->gotoNtpServer[$name]);
261 }
262 }
264 /* Fill templating stuff */
265 $smarty= get_smarty();
267 /* Set acls */
268 $tmp = $this->plInfo();
269 foreach($tmp['plProvidedAcls'] as $name => $translation){
270 $smarty->assign($name."ACL",$this->getacl($name));
271 }
273 $smarty->assign("cn", $this->cn);
274 $smarty->assign("description", $this->description);
275 $smarty->assign("l", $this->l);
276 $smarty->assign("bases", $this->get_allowed_bases());
277 $smarty->assign("staticAddress", "");
279 $tmp = array();
280 foreach($this->gotoNtpServers as $server){
281 if(!in_array($server,$this->gotoNtpServer)){
282 $tmp[$server] = $server;
283 }
284 }
285 $smarty->assign("gotoNtpServers",$tmp);
287 /* Check if workstation is online */
288 if (gosaSupportDaemon::ping($this->netConfigDNS->macAddress)){
289 $smarty->assign("actions", array("halt" => _("Switch off"), "reboot" => _("Reboot"),
290 "update" => _("System update"),
291 "reinstall" => _("Reinstall"),
292 "rescan" => _("Rescan hardware"),
293 "memcheck" => _("Memory test"),
294 "localboot" => _("Force localboot"),
295 "sysinfo" => _("System analysis")));
296 } else {
297 $smarty->assign("actions", array("wake" => _("Wake up"),
298 "reinstall" => _("Reinstall"),
299 "update" => _("System update"),
300 "memcheck" => _("Memory test"),
301 "localboot" => _("Force localboot"),
302 "sysinfo" => _("System analysis")));
303 }
304 /* Arrays */
305 $smarty->assign("modes", $this->modes);
306 $smarty->assign("nfsservers", $this->config->data['SERVERS']['NFS']);
307 $smarty->assign("syslogservers", $this->gotoSyslogServers);
308 $smarty->assign("fai_activated",$this->fai_activated);
310 $ntpser = array();
311 foreach($this->gotoNtpServers as $server){
312 if(!in_array($server,$this->gotoNtpServer)){
313 $ntpser[$server] = $server;
314 }
315 }
316 $smarty->assign("gotoNtpServers", $ntpser);
318 /* Variables */
319 foreach(array("base", "gotoMode", "gotoSyslogServer", "gotoNtpServer") as $val){
320 $smarty->assign($val."_select", $this->$val);
321 }
323 /* tell smarty the inherit checkbox state */
324 $smarty->assign("inheritTimeServer",$this->inheritTimeServer);
325 $smarty->assign("member_of_ogroup",$this->member_of_ogroup);
327 $str = $this->netConfigDNS->execute();
328 if(is_object($this->netConfigDNS->dialog)){
329 return($str);
330 }
331 $smarty->assign("netconfig", $str);
333 /* Show main page */
334 $smarty->assign("currently_installing", $this->currently_installing);
335 return($smarty->fetch (get_template_path('workstation.tpl', TRUE, dirname(__FILE__))));
336 }
338 function remove_from_parent()
339 {
340 if($this->acl_is_removeable()){
342 $this->netConfigDNS->remove_from_parent();
343 $ldap= $this->config->get_ldap_link();
344 $ldap->rmdir($this->dn);
345 new log("remove","workstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
346 if (!$ldap->success()){
347 msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));
348 }
350 /* Optionally execute a command after we're done */
351 $this->handle_post_events("remove", array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
353 /* Delete references to object groups */
354 $ldap->cd ($this->config->current['BASE']);
355 $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn"));
356 while ($ldap->fetch()){
357 $og= new ogroup($this->config, $ldap->getDN());
358 unset($og->member[$this->dn]);
359 $og->save ();
360 }
362 /* Remove all accessTo/trust dependencies */
363 update_accessTo($this->cn,"");
364 }
366 /* Clean queue form entries with this mac
367 */
368 if(class_available("gosaSupportDaemon") && tests::is_mac($this->netConfigDNS->orig_macAddress)){
369 $q = new gosaSupportDaemon();
370 $q->clean_queue_from_mac($this->netConfigDNS->orig_macAddress);
371 }
373 if(isset($_POST["inheritAll"])){
374 $this->set_everything_to_inherited();
375 }
376 }
379 /* Save data to object */
380 function save_object()
381 {
383 /* Create a base backup and reset the
384 base directly after calling plugin::save_object();
385 Base will be set seperatly a few lines below */
386 $base_tmp = $this->base;
387 plugin::save_object();
388 $this->base = $base_tmp;
390 /* Save base, since this is no LDAP attribute */
391 $tmp = $this->get_allowed_bases();
392 if(isset($_POST['base'])){
393 if(isset($tmp[$_POST['base']])){
394 $this->base= $_POST['base'];
395 }
396 }
398 $this->netConfigDNS->save_object();
400 /* Set inherit mode */
401 if((isset($_POST['workgeneric_posted'])) && ($this->acl_is_writeable("gotoNtpServer"))){
402 if(isset($_POST["inheritTimeServer"]) && $this->member_of_ogroup){
403 $this->inheritTimeServer = true;
404 }else{
405 $this->inheritTimeServer = false;
406 }
407 }
409 if(isset($_POST["inheritAll"])){
410 $this->set_everything_to_inherited();
411 }
412 }
415 /* Check supplied data */
416 function check()
417 {
418 /* Call common method to give check the hook */
419 $message= plugin::check();
421 /* Skip IP & Mac checks if this is a template */
422 if($this->cn != "wdefault"){
423 $message= array_merge($message, $this->netConfigDNS->check());
424 }
426 $this->dn= "cn=".$this->cn.",".get_ou('workstationou').$this->base;
428 if ($this->cn == ""){
429 $message[]= msgPool::required(_("Name"));
430 }
432 /* Check if given name is a valid host/dns name */
433 if(!tests::is_dns_name($this->cn)){
434 $message[] = msgPool::invalid(_("Name"));
435 }
437 if ($this->orig_dn != $this->dn){
438 $ldap= $this->config->get_ldap_link();
439 $ldap->cd ($this->base);
441 if($this->cn == "wdefault"){
442 $ldap->cat($this->dn);
443 }else{
444 $ldap->search ("(&(cn=".$this->cn.")(objectClass=gotoWorkstation))", array("cn"));
445 }
446 if ($ldap->count() != 0){
447 while ($attrs= $ldap->fetch()){
448 if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".get_ou('incomingou')."/", $ldap->getDN())){
449 continue;
450 } else {
451 if ($attrs['dn'] != $this->orig_dn){
452 $message[]= msgPool::duplicated(_("Name"));
453 break;
454 }
455 }
456 }
457 }
458 }
460 /* Check for valid ntpServer selection */
461 if((!$this->inheritTimeServer) && (!count($this->gotoNtpServer))){
462 $message[]= msgPool::required(_("NTP server"));
463 }
465 /* Only systems with a valid ldap handle can be activated
466 */
467 if($this->gotoMode == "active" && $this->initial_gotoMode != "active"){
469 if(isset($this->parent->by_object['workstartup']) && !count($this->parent->by_object['workstartup']->gotoLdapServers)){
470 $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.");
471 }
472 }else{
473 /* Warn the user, that this host is currently installing */
474 if($this->currently_installing && !$this->currently_installing_warned &&
475 !preg_match("/".normalizePreg(get_ou("incomingou"))."/",$this->orig_dn)){
477 /* Force aborting without message dialog */
478 $message[] = "";
479 $this->currently_installing_warned = TRUE;
480 msg_dialog::display(_("Software deployment"),
481 _("This host is currently installing, if you really want to save it, press 'OK'."),
482 CONFIRM_DIALOG);
483 }
484 }
486 return ($message);
487 }
490 /* Save to LDAP */
491 function save()
492 {
493 /* Detect mode changes */
494 $activate= (isset($this->saved_attributes['gotoMode']) &&
495 $this->gotoMode != $this->saved_attributes['gotoMode'] &&
496 $this->gotoMode == "active" &&
497 tests::is_ip($this->netConfigDNS->ipHostNumber));
498 plugin::save();
500 /* Strip out 'default' values */
501 foreach (array("gotoSyslogServer") as $val){
503 if (isset($this->attrs[$val]) && $this->attrs[$val] == "default"){
504 $this->attrs[$val]= array();
505 }
506 }
508 /* Add missing arrays */
509 foreach (array("ghScsiDev", "ghIdeDev", "ghNetNic") as $val){
510 if (isset ($this->$val) && count ($this->$val) != 0){
511 $this->attrs["$val"]= $this->$val;
512 }
513 }
515 /* Remove all empty values */
516 if ($this->orig_dn == 'new'){
517 $attrs= array();
518 foreach ($this->attrs as $key => $val){
519 if (is_array($val) && count($val) == 0){
520 continue;
521 }
522 $attrs[$key]= $val;
523 }
524 $this->attrs= $attrs;
525 }
527 /* Update ntp server settings */
528 if($this->inheritTimeServer){
529 if($this->is_new){
530 if(isset($this->attrs['gotoNtpServer'])){
531 unset($this->attrs['gotoNtpServer']);
532 }
533 }else{
534 $this->attrs['gotoNtpServer'] = array();
535 }
536 }else{
537 /* Set ntpServers */
538 $this->attrs['gotoNtpServer'] = array();
539 foreach($this->gotoNtpServer as $server){
540 $this->attrs['gotoNtpServer'][] = $server;
541 }
542 }
544 /* Write back to ldap */
545 $ldap= $this->config->get_ldap_link();
546 if ($this->orig_dn == 'new'){
547 $ldap->cd($this->config->current['BASE']);
548 $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
549 $ldap->cd($this->dn);
550 $ldap->add($this->attrs);
551 new log("create","workstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
552 if (!$ldap->success()){
553 msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
554 }
555 $this->handle_post_events("add",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
556 } else {
557 if ($this->orig_dn != $this->dn){
559 /* Remove all accessTo/trust dependencies */
560 update_accessTo($this->orig_cn,$this->cn);
561 }
562 $ldap->cd($this->dn);
563 $this->cleanup();
564 $ldap->modify ($this->attrs);
565 if (!$ldap->success()){
566 msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
567 }
568 new log("modify","workstation/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
569 $this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
570 }
572 /* cn=default and macAddress=- indicates that this is a template */
573 if($this->cn == "wdefault"){
574 $this->netConfigDNS->macAddress = "-";
575 }
577 $this->netConfigDNS->cn = $this->cn;
578 $this->netConfigDNS->save();
580 if ($activate && class_available("DaemonEvent")){
582 /* Send installation activation
583 */
584 $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT);
585 $o_queue = new gosaSupportDaemon();
586 if(isset($events['TRIGGERED']['DaemonEvent_installation_activation'])){
587 $evt = $events['TRIGGERED']['DaemonEvent_installation_activation'];
588 $tmp = new $evt['CLASS_NAME']($this->config);
589 $tmp->set_type(TRIGGERED_EVENT);
590 $tmp->add_targets(array($this->netConfigDNS->macAddress));
591 if(!$o_queue->append($tmp)){
592 msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
593 }
594 }
595 }
596 }
599 /* Display generic part for server copy & paste */
600 function getCopyDialog()
601 {
602 $vars = array("cn");
603 $smarty = get_smarty();
604 $smarty->assign("cn" ,$this->cn);
605 $smarty->assign("object","workstation");
606 $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
607 $ret = array();
608 $ret['string'] = $str;
609 $ret['status'] = "";
610 return($ret);
611 }
614 function saveCopyDialog()
615 {
616 if(isset($_POST['cn'])){
617 $this->cn = $_POST['cn'];
618 }
619 }
622 function PrepareForCopyPaste($source)
623 {
624 plugin::PrepareForCopyPaste($source);
625 if(isset($source['macAddress'][0])){
626 $this->netConfigDNS->macAddress = $source['macAddress'][0];
627 }
628 if(isset($source['ipHostNumber'][0])){
629 $this->netConfigDNS->ipHostNumber = $source['ipHostNumber'][0];
630 }
632 /* Create used ntp server array */
633 $this->gotoNtpServer= array();
634 if(isset($source['gotoNtpServer'])){
635 $this->inheritTimeServer = false;
636 unset($source['gotoNtpServer']['count']);
637 foreach($source['gotoNtpServer'] as $server){
638 $this->gotoNtpServer[$server] = $server;
639 }
640 }
642 /* Set inherit checkbox state */
643 if((in_array("default",$this->gotoNtpServer)) || (count($this->gotoNtpServer)==0)){
644 $this->inheritTimeServer = true;
645 $this->gotoNtpServer=array();
646 }
647 }
650 /* Return plugin informations for acl handling
651 #FIXME FAIscript seams to ununsed within this class... */
652 static function plInfo()
653 {
654 return (array(
655 "plShortName" => _("Generic"),
656 "plDescription" => _("Workstation generic"),
657 "plSelfModify" => FALSE,
658 "plDepends" => array(),
659 "plPriority" => 0,
660 "plSection" => array("administration"),
661 "plCategory" => array("workstation" => array("description" => _("Workstation"),
662 "objectClass" => "gotoWorkstation")),
663 "plProvidedAcls"=> array(
664 "cn" => _("Workstation name"),
665 "description" => _("Description") ,
666 "l" => _("Location") ,
667 "base" => _("Base") ,
668 "gotoMode" => _("Goto mode"),
669 "gotoSyslogServer" => _("Syslog server"),
670 "gotoNtpServer" => _("Ntp server"),
671 "gotoRootPasswd" => _("Root password"),
672 "FAIstate" => _("Action flag"))
673 ));
674 }
676 function set_everything_to_inherited()
677 {
678 $this->gotoSyslogServer = "default";
679 $this->inheritTimeServer = TRUE;
681 /* Set workstation service attributes to inherited */
682 if($this->member_of_ogroup && isset($this->parent->by_object['workservice'])){
683 foreach(array("gotoXKbLayout","gotoXKbModel","gotoXKbVariant",
684 "gotoXResolution","gotoXColordepth","gotoXMouseType","gotoXMouseport") as $name){
685 $this->parent->by_object['workservice']->$name = "default";
686 }
687 }
689 /* Set workstation startup attributes to inherited */
690 if($this->member_of_ogroup && isset($this->parent->by_object['workstartup'])){
691 $this->parent->by_object['workstartup']->gotoBootKernel = "default-inherited";
692 $this->parent->by_object['workstartup']->gotoLdapServer = "default-inherited";
693 $this->parent->by_object['workstartup']->FAIdebianMirror= "inherited";
694 }
695 }
696 }
697 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
698 ?>