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