Code

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