Magellan Linux

Diff of /alx-src/trunk/alx-web/show.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 433 by niro, Wed Jun 4 23:28:35 2008 UTC revision 494 by niro, Sun Jun 8 13:49:11 2008 UTC
# Line 1  Line 1 
1  <?  <?
2   // INCLUDE UND TABELLEN-DEFINITIONEN   // INCLUDE UND TABELLEN-DEFINITIONEN
3   include('include/basesql.php');   include('include/basesql.php');
4   $tabs = array('cfg_graphic', 'cfg_network', 'cfg_input', 'client_auth', 'cfg_autostart', 'client_serials', 'cfg_comments', 'cfg_printers', 'cfg_sessions', 'cfg_modules', 'cfg_other_menuitems', 'cfg_screensaver');   $tabs = array('cfg_graphic', 'cfg_network', 'cfg_interfaces', 'cfg_input', 'client_auth', 'cfg_autostart', 'client_serials', 'cfg_comments', 'cfg_printers', 'cfg_sessions', 'cfg_modules', 'cfg_other_menuitems', 'cfg_screensaver');
5   $multi= array(    0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0);   $multi= array(    0, 0,  1,   0, 0, 0, 0,   1,   1,   1,   1, 1,   0);
6   $data = array();   $data = array();
7    
8   if($kill==1)   if($kill==1)
# Line 22  Line 22 
22    
23   // FELD-DEFINITIONEN  (ARRAY=>DROPDOWN / HIDDEN / IGNORE / 1 / BOLD / PASSWORD / SHOW / SHOWTIME / MONITORID)   // FELD-DEFINITIONEN  (ARRAY=>DROPDOWN / HIDDEN / IGNORE / 1 / BOLD / PASSWORD / SHOW / SHOWTIME / MONITORID)
24   $drop = array();   $drop = array();
25   $drop['cfg_graphic_module'] = array('vesa', 'ati', 'cirrus', 'i810', 'i710', 'nv', 'mga', 'r128', 'radeon', 's3', 's3virge', 'sis', 'trident', 'tseng', 'via');   $drop['cfg_graphic_module'] = array('vesa', 'ati', 'cirrus', 'i810', 'i710', 'nv', 'mga', 'r128', 'radeon', 's3', 's3virge', 'sis', 'trident', 'tseng', 'via', 'vmware');
26   $drop['resolution'] = array('640x480', '800x600', '1024x768', '1280x1024','1360x768', '1366x768', '1600x1200');   $drop['resolution'] = array('640x480', '800x600', '1024x768', '1280x1024','1360x768', '1366x768', '1600x1200');
27   $drop['depth'] = array('24', '16', '8');   $drop['depth'] = array('24', '16', '8');
28   $drop['mouse'] = array('Auto', 'IMPS/2', 'PS/2');   $drop['mouse'] = array('Auto', 'IMPS/2', 'PS/2');
29   $drop['cfg_network_module'] = array('3c59x', '8139too', '8139cp', 'e100', 'ne2k-pci', 'pcnet32', 'sis900', 'via-rhine', 'zd1211');   $drop['keyboard'] = array('kbd');
30     //$drop['cfg_network_module'] = array('auto','3c59x', '8139too', '8139cp', 'e100', 'ne2k-pci', 'pcnet32', 'sis900', 'via-rhine', 'zd1211');
31     $drop['module'] = array('auto','3c59x', '8139too', '8139cp', 'e100', 'ne2k-pci', 'pcnet32', 'sis900', 'via-rhine', 'zd1211');
32   $drop['networking'] = array('dhcp', 'static');   $drop['networking'] = array('dhcp', 'static');
33   $drop['port'] = array('lpt1', 'com1', 'com2', 'lpd', 'socket', 'ipp');   $drop['default_iface'] = sqlarr('SELECT iface FROM cfg_interfaces where serial='.$id, '', 'iface');
34     $drop['iface'] = 'show';
35     # only support parallel and seriell printing on tinyalx
36     //$drop['port'] = array('lpt1', 'com1', 'com2', 'lpd', 'socket', 'ipp');
37     $drop['port'] = array('lpt1', 'com1');
38   $drop['location'] = sqlarr('SELECT location FROM client_locations', '', 'location');   $drop['location'] = sqlarr('SELECT location FROM client_locations', '', 'location');
39   $drop['id'] = 'hidden';   $drop['id'] = 'hidden';
40   $drop['flg_modified'] = '1';   $drop['flg_modified'] = '1';
# Line 36  Line 42 
42   $drop['monitorid'] = 'monitorid';   $drop['monitorid'] = 'monitorid';
43   $drop['hostname'] = 'bold';   $drop['hostname'] = 'bold';
44   $drop['session'] = 'bold';   $drop['session'] = 'bold';
45   $drop['cfg_autostart_session'] = 'filename';   $drop['displaymode'] = array('fullscreen', 'seamless', '1280x1024', '1024x768', '800x600');
46     $drop['cfg_autostart_session'] = array('');
47     $drop['cfg_autostart_session'] += sqlarr('SELECT filename FROM cfg_sessions where serial='.$id, 'array', 'filename');
48   $drop['mtime'] = 'showtime';   $drop['mtime'] = 'showtime';
49   $drop['mac'] = 'show';   $drop['mac'] = 'show';
50   $drop['client_serials_serial'] = 'show';   $drop['client_serials_serial'] = 'show';
# Line 56  Line 64 
64   'sierpinski', 'slip', 'solitare', 'space', 'sphere', 'spiral', 'spline', 'star', 'starfish', 'strange',   'sierpinski', 'slip', 'solitare', 'space', 'sphere', 'spiral', 'spline', 'star', 'starfish', 'strange',
65   'swarm', 'swirl', 't3d', 'tetris', 'thornbird', 'tik_tak', 'toneclock', 'triangle', 'tube', 'turtle',   'swarm', 'swirl', 't3d', 'tetris', 'thornbird', 'tik_tak', 'toneclock', 'triangle', 'tube', 'turtle',
66   'vines', 'voters', 'wator', 'wire', 'world', 'worm', 'xcl', 'xjack');   'vines', 'voters', 'wator', 'wire', 'world', 'worm', 'xcl', 'xjack');
67   $drop['iface'] = array('eth0', 'wlan0');  
   
