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 var $auto_activate= FALSE;
28 /* Needed values and lists */
29 var $base= "";
30 var $cn= "";
31 var $description= "";
32 var $orig_dn= "";
33 var $orig_cn= "";
34 var $orig_base= "";
36 var $inheritTimeServer = true;
38 /* Plugin side filled */
39 var $modes= array();
41 /* attribute list for save action */
42 var $ignore_account= TRUE;
43 var $attributes= array("gotoMode", "gotoTerminalPath",
44 "gotoSwapServer", "gotoSyslogServer", "gotoNtpServer",
45 "gotoFloppyEnable", "gotoCdromEnable", "cn", "gotoSndModule",
46 "ghCpuType", "ghMemSize","ghUsbSupport", "description",
47 "ghGfxAdapter", "ghSoundAdapter", "gotoLastUser");
48 var $objectclasses= array("top", "gotoTerminal", "GOhard");
50 var $validActions = array("reboot" => "", "rescan" => "", "wake" => "", "memcheck" => "", "sysinfo" => "");
52 var $fai_activated = FALSE;
53 var $view_logged = FALSE;
55 var $member_of_ogroup = FALSE;
57 var $kerberos_key_service = NULL;
60 function termgeneric (&$config, $dn= NULL, $parent= NULL)
61 {
62 /* Check if FAI is activated */
63 $tmp= $config->search("faiManagement", "CLASS",array('menu','tabs'));
64 if(!empty($tmp)){
65 $this->fai_activated = TRUE;
66 }
68 plugin::plugin ($config, $dn, $parent);
70 if(class_available("krbHostKeys")){
71 $this->kerberos_key_service = new krbHostKeys($this->config,$this);
72 }
74 if(!isset($this->parent->by_object['ogroup'])){
75 $ldap = $this->config->get_ldap_link();
76 $ldap->cd ($this->config->current['BASE']);
77 $ldap->search("(&(|(objectClass=gotoTerminalTemplate)(objectClass=gotoWorkstationTemplate))(member=".LDAP::prepare4filter($this->dn)."))",array("cn"));
78 $this->member_of_ogroup = $ldap->count() >= 1;
79 }
81 $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses);
82 $this->netConfigDNS->MACisMust =TRUE;
84 /* Read arrays */
85 foreach (array("ghNetNic", "ghIdeDev", "ghScsiDev") as $val){
86 if (!isset($this->attrs[$val])){
87 continue;
88 }
89 for ($i= 0; $i<$this->attrs[$val]['count']; $i++){
90 array_push($this->$val, $this->attrs[$val][$i]);
91 }
92 }
94 /* Create used ntp server array */
95 $this->gotoNtpServer= array();
96 if(isset($this->attrs['gotoNtpServer'])){
97 $this->inheritTimeServer = false;
98 for($i = 0 ; $i < $this->attrs['gotoNtpServer']['count']; $i++ ){
99 $server = $this->attrs['gotoNtpServer'][$i];
100 $this->gotoNtpServer[$server] = $server;
101 }
102 }
104 /* Set inherit checkbox state */
105 if((in_array("default",$this->gotoNtpServer)) || (count($this->gotoNtpServer)==0)){
106 $this->inheritTimeServer = true;
107 $this->gotoNtpServer=array();
108 }
110 /* You can't inherit the NTP service, if we are not member in an object group */
111 if(!$this->member_of_ogroup){
112 $this->inheritTimeServer = FALSE;
113 }
115 /* Create available ntp options */
116 $this->gotoNtpServers = $this->config->data['SERVERS']['NTP'];
117 foreach($this->gotoNtpServers as $key => $server){
118 if($server == "default"){
119 unset($this->gotoNtpServers[$key]);
120 }
121 }
123 $this->modes["locked"]= _("Locked");
124 $this->modes["active"]= _("Activated");
126 /* Set base */
127 if ($this->dn == "new"){
128 $ui= get_userinfo();
129 $this->base= dn2base($ui->dn);
130 } else {
131 $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("terminalRDN"), '/')."/i", "", $this->dn);
132 }
134 /* Create an array of all Syslog servers */
135 $tmp = $this->config->data['SERVERS']['SYSLOG'];
136 foreach($tmp as $server){
137 $visible = $server;
138 if($server == "default" && $this->member_of_ogroup) {
139 $visible = "["._("inherited")."]";
140 }
141 $this->gotoSyslogServers[$server] = $visible;
142 }
144 $this->orig_dn= $this->dn;
145 $this->orig_cn= $this->cn;
146 $this->orig_base= $this->base;
147 }
149 function set_acl_base($base)
150 {
151 plugin::set_acl_base($base);
152 $this->netConfigDNS->set_acl_base($base);
153 }
155 function set_acl_category($cat)
156 {
157 plugin::set_acl_category($cat);
158 $this->netConfigDNS->set_acl_category($cat);
159 }
161 function execute()
162 {
163 /* Call parent execute */
164 plugin::execute();
166 if($this->is_account && !$this->view_logged){
167 $this->view_logged = TRUE;
168 new log("view","terminal/".get_class($this),$this->dn);
169 }
171 /* Do we need to flip is_account state? */
172 if (isset($_POST['modify_state'])){
173 $this->is_account= !$this->is_account;
174 }
176 if (isset($_POST['action']) && $this->acl_is_writeable("FAIstate") && isset($this->validActions[$_POST['saction']])){
177 $action = $_POST['saction'];
179 /* Check if we have an DaemonEvent for this action */
180 if(class_available("DaemonEvent_".$action)){
181 $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT);
182 if(isset($events['TRIGGERED']["DaemonEvent_".$action])){
183 $evt = $events['TRIGGERED']["DaemonEvent_".$action];
184 $tmp = new $evt['CLASS_NAME']($this->config);
185 $tmp->add_targets(array($this->netConfigDNS->macAddress));
186 $tmp->set_type(TRIGGERED_EVENT);
187 $o_queue = new gosaSupportDaemon();
188 if(!$o_queue->append($tmp)){
189 msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
190 }
191 }
192 }else{
193 msg_dialog::display(_("Event error"),
194 sprintf(_("Event '%s' is not available!"),$action),ERROR_DIALOG);
195 }
197 }
199 /* Base select dialog */
200 $once = true;
201 foreach($_POST as $name => $value){
202 if(preg_match("/^chooseBase/",$name) && $once && $this->acl_is_moveable()){
203 $once = false;
204 $this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases());
205 $this->dialog->setCurrentBase($this->base);
206 }
207 }
209 /* Dialog handling */
210 if(is_object($this->dialog)){
211 /* Must be called before save_object */
212 $this->dialog->save_object();
214 if($this->dialog->isClosed()){
215 $this->dialog = false;
216 }elseif($this->dialog->isSelected()){
218 /* A new base was selected, check if it is a valid one */
219 $tmp = $this->get_allowed_bases();
220 if(isset($tmp[$this->dialog->isSelected()])){
221 $this->base = $this->dialog->isSelected();
222 }
223 $this->dialog= false;
224 }else{
225 return($this->dialog->execute());
226 }
227 }
229 /* Do we represent a valid terminal? */
230 if (!$this->is_account && $this->parent === NULL){
231 $display= "<img alt=\"\" src=\"images/small-error.png\" align=middle> <b>".
232 msgPool::noValidExtension(_("terminal"))."</b>";
233 return($display);
234 }
236 /* Add new ntp Server to our list */
237 if((isset($_POST['addNtpServer'])) && (isset($_POST['gotoNtpServers'])) && $this->acl_is_writeable("gotoNtpServer")){
238 $this->gotoNtpServer[$_POST['gotoNtpServers']] = $_POST['gotoNtpServers'];
239 }
241 /* Delete selected NtpServer for list of used servers */
242 if((isset($_POST['delNtpServer'])) && (isset($_POST['gotoNtpServerSelected'])) && $this->acl_is_writeable("gotoNtpServer")){
243 foreach($_POST['gotoNtpServerSelected'] as $name){
244 unset($this->gotoNtpServer[$name]);
245 }
246 }
248 /* Fill templating stuff */
249 $smarty= get_smarty();
251 $tmp = $this->plInfo();
252 foreach($tmp['plProvidedAcls'] as $name => $translation){
253 $smarty->assign($name."ACL",$this->getacl($name));
254 }
256 $smarty->assign("cn", $this->cn);
257 $smarty->assign("description", $this->description);
258 $smarty->assign("staticAddress", "");
260 $smarty->assign("bases", $this->get_allowed_bases());
262 /* tell smarty the inherit checkbox state */
263 $smarty->assign("inheritTimeServer",$this->inheritTimeServer);
265 /* Check if terminal is online */
266 if (gosaSupportDaemon::ping($this->netConfigDNS->macAddress)){
267 $smarty->assign("actions", array( "halt" => _("Switch off"),
268 "reboot" => _("Reboot"),
269 #"memcheck" => _("Memory test"),
270 #"sysinfo" => _("System analysis")
271 ));
272 } else {
273 $smarty->assign("actions", array("wake" => _("Wake up"),
274 #"memcheck" => _("Memory test"),
275 #"sysinfo" => _("System analysis")
276 ));
277 }
279 /* Arrays */
280 $smarty->assign("modes", $this->modes);
282 $tmp2 = array();
283 $tmp2['!']= _("Local swap");
284 foreach($this->config->data['SERVERS']['NBD'] as $server){
285 if($server != "default"){
286 $tmp2[$server]= $server;
287 }else{
288 if($this->member_of_ogroup){
289 $tmp2[$server]="["._("inherited")."]";
290 }
291 }
292 }
294 $smarty->assign("swapservers", $tmp2);
295 $tmp2 = array();
296 foreach($this->config->data['SERVERS']['NFS'] as $server){
297 if($server != "default"){
298 $tmp2[$server]= $server;
299 }else{
300 if($this->member_of_ogroup){
301 $tmp2[$server]="["._("inherited")."]";
302 }
303 }
304 }
306 $smarty->assign("nfsservers", $tmp2);
307 $smarty->assign("syslogservers", $this->gotoSyslogServers);
309 $tmp = array();
310 foreach($this->gotoNtpServers as $server){
311 if(!in_array($server,$this->gotoNtpServer)){
312 $tmp[$server] = $server;
313 }
314 }
316 $smarty->assign("ntpservers", $tmp);
317 $smarty->assign("fai_activated",$this->fai_activated);
319 /* Variables */
320 foreach(array("base", "gotoMode", "gotoTerminalPath", "gotoSwapServer","gotoSyslogServer", "gotoNtpServer") as $val){
321 $smarty->assign($val."_select", $this->$val);
322 }
324 $smarty->assign("member_of_ogroup",$this->member_of_ogroup);
326 /* Show main page */
327 $str = $this->netConfigDNS->execute();
328 if(is_object($this->netConfigDNS->dialog)){
329 return($str);
330 }
331 $smarty->assign("netconfig", $str);
333 /* Display kerberos host key options */
334 $smarty->assign("host_key","");
335 if(is_object($this->kerberos_key_service)){
336 $smarty->assign("host_key",$this->kerberos_key_service->execute_by_prefix("host/"));
337 }
339 return($smarty->fetch (get_template_path('terminal.tpl', TRUE, dirname(__FILE__))));
340 }
342 function remove_from_parent()
343 {
344 if($this->acl_is_removeable()){
345 $ldap= $this->config->get_ldap_link();
346 $ldap->cd($this->dn);
347 $ldap->cat($this->dn, array('dn'));
348 if($ldap->count()){
349 $this->netConfigDNS->remove_from_parent();
350 $ldap->rmDir($this->dn);
352 new log("remove","terminal/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
354 if (!$ldap->success()){
355 msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));
356 }
358 /* Remove kerberos key dependencies too */
359 if(is_object($this->kerberos_key_service)){
360 $this->kerberos_key_service->remove_from_parent_by_prefix("host/");
361 }
363 /* Optionally execute a command after we're done */
364 $this->handle_post_events("remove",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
366 /* Delete references to object groups */
367 $ldap->cd ($this->config->current['BASE']);
368 $ldap->search ("(&(objectClass=gosaGroupOfNames)(member=".LDAP::prepare4filter($this->dn)."))", array("cn"));
369 while ($ldap->fetch()){
370 $og= new ogroup($this->config, $ldap->getDN());
371 unset($og->member[$this->dn]);
372 $og->save ();
373 }
375 /* Remove all accessTo/trust dependencies */
376 update_accessTo($this->cn,"");
377 }
379 /* Clean queue form entries with this mac
380 */
381 if(class_available("gosaSupportDaemon") && tests::is_mac($this->netConfigDNS->orig_macAddress)){
382 $q = new gosaSupportDaemon();
383 $q->clean_queue_from_mac($this->netConfigDNS->orig_macAddress);
384 }
385 }
386 }
389 /* Save data to object */
390 function save_object()
391 {
392 /* Create a base backup and reset the
393 base directly after calling plugin::save_object();
394 Base will be set seperatly a few lines below */
395 $base_tmp = $this->base;
396 plugin::save_object();
397 $this->base = $base_tmp;
399 /* Set new base if allowed */
400 $tmp = $this->get_allowed_bases();
401 if(isset($_POST['base'])){
402 if(isset($tmp[$_POST['base']])){
403 $this->base= $_POST['base'];
404 }
405 }
407 $this->netConfigDNS->save_object();
409 /* Save terminal path to parent since it is used by termstartup, too */
410 if(isset($this->parent->by_object['termstartup'])){
411 $this->parent->by_object['termstartup']->gotoTerminalPath= $this->gotoTerminalPath;
412 }
414 if(isset($_POST['termgeneric_posted'])){
415 if(isset($_POST["inheritTimeServer"]) && $this->member_of_ogroup){
416 $this->inheritTimeServer = true;
417 }else{
418 $this->inheritTimeServer = false;
419 }
420 }
422 if(isset($_POST["inheritAll"])){
423 $this->set_everything_to_inherited();
424 }
426 /* Hanle kerberos host key plugin */
427 if(is_object($this->kerberos_key_service)){
428 $this->kerberos_key_service->save_object_by_prefix("host/");
429 }
430 }
433 /* Check supplied data */
434 function check()
435 {
436 /* Call common method to give check the hook */
437 $message= plugin::check();
439 /* Skip IP & Mac checks if this is a template */
440 if($this->cn != "default"){
441 $message= array_merge($message, $this->netConfigDNS->check());
442 }
444 /* Permissions for that base? */
445 $this->dn= "cn=".$this->cn.",".get_ou('terminalRDN').$this->base;
447 if ($this->cn == ""){
448 $message[]= msgPool::required(_("Name"));
449 }
451 /* Check if given name is a valid host/dns name */
452 if(!tests::is_dns_name($this->cn) ){
453 $message[] = msgPool::invalid(_("Name"));
454 }
456 if ($this->orig_dn == 'new'){
457 $ldap= $this->config->get_ldap_link();
458 $ldap->cd ($this->base);
460 /* It is possible to have a 'default' terminal on every base */
461 if($this->cn == "default"){
462 $ldap->cat($this->dn);
463 }else{
464 $ldap->search ("(&(objectClass=gotoTerminal)(cn=".$this->cn."))", array("cn"));
465 }
466 if ($ldap->count() != 0){
467 while ($attrs= $ldap->fetch()){
468 if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".preg_quote(get_ou('systemIncomingRDN'), '/')."/i", $ldap->getDN())){
469 continue;
470 } else {
471 if ($attrs['dn'] != $this->orig_dn){
472 $message[]= msgPool::duplicated(_("Name"));
473 break;
474 }
475 }
476 }
477 }
478 }
480 /* Check for valid ntpServer selection */
481 if((!$this->inheritTimeServer) && (!count($this->gotoNtpServer))){
482 $message[]= msgPool::required(_("NTP server"));
483 }
485 /* Check if we are allowed to create or move this object
486 */
487 if($this->orig_dn == "new" && !$this->acl_is_createable($this->base)){
488 $message[] = msgPool::permCreate();
489 }elseif($this->orig_dn != "new" && $this->base != $this->orig_base && !$this->acl_is_moveable($this->base)){
490 $message[] = msgPool::permMove();
491 }
493 return ($message);
494 }
497 /* Save to LDAP */
498 function save()
499 {
500 /* Detect mode changes */
501 $activate= (isset($this->saved_attributes['gotoMode']) &&
502 $this->gotoMode != $this->saved_attributes['gotoMode'] &&
503 $this->gotoMode == "active" &&
504 tests::is_ip($this->netConfigDNS->ipHostNumber)) || $this->auto_activate;
506 /* Find proper terminal path for tftp configuration
507 FIXME: This is suboptimal when the default has changed to
508 another location! */
509 if ($this->gotoTerminalPath == "default"){
510 $ldap= $this->config->get_ldap_link();
512 /* Strip relevant part from dn, keep trailing ',' */
513 $tmp= preg_replace("/^cn=[^,]+,".preg_quote(get_ou('terminalRDN'), '/')."/i", "", $this->dn);
514 $tmp= preg_replace("/".$this->config->current['BASE']."$/i", "", $tmp);
516 /* Walk from top to base and try to load default values for
517 'gotoTerminalPath'. Abort when an entry is found. */
518 while (TRUE){
519 $tmp= preg_replace ("/^[^,]+,/", "", $tmp);
521 $ldap->cat("cn=default,".get_ou('terminalRDN').$tmp.
522 $this->config->current['BASE'], array('gotoTerminalPath'));
523 $attrs= $ldap->fetch();
524 if (isset($attrs['gotoTerminalPath'])){
525 $this->gotoTerminalPath= $attrs['gotoTerminalPath'][0];
526 break;
527 }
529 /* Nothing left? */
530 if ($tmp == ""){
531 break;
532 }
533 }
534 }
536 plugin::save();
538 /* Strip out 'default' values */
539 foreach (array("gotoTerminalPath", "gotoSwapServer", "gotoSyslogServer") as $val){
540 if(isset($this->attrs[$val])){
541 if ($this->attrs[$val] == "default"){
542 $this->attrs[$val]= array();
543 }
544 }
545 }
547 /* Add missing arrays */
548 foreach (array("ghScsiDev", "ghIdeDev", "ghNetNic") as $val){
549 if (isset ($this->$val) && count ($this->$val) != 0){
550 $this->attrs["$val"]= $this->$val;
551 }
552 }
554 /* Remove all empty values */
555 if ($this->orig_dn == 'new'){
556 $attrs= array();
557 foreach ($this->attrs as $key => $val){
558 if (is_array($val) && count($val) == 0){
559 continue;
560 }
561 $attrs[$key]= $val;
562 }
563 $this->attrs= $attrs;
564 }
566 /* Set ntpServers */
567 $this->attrs['gotoNtpServer'] = array();
568 if(!$this->inheritTimeServer){
569 foreach($this->gotoNtpServer as $server){
570 $this->attrs['gotoNtpServer'][] = $server;
571 }
572 }
574 /* cn=default and macAddress=- indicates that this is a template */
575 if($this->cn == "default"){
576 $this->netConfigDNS->macAddress = "-";
577 }
579 /* Write back to ldap */
580 $ldap= $this->config->get_ldap_link();
581 if ($this->orig_dn == 'new'){
582 $ldap->cd($this->config->current['BASE']);
583 $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
584 $ldap->cd($this->dn);
585 if (!count($this->attrs['gotoNtpServer'])){
586 unset($this->attrs['gotoNtpServer']);
587 }
588 $ldap->add($this->attrs);
589 new log("create","terminal/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
591 $this->netConfigDNS->cn = $this->cn;
592 $this->netConfigDNS->save();
594 $this->handle_post_events("add",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
595 } else {
596 $ldap->cd($this->dn);
597 $this->cleanup();
598 $ldap->modify ($this->attrs);
599 new log("modify","terminal/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
601 $this->netConfigDNS->cn = $this->cn;
602 $this->netConfigDNS->save();
604 $this->handle_post_events("modify",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
606 /* Update all accessTo/trust dependencies */
607 if($this->orig_cn != $this->cn){
608 update_accessTo($this->orig_cn,$this->cn);
609 }
610 }
612 if (!$ldap->success()){
613 msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
614 }
616 /* Send installation activation
617 */
618 if ($activate && class_available("DaemonEvent")){
619 $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT);
620 $o_queue = new gosaSupportDaemon();
621 if(isset($events['TRIGGERED']['DaemonEvent_installation_activation'])){
622 $evt = $events['TRIGGERED']['DaemonEvent_installation_activation'];
623 $tmp = new $evt['CLASS_NAME']($this->config);
624 $tmp->set_type(TRIGGERED_EVENT);
625 $tmp->add_targets(array($this->netConfigDNS->macAddress));
626 if(!$o_queue->append($tmp)){
627 msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
628 }
629 }
630 }
631 }
634 /* Display generic part for server copy & paste */
635 function getCopyDialog()
636 {
637 $vars = array("cn");
638 $smarty = get_smarty();
639 $smarty->assign("cn" ,$this->cn);
640 $smarty->assign("object","terminal");
641 $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
642 $ret = array();
643 $ret['string'] = $str;
644 $ret['status'] = "";
645 return($ret);
646 }
649 function saveCopyDialog()
650 {
651 if(isset($_POST['cn'])){
652 $this->cn = $_POST['cn'];
653 }
654 }
657 function PrepareForCopyPaste($source)
658 {
659 plugin::PrepareForCopyPaste($source);
660 if(isset($source['macAddress'][0])){
661 $this->netConfigDNS->macAddress = $source['macAddress'][0];
662 }
663 if(isset($source['ipHostNumber'][0])){
664 $this->netConfigDNS->ipHostNumber = $source['ipHostNumber'][0];
665 }
667 /* Create used ntp server array */
668 $this->gotoNtpServer= array();
669 if(isset($source['gotoNtpServer'])){
670 $this->inheritTimeServer = false;
671 unset($source['gotoNtpServer']['count']);
672 foreach($source['gotoNtpServer'] as $server){
673 $this->gotoNtpServer[$server] = $server;
674 }
675 }
677 /* Set inherit checkbox state */
678 if((in_array("default",$this->gotoNtpServer)) || (count($this->gotoNtpServer)==0)){
679 $this->inheritTimeServer = true;
680 $this->gotoNtpServer=array();
681 }
682 }
685 /* Return plugin informations for acl handling */
686 static function plInfo()
687 {
688 return (array(
689 "plShortName" => _("Terminal"),
690 "plDescription" => _("Terminal generic"),
691 "plSelfModify" => FALSE,
692 "plDepends" => array(),
693 "plPriority" => 1,
694 "plSection" => array("administration"),
695 "plCategory" => array("terminal" => array( "description" => _("Terminal"),
696 "objectClass" => "gotoTerminal")),
697 "plProvidedAcls"=> array(
698 "cn" => _("Name"),
699 "description" => _("Description"),
700 "base" => _("Base"),
702 "gotoMode" => _("Mode"),
703 "gotoSyslogServer" => _("Syslog server enabled"),
705 "gotoTerminalPath" => _("Root server"),
706 "gotoSwapServer" => _("Swap server"),
708 "gotoNtpServer" => _("Ntp server settings"),
709 "userPassword" => _("Root password"),
711 "FAIstate" => _("Action flag"))
712 ));
713 }
716 function set_everything_to_inherited()
717 {
718 $this->gotoTerminalPath = "default";
719 $this->gotoSwapServer = "default" ;
720 $this->gotoSyslogServer = "default";
721 $this->inheritTimeServer = TRUE;
723 /* Set workstation service attributes to inherited */
724 if($this->member_of_ogroup && isset($this->parent->by_object['termservice'])){
725 foreach(array("gotoXKbLayout","gotoXKbModel","gotoXKbVariant","gotoXDriver",
726 "gotoXResolution","gotoXColordepth","gotoXMouseType","gotoXMouseport") as $name){
727 $this->parent->by_object['termservice']->$name = "default";
728 }
729 }
731 /* Set workstation startup attributes to inherited */
732 if($this->member_of_ogroup && isset($this->parent->by_object['termstartup'])){
733 $this->parent->by_object['termstartup']->gotoBootKernel = "default-inherited";
734 $this->parent->by_object['termstartup']->gotoLdapServer = "default-inherited";
735 $this->parent->by_object['termstartup']->gotoLdap_inherit = TRUE;
736 $this->parent->by_object['termstartup']->gotoLdapServers = array();
737 }
738 }
741 function is_modal_dialog()
742 {
743 return((isset($this->dialog) && $this->dialog) || (isset($this->netConfigDNS->dialog) && $this->netConfigDNS->dialog));
744 }
746 }
748 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
749 ?>