Code

87c53ee721d91d665e0cedcb2dc01a098c687d09
[gosa.git] / plugins / admin / systems / class_workstationStartup.inc
1 <?php
2 class workstartup extends plugin
3 {
4   /* CLI vars */
5   var $cli_summary= "Manage terminal startup options";
6   var $cli_description= "Some longer text\nfor help";
7   var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
9   /* Generic terminal attributes */
10   var $bootmode             = "G";
11   var $goLdapServerList     = array("default");
12   var $gotoBootKernel       = "default";
13   var $gotoKernelParameters = "";
14   var $gotoLdapServer       = "";
15   var $gotoModules          = array();
16   var $gotoAutoFs           = array();
17   var $gotoFilesystem       = array();
18   var $gotoTerminalPath     = "";
19   var $FAIstatus            = "";
20   var $FAIclass             = array();
21   var $FAIclasses           = array();
22   var $FAIclassInfo         = array();
23   var $FAIdebianMirror      = array();
26   /* attribute list for save action */
27   var $attributes     = array("gotoLdapServer", "gotoBootKernel", "gotoKernelParameters", "FAIclass", "FAIstatus", "gotoShare","FAIdebianMirror");
28   var $objectclasses  = array("GOhard", "FAIobject");
30   /* Share */
31   var $gotoShares         = array();// Currently Share Option
32   var $gotoShare          = "";     // currently selected Share Option
33   var $gotoShareSelections= array();// Available Shares for this account in Listbox format
34   var $gotoAvailableShares= array();// Available Shares for this account
36   /* Helper */
37   var $customParameters   = "";
38   var $orig_dn            = "";
39   var $ignore_account     = TRUE;
40   var $FAIdebianMirrors   = array();
42   function workstartup ($config, $dn= NULL)
43   {
44     plugin::plugin ($config, $dn);
46     /* Creating a list of valid Mirrors 
47      * none will not be saved to ldap.
48      */
49     $this->FAIdebianMirrors   = array("none"=>_("none"));
50     $ldap   = $this->config->get_ldap_link();
51     $ldap->cd($this->config->current['BASE']);
52     $ldap->search("(objectClass=FAIrepository)",array("FAIdebianMirror"));
53     
54     /* attach all attributes with "index => cn" to avoid multiple entries */
55     $this->FAIdebianMirrors['auto']=_("automatic");
56     while($attr = $ldap->fetch()){
57       if(isset($attr['FAIdebianMirror'])){
58         $this->FAIdebianMirrors[$attr['FAIdebianMirror'][0]]=$attr['FAIdebianMirror'][0];
59       }
60     } 
61  
62     /* Get arrays */
63     foreach (array("gotoModules", "gotoAutoFs", "gotoFilesystem") as $val){
64       if (isset($this->attrs["$val"]["count"])){
65         for ($i= 0; $i<$this->attrs["count"]; $i++){
66           if (isset($this->attrs["$val"][$i])){
67             array_push($this->$val, $this->attrs["$val"][$i]);
68           }
69         }
70       }
71       sort ($this->$val);
72       $this->$val= array_unique($this->$val);
73     }
75     /* Parse Kernel Parameters to decide what boot mode is enabled */
76     if (preg_match("/ splash=silent/", $this->gotoKernelParameters)){
77       $this->bootmode= "G";
78     } elseif (preg_match("/ debug/", $this->gotoKernelParameters)){
79       $this->bootmode= "D";
80     } elseif ($this->gotoKernelParameters == "") {
81       $this->bootmode= "G";
82     } else {
83       $this->bootmode= "T";
84     }
85     if (preg_match("/ o /", $this->gotoKernelParameters)){
86       $this->customParameters= preg_replace ("/^.* o /", "", $this->gotoKernelParameters);
87     } else {
88       $this->customParameters= "";
89     }
91     /* Prepare Shares */
92     if((isset($this->attrs['gotoShare']))&&(is_array($this->attrs['gotoShare']))){
93       unset($this->attrs['gotoShare']['count']);
94       foreach($this->attrs['gotoShare'] as $share){
95         $tmp = $tmp2 = array();
96         $tmp = split("\|",$share);
97         $tmp2['server']      =$tmp[0];
98         $tmp2['name']        =$tmp[1];
99         $tmp2['mountPoint']  =$tmp[2];
100         $this->gotoShares[$tmp[1]."|".$tmp[0]]=$tmp2;
101       }
102     }
104     $this->gotoShareSelections= $config->getShareList(true);
105     $this->gotoAvailableShares= $config->getShareList(false);
106     $tmp2 = array();
107   
108     $ldap   = $this->config->get_ldap_link();
109     $ldap->cd($this->config->current['BASE']);
111     /* Search all FAI objects */
112     $ldap->search("(| (objectClass=FAIpackageList)(objectClass=FAItemplate)
113                       (objectClass=FAIvariable)(objectClass=FAIscript)(objectClass=FAIhook)(objectClass=FAIprofile)
114                       (objectClass=FAIpartitionTable))",array("objectClass","cn"),true);
115     /* Sort all entries, and attach elementtype.
116      * To be able to show the types in the listbox.
117      */
118     while($attr = $ldap->fetch()){
119       $cn = $attr['cn'][0];
120       if(in_array('FAIpackageList',$attr['objectClass'])){
121         $tmp2[$cn]['FAIpackageList']['obj']   = 'FAIpackageList'; 
122         $tmp2[$cn]['FAIpackageList']['kzl']   = 'Pl';
123         $this->FAIclasses[$attr['cn'][0]]=$attr['cn'][0];
124       }
125       if(in_array('FAItemplate',$attr['objectClass'])){
126         $tmp2[$cn]['FAItemplate']['obj']      = 'FAItemplate'; 
127         $tmp2[$cn]['FAItemplate']['kzl']      = 'T'; 
128         $this->FAIclasses[$attr['cn'][0]]=$attr['cn'][0];
129       }
130       if(in_array('FAIvariable',$attr['objectClass'])){
131         $tmp2[$cn]['FAIvariable']['obj']      = 'FAIvariable'; 
132         $tmp2[$cn]['FAIvariable']['kzl']      = 'V'; 
133         $this->FAIclasses[$attr['cn'][0]]=$attr['cn'][0];
134       }
135       if(in_array('FAIscript',$attr['objectClass'])){
136         $tmp2[$cn]['FAIscript']['obj']        = 'FAIscript'; 
137         $tmp2[$cn]['FAIscript']['kzl']        = 'S'; 
138         $this->FAIclasses[$attr['cn'][0]]=$attr['cn'][0];
139       }
140       if(in_array('FAIhook',$attr['objectClass'])){
141         $tmp2[$cn]['FAIhook']['obj']          = 'FAIhook'; 
142         $tmp2[$cn]['FAIhook']['kzl']          = 'H'; 
143         $this->FAIclasses[$attr['cn'][0]]=$attr['cn'][0];
144       }
145       if(in_array('FAIpartitionTable',$attr['objectClass'])){
146         $tmp2[$cn]['FAIpartitionTable']['obj']= 'FAIpartitionTable'; 
147         $tmp2[$cn]['FAIpartitionTable']['kzl']= 'Pt'; 
148         $this->FAIclasses[$attr['cn'][0]]=$attr['cn'][0];
149       }
150       if(in_array('FAIprofile',$attr['objectClass'])){
151         $tmp2[$cn]['FAIprofile']['obj']= 'FAIprofile'; 
152         $tmp2[$cn]['FAIprofile']['kzl']= 'P'; 
153         $this->FAIclasses[$attr['cn'][0]]=$attr['cn'][0];
154       }
155     }
157     $this->FAIclassInfo = $tmp2;
159     if((isset($this->FAIclass))&&(!is_array($this->FAIclass))){
160       $tmp = array();
161       $tmp = split(" ",$this->FAIclass);
162       $tmp2 =array();  
163     
164       foreach($tmp as $class){
165         $tmp2[$class] = $class;
166       }
167       $this->FAIclass = $tmp2;
168     }
170     if(!is_array($this->FAIclass)){
171       $this->FAIclass =array();
172     }
174     $this->orig_dn= $this->dn;
175   }
177   /* Create array to display available classes/profiles in a selectbox */
178   function selectFriendlyClasses(){
179     $tmp=array();
180     foreach($this->FAIclasses as $class){
181       $str    = "";
182       $skip = false;
183       if(isset($this->FAIclassInfo[$class])){
184         foreach($this->FAIclassInfo[$class] as $objs){
185           $str .= $objs['kzl']." "; 
186         }
187       }
188       $tmp[$class] = $class."&nbsp; [".$str."]";
189     }
190     return($tmp);
191   }
193   function check()
194   {
195     $messages = array();
196     /* If there are packages selected, but no mirror show error */   
197     if(($this->FAIdebianMirror == "none")&&(count($this->FAIclass)>0)){
198       $messages[]=_("Please select a 'FAI server' or remove the 'FAI classes'.");
199     }
200     return($messages);
201   }
203   function execute()
204   {
205         /* Call parent execute */
206         plugin::execute();
208     /* Do we need to flip is_account state? */
209     if (isset($_POST['modify_state'])){
210       $this->is_account= !$this->is_account;
211     }
213     /* Do we represent a valid terminal? */
214     if (!$this->is_account && $this->parent == NULL){
215       $display= "<img alt=\"\" src=\"images/stop.png\" align=middle>&nbsp;<b>".
216         _("This 'dn' has no terminal features.")."</b>";
217       return ($display);
218     }
220     /* Add module */
221     if (isset ($_POST['add_module'])){
222       if ($_POST['module'] != "" && chkacl ($this->acl, "gotoModule") == ""){
223         $this->add_list ($this->gotoModules, $_POST['module']);
224       }
225     }
227     /* Delete module */
228     if (isset ($_POST['delete_module'])){
229       if (count($_POST['modules_list']) && chkacl ($this->acl, "gotoModule") == ""){
230         $this->del_list ($this->gotoModules, $_POST['modules_list']);
231       }
232     }
234     /* FAI class management */
235     if((isset($_POST['AddClass']))&&(isset($_POST['FAIclassesSel']))){
236       $found = 0 ; 
238       /* If this new class/profile will attach a second partition table
239        * to our list of classes, abort and show a message.
240        */
241       foreach($this->FAIclass as $name){
242         if(isset($this->FAIclassInfo[$name])){
243           foreach($this->FAIclassInfo[$name] as $atr){
244             if($atr['obj'] == "FAIpartitionTable"){
245               $found ++ ; 
246             }
247           }
248         }
249       }
251       if((isset($this->FAIclassInfo[$_POST['FAIclassesSel']]['FAIpartitionTable']))&&($found>0)){
252         print_red(_("There is already a profile in your selection that contain partition table configurations."));
253       }else{
254         $this->FAIclass[$_POST['FAIclassesSel']]=$_POST['FAIclassesSel'];
255       }
256     }
258     $sort = false;
259     foreach($_POST as $name => $val){
260       
261       $sort_type = false;
262       if((preg_match("/sort_up/",$name))&&(!$sort)){
263         $sort_type = "sort_up_";
264       }
265       if((preg_match("/sort_down/",$name))&&(!$sort)){
266         $sort_type = "sort_down_";
267       }
268     
269       if(($sort_type)&&(!$sort)){
270         $value = preg_replace("/_.*$/i","",preg_replace("/".$sort_type."/i","",$name));
271         $sort = true;
272         
273         $last = -1;
274         $change_down  = -1;
275  
276         /* Create array with numeric index */ 
277         $tmp = array();
278         foreach($this->FAIclass as $class){
279           $tmp [] = $class;
280         }
282         /* Walk trough array */
283         foreach($tmp as $key => $faiName){
284           if($faiName == $value){
285             if($sort_type == "sort_up_"){
286               if($last != -1){
287                  $change_down= $last;
288               }
289             }else{
290               if(isset($tmp[$key+1])){
291                 $change_down = $key;
292               }
293             }
294           }
295           $last = $key;
296         }
297  
298         $tmp2 = array();
299         $skip = false;    
300   
301         foreach($tmp as $ky => $vl){
303           if($ky == $change_down){
304             $skip = $vl;
305           }else{
306             $tmp2[$vl] = $vl;
307           }
308           if(($skip != false)&&($ky != $change_down)){
309             $tmp2[$skip]  = $skip;
310             $skip =false;
311           }
312         }   
313         $this->FAIclass = $tmp2; 
314       }
315   
317       if(preg_match("/fai_remove/i",$name)){
318         $value = preg_replace("/_.*$/i","",preg_replace("/fai_remove_/i","",$name));
319         unset($this->FAIclass[$value]);
320       }
321     }
323     /* Delete selected class from our list */
324     if((isset($_POST['DelClass']))&&(isset($_POST['FAIclassSel']))){
325       if(isset($this->FAIclass[$_POST['FAIclassSel']])){
326         unset($this->FAIclass[$_POST['FAIclassSel']]);
327       }
328     }
330     /* Show main page */
331     $smarty= get_smarty();
333     /* In this section server shares will be defined
334      * A user can select one of the given shares and a mount point
335      *  and attach this combination to his setup.
336      */
337     $smarty->assign("gotoShareSelections",    $this->gotoShareSelections);
338     $smarty->assign("gotoShareSelectionKeys", array_flip($this->gotoShareSelections));
340     /* if $_POST['gotoShareAdd'] is set, we will try to add a new entry
341      * This entry will be, a combination of mountPoint and sharedefinitions
342      */
343     if(isset($_POST['gotoShareAdd'])){
344       /* We assign a share to this user, if we don't know where to mount the share */
345       if((!isset($_POST['gotoShareMountPoint']))||(empty($_POST['gotoShareMountPoint']))||(preg_match("/[\|]/i",$_POST['gotoShareMountPoint']))){
346         print_red(_("You must specify a valid mount point."));
347       }else{
348         $a_share = $this->gotoAvailableShares[$_POST['gotoShareSelection']];
349         $s_mount = $_POST['gotoShareMountPoint'];
350         /* Preparing the new assignment */
351         $this->gotoShares[$a_share['name']."|".$a_share['server']]=$a_share;
352         $this->gotoShares[$a_share['name']."|".$a_share['server']]['mountPoint']=$s_mount;
353       }
354     }
356     /* if the Post  gotoShareDel is set, someone asked GOsa to delete the selected entry (if there is one selected)
357      * If there is no defined share selected, we will abort the deletion without any message
358      */
359     if((isset($_POST['gotoShareDel']))&&(isset($_POST['gotoShare']))){
360       unset($this->gotoShares[$_POST['gotoShare']]);
361     }
363     $smarty->assign("gotoShares",$this->printOutAssignedShares());
364     $smarty->assign("gotoShareKeys",array_flip($this->printOutAssignedShares()));
366     /* Arrays */
367     $smarty->assign("ldapservers", $this->config->data['SERVERS']['LDAP']);
368     $smarty->assign("gotoLdapServer_select", $this->gotoLdapServer);
369     $smarty->assign("gotoLdapServerACL", chkacl($this->acl, "gotoLdapServer"));
370     foreach (array("gotoModules", "gotoAutoFs", "gotoFilesystem") as $val){
371       $smarty->assign("$val", $this->$val);
372     }
374     /* Values */
375     foreach(array("gotoBootKernel", "customParameters", "gotoShare","FAIclasses","FAIclass","FAIdebianMirror") as $val){
376       $smarty->assign($val, $this->$val);
377       $smarty->assign($val."ACL", chkacl($this->acl, $val));
378     }
380     $div = new divSelectBox("WSFAIscriptClasses");
381     
382     $div -> SetHeight("110");
384     $str_up     = " &nbsp;<input type='image' src='images/sort_up.png'    name='sort_up_%s'    value='%s'>";
385     $str_down   = " &nbsp;<input type='image' src='images/sort_down.png'  name='sort_down_%s'  value='%s'>";
386     $str_remove = " &nbsp;<input type='image' src='images/edittrash.png'  name='fai_remove_%s' value='%s'>";
387     $str_empty  = " &nbsp;<img src='images/empty.png'i width='7'>"; 
389     $i = 1;
390     foreach($this->FAIclass as $class){
391       if($i==1){
392         $str = $str_empty.$str_down.$str_remove;
393       }elseif($i == count($this->FAIclass)){
394         $str = $str_up.$str_empty.$str_remove;
395       }else{
396         $str = $str_up.$str_down.$str_remove;
397       }
398       $i ++ ; 
399     
400       $div->AddEntry(array(
401                             array("string"=>$class),
402                             array("string"=>preg_replace("/\%s/",$class,$str),"attach"=>"style='width:50px;border-right:none;'")
403                           ));
404     }  
406     $smarty->assign("FAIScriptlist",$div->DrawList()); 
407     $smarty->assign("FAIdebianMirrors",$this->FAIdebianMirrors);
408     $smarty->assign("FAIclasses",$this->selectFriendlyClasses());
409     $smarty->assign("FAIclassesKeys",array_flip($this->selectFriendlyClasses()));
410     $smarty->assign("FAIclassKeys",$this->FAIclass);
412     /* Radio button group */
413     if (preg_match("/G/", $this->bootmode)) {
414       $smarty->assign("graphicalbootup", "checked");
415     } else {
416       $smarty->assign("graphicalbootup", "");
417     }
418     if (preg_match("/T/", $this->bootmode)) {
419       $smarty->assign("textbootup", "checked");
420     } else {
421       $smarty->assign("textbootup", "");
422     }
423     if (preg_match("/D/", $this->bootmode)) {
424       $smarty->assign("debugbootup", "checked");
425     } else {
426       $smarty->assign("debugbootup", "");
427     }
429     /* ACL's */
430     foreach (array("gotoKernelParameters", "gotoModules", "gotoFilesystem","FAIclass") as $value){
431       $smarty->assign($value."ACL", chkacl($this->acl, "$value"));
432     }
434     /* Show main page */
435     return($smarty->fetch (get_template_path('workstationStartup.tpl', TRUE,dirname(__FILE__))));
436   }
438   function remove_from_parent()
439   {
440     /*
441     $ldap= $this->config->get_ldap_link();
442     $ldap->rmdir($this->dn);
443     show_ldap_error($ldap->get_error());
444     $this->handle_post_events("remove");
445     */
448     /* Depending on the baseobject (Ogroup / WS) we
449      *  use another set of objectClasses
450      * In case of WS itself, we use  "array("GOhard", "FAIobject");"
451      * if we are currently editing from ogroup menu we use (array("gotWorkstationTemplate","GOhard", "FAIobject"))
452      */
453     if(isset($this->parent->by_object['ogroup'])){
454       $this->objectclasses = array("gotoWorkstationTemplate","GOhard", "FAIobject");
455     }elseif(isset($this->parent->by_object['workgeneric'])){
456       $this->objectclasses = array("GOhard", "FAIobject");
457     }else{
458       print "unknown";
459       exit();
460     }
462     $ldap= $this->config->get_ldap_link();
463     plugin::remove_from_parent();
464    
465     /* Remove additional attributes.*/ 
466     foreach(array("gotoModules", "gotoAutoFs", "gotoFilesystem") as $attr){
467       $this->attrs [$attr] = array();
468     }
470     $ldap->cd($this->dn);
471     $ldap->modify($this->attrs);
472     show_ldap_error($ldap->get_error());
474   }
477   /* Save data to object */
478   function save_object()
479   {
480     plugin::save_object();
482     /* Save group radio buttons */
483     if (chkacl ($this->acl, "bootmode") == "" && isset($_POST["bootmode"])){
484       $this->bootmode= $_POST["bootmode"];
485     }
487     /* Save kernel parameters */
488     if (chkacl ($this->acl, "gotoKernelParameters") == "" && isset($_POST["customParameters"])){
489       $this->customParameters= $_POST["customParameters"];
490     }
491   }
494   /* Save to LDAP */
495   function save()
496   {
498     /* Depending on the baseobject (Ogroup / WS) we
499      *  use another set of objectClasses
500      * In case of WS itself, we use  "array("GOhard", "FAIobject");"
501      * if we are currently editing from ogroup menu we use (array("gotWorkstationTemplate","GOhard", "FAIobject"))
502      */
503     if(isset($this->parent->by_object['ogroup'])){
504       $this->objectclasses = array("gotoWorkstationTemplate","GOhard", "FAIobject");
505     }elseif(isset($this->parent->by_object['workgeneric'])){
506       $this->objectclasses = array("GOhard", "FAIobject");
507     }else{
508       print "unknown";
509       exit();
510     }
512     /* Find proper terminal path for tftp configuration
513        FIXME: This is suboptimal when the default has changed to
514        another location! */
515     if ($this->gotoTerminalPath == "default"){
516       $ldap= $this->config->get_ldap_link();
518       /* Strip relevant part from dn, keep trailing ',' */
519       $tmp= preg_replace("/^cn=[^,]+,ou=terminals,ou=systems,/i", "", $this->dn);
520       $tmp= preg_replace("/".$this->config->current['BASE']."$/i", "", $tmp);
522       /* Walk from top to base and try to load default values for
523          'gotoTerminalPath'. Abort when an entry is found. */
524       while (TRUE){
525         $tmp= preg_replace ("/^[^,]+,/", "", $tmp);
527         $ldap->cat("cn=default,ou=terminals,ou=systems,$tmp".
528             $this->config->current['BASE']);
529         $attrs= $ldap->fetch();
530         if (isset($attrs['gotoTerminalPath'])){
531           $this->gotoTerminalPath= $attrs['gotoTerminalPath'][0];
532           break;
533         }
535         /* Nothing left? */
536         if ($tmp == ""){
537           break;
538         }
539       }
540     }
542     /* Add semi automatic values */
543     // FIXME: LDAP Server may not be set here...
544     $this->gotoKernelParameters= "root=/dev/nfs nfsroot=".
545       $this->gotoTerminalPath.
546       ",ro,hard,nolock,fg,rsize=8192 ".
547       "ip=::::::dhcp LDAP=".$this->gotoLdapServer;
549     switch ($this->bootmode){
550       case "D":
551         $this->gotoKernelParameters.= " debug";
552       break;
553       case "G":
554         $this->gotoKernelParameters.= " splash=silent";
555       break;
556     }
557     if ($this->customParameters != ""){
558       $this->gotoKernelParameters.= " o ".$this->customParameters;
559     }
561     plugin::save();
562     
563     $str = "";
564     foreach($this->FAIclass as $class){
565       $str .= $class." ";
566     }
567     $this->attrs['FAIclass']= "";
568     $this->attrs['FAIclass']= trim($str);
570     if(empty($this->attrs['FAIclass'])){
571       $this->attrs['FAIclass'] = array();
572     }
574     /* Add missing arrays */
575     foreach (array("gotoFilesystem", "gotoAutoFs", "gotoModules") as $val){
576       if (isset ($this->$val) && count ($this->$val) != 0){
577     
578         $this->attrs["$val"]= array_unique($this->$val);
579       }
580       if(!isset($this->attrs["$val"])) $this->attrs["$val"]=array();
581     }
582     /* Strip out 'default' values */
583     if ($this->attrs['gotoLdapServer'] == "default"){
584       unset ($this->attrs['gotoLdapServer']);
585     }
587     /* if mirror == none stop saving this attribute */
588     if($this->FAIdebianMirror == "none"){
589       $this->FAIdebianMirror = "";
590     }
591     
592     if((count($this->attrs['FAIclass'])==0)&&(empty($this->FAIdebianMirror))){
593       $tmp = array();
594       foreach($this->attrs['objectClass'] as $class){
595         if($class != "FAIobject"){
596           $tmp[] = $class;
597         }
598       }
599       $this->attrs['objectClass']     = $tmp;
600       $this->attrs['FAIclass']        = array();
601       $this->attrs['FAIdebianMirror'] = array();
602     }
604     /* prepare share settings */
605     $tmp = array();
606     foreach($this->gotoShares as $name => $settings){
607       $tmp2= split("\|",$name);
608       $name = $tmp2[0];
609       $tmp[] = $settings['server']."|".$name."|".$settings['mountPoint'];
610     }
611     $this->attrs['gotoShare']=$tmp;
613     $ldap= $this->config->get_ldap_link();
614     $ldap->cd($this->dn);
615     $ldap->modify($this->attrs);
616     show_ldap_error($ldap->get_error());
617     $this->handle_post_events("modify");
618   }
620   /* Add value to array, check if unique */
621   function add_list (&$array, $value)
622   {
623     if ($value != ""){
624       $array[]= $value;
625       sort($array);
626       array_unique ($array);
627     }
628   }
631   /* Delete value to array, check if unique */
632   function del_list (&$array, $list)
633   {
634     $tmp= array();
635     foreach ($array as $mod){
636       if (!in_array($mod, $list)){
637         $tmp[]= $mod;
638       }
639     }
640     $array= $tmp;
641   }
643   /* Generate ListBox frindly output for the defined shares
644    * Possibly Add or remove an attribute here,
645    */
646   function printOutAssignedShares()
647   {
648     $a_return = array();
649     if(is_array($this->gotoShares)){
650       foreach($this->gotoShares as $share){
651         $a_return[$share['name']."|".$share['server']]= $share['name']." [".$share['server']."]";
652       }
653     }
654     return($a_return);
655   }
659 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
660 ?>