68    
69   // ACHTUNG!!! wlan_-Felder heißen eigentlich wireless_   // ACHTUNG!!! wlan_-Felder heißen eigentlich wireless_
70   $drop['wireless_mode'] = array('', 'managed', 'ad-hoc', 'master', 'repeater', 'secondary', 'monitor', 'auto');   $drop['wireless_mode'] = array('', 'managed', 'ad-hoc', 'master', 'repeater', 'secondary', 'monitor', 'auto');
# Line 99  Line 106 
106    
107   foreach($tabs as $k=>$t)   foreach($tabs as $k=>$t)
108   {   {
109   if(!$multi[$k]) mysql_query('UPDATE '.$t.' SET '.updatestr(postarr($t)).' WHERE serial='.$id);   if(!$multi[$k])
110     {
111     mysql_query('UPDATE '.$t.' SET '.updatestr(postarr($t)).' WHERE serial='.$id);
112     }
113   else   else
114   {   {
115   $i=0;   $i=0;
# Line 171  Line 181 
181    
182   foreach($arr as $k=>$v)   foreach($arr as $k=>$v)
183   {   {
184   if( (substr($k,0,9)=='wireless_') xor $wireless ) Continue;   //if( (substr($k,0,9)=='wireless_') xor $wireless ) Continue;
185    
186   $d = $drop[$name.'_'.$k]; if($d==null) $d = $drop[$k];   $d = $drop[$name.'_'.$k]; if($d==null) $d = $drop[$k];
187   $k = str_replace('wireless_', '', $k);   //$k = str_replace('wireless_', '', $k);
188   $k2 = $k;   $k2 = $k;
189    
190   if(is_array($d))   if(is_array($d))
# Line 200  Line 210 
210   echo '</table>';   echo '</table>';
211   closeabs();   closeabs();
212    
213   if($name=='cfg_network' && !$wireless) parsearr($name.'_wireless', $arr, $del, true);   //if($name=='cfg_network' && !$wireless) parsearr($name.'_wireless', $arr, $del, true);
214   }   }
215   function parsearrs($name, $arr)   function parsearrs($name, $arr)
216   {   {
# Line 345  Line 355 
355   fwrite($hostfile,$conn['ip']." ".$row[0],strlen($row[0])+strlen($conn['ip'])+1);   fwrite($hostfile,$conn['ip']." ".$row[0],strlen($row[0])+strlen($conn['ip'])+1);
356   fclose($hostfile);   fclose($hostfile);
357    
358   $osver = exec($sshcmd.' -l root '.$conn['ip'].' \'os_ver=$(<'$mageversion.');cfg_ver=$(/sbin/magequery -n '.$alxconfig.'|cut -d" " -f5);pname=${cfg_ver%-*-*};cfg_ver=${cfg_ver/${pname}-};echo "${os_ver}:${cfg_ver}"\'');   $osver = exec($sshcmd.' -l root '.$conn['ip'].' \'os_ver=$(<'.$mageversion.');cfg_ver=$(/sbin/magequery -n '.$alxconfig.'|cut -d" " -f5);pname=${cfg_ver%-*-*};cfg_ver=${cfg_ver/${pname}-};echo "${os_ver}:${cfg_ver}"\'');
359   $osver = explode(':',$osver);   $osver = explode(':',$osver);
360   }   }
361   if($osver[0] == '') $osver[0]='unkown';   if($osver[0] == '') $osver[0]='unkown';

Legend:
Removed from v.433  
changed lines
  Added in v.494