Magellan Linux

Diff of /alx-src/branches/alx-web-070/show.php

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

alx-src/branches/alx-web-060/show.php revision 2444 by niro, Mon Jun 27 11:47:42 2011 UTC alx-src/branches/alx-web-070/show.php revision 7140 by niro, Tue Sep 15 08:33:39 2015 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  include('include/common-functions.php');  include('include/common-functions.php');
# Line 7  include('include/common-functions.php'); Line 6  include('include/common-functions.php');
6  // INCLUDE CURRENT-PROBLEMS  // INCLUDE CURRENT-PROBLEMS
7  include('include/current-problems.php');  include('include/current-problems.php');
8    
9  $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', 'client_version');  $tabs = array('cfg_graphic', 'cfg_network', 'cfg_input', 'client_auth', 'cfg_autostart', 'client_serials', 'cfg_comments', 'cfg_printers', 'cfg_sessions_citrix', 'cfg_sessions_storefront', 'cfg_modules', 'cfg_other_menuitems', 'cfg_screensaver', 'client_version');
10  $multi= array(    0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0);  $multi= array( 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0);
11  $data = array();  $data = array();
12    
   
13  // get alx version info for  // get alx version info for
14  $alxinfo = sqlfirst('SELECT * FROM client_version WHERE serial='.$id);  $alxinfo = sqlfirst('SELECT * FROM client_version WHERE serial='.$id);
15  $alxos = $alxinfo[os];  $alxos = $alxinfo[os];
16  $alxutils = $alxinfo[utils];  $alxutils = $alxinfo[utils];
17    
18    // get gfxdriver
19    $gfxinfo = sqlfirst('SELECT * FROM cfg_graphic WHERE serial='.$id);
20    
21  if($kill==1)  if($kill==1)
22  {  {
23   foreach($tabs as $t) mysql_query('UPDATE '.$t.' SET serial=-serial WHERE serial='.$id);   foreach($tabs as $t) mysql_query('UPDATE '.$t.' SET serial=-serial WHERE serial='.$id);
# Line 33  if($kill==1) Line 34  if($kill==1)
34    
35  // FELD-DEFINITIONEN  (ARRAY=>DROPDOWN / HIDDEN / IGNORE / 1 / BOLD / PASSWORD / SHOW / SHOWTIME / MONITORID)  // FELD-DEFINITIONEN  (ARRAY=>DROPDOWN / HIDDEN / IGNORE / 1 / BOLD / PASSWORD / SHOW / SHOWTIME / MONITORID)
36  $drop = array();  $drop = array();
37  if($alxos >= '0.5.3')  $drop['cfg_graphic_module'] = sqlarr('SELECT value FROM values_graphic_module where enabled=1', '', 'value');
38    if($gfxinfo[module] == 'intel')
39  {  {
40   $drop['cfg_graphic_module'] = array('vesa', 'ati', 'cirrus', 'i710', 'intel', 'nv', 'mach64', 'mga', 'openchrome', 'radeon', 's3', 's3virge', 'savage', 'sis', 'trident', 'tseng');   $drop['cfg_graphic_hdmi'] = array('disable', 'enable');
41  }  }
42  else  else
43  {  {
44   $drop['cfg_graphic_module'] = array('vesa', 'ati', 'cirrus', 'i810', 'i710', 'nv', 'mga', 'r128', 'radeon', 's3', 's3virge', 'savage', 'sis', 'trident', 'tseng', 'via');   $drop['cfg_graphic_hdmi'] = 'ignore';
45  }  }
46  $drop['resolution'] = array('640x480', '800x600', '1024x768', '1280x960', '1280x1024', '1360x768', '1366x768', '1400x1050', '1440x900', '1600x1200', '1680x1050', '1280x720', '1920x1080');  $drop['resolution'] = sqlarr('SELECT value FROM values_graphic_resolution where enabled=1', '', 'value');
47  $drop['depth'] = array('24', '16', '8');  $drop['depth'] = sqlarr('SELECT value FROM values_graphic_depth where enabled=1', '', 'value');
48  $drop['mouse'] = array('Auto', 'IMPS/2', 'PS/2');  //$drop['mouse'] = array('Auto', 'IMPS/2', 'PS/2');
49  $drop['keyboard'] = array('PC105');  //$drop['keyboard'] = array('PC105');
50  $drop['cfg_network_module'] = array('3c59x', '8139too', '8139cp', 'e100', 'ne2k-pci', 'pcnet32', 'sis900', 'via-rhine', 'zd1211', 'b44', 'bnx2', 'dl2k', 'e1000', 'forcedeth', 'r8169', 'sk98lin', 'tg3', 'via-velocity');  $drop['keymap'] = sqlarr('SELECT value FROM values_input_keymap where enabled=1', '', 'value');
51    $drop['cfg_network_module'] = sqlarr('SELECT value FROM values_network_module where enabled=1', '', 'value');
52  $drop['networking'] = array('dhcp', 'static');  $drop['networking'] = array('dhcp', 'static');
53  $drop['port'] = array('lpt1', 'usb1', 'usb2', 'com1', 'com2', 'lpd', 'socket', 'ipp');  $drop['port'] = sqlarr('SELECT value FROM values_printers_port where enabled=1', '', 'value');
54  $drop['location'] = sqlarr('SELECT location FROM client_locations', '', 'location');  //for ($i=0; $i<999; $i++) { $drop['cfg_printers_'.$i.'_ip'] = 'ignore'; }
55    $drop['share'] = 'ignore';
56    $drop['location'] = sqlarr('SELECT location FROM client_locations where enabled=1', '', 'location');
57  $drop['id'] = 'hidden';  $drop['id'] = 'hidden';
58  $drop['flg_modified'] = '1';  $drop['flg_modified'] = '1';
59  $drop['serial'] = 'ignore';  $drop['serial'] = 'ignore';
60  if($alxos>='0.5.3')  $drop['monitorid'] = 'ignore';
61  {  $drop['refresh_rate'] = sqlarr('SELECT value FROM values_graphic_refresh_rate where enabled=1', '', 'value');
  $drop['monitorid'] = 'ignore';  
  $drop['refresh_rate'] = array('','60','75','85','100');  
 }  
 else  
 {  
  $drop['monitorid'] = 'monitorid';  
  $drop['refresh_rate'] = 'ignore';  
 }  
62  $drop['hostname'] = 'bold';  $drop['hostname'] = 'bold';
63  $drop['session'] = 'bold';  $drop['session'] = 'bold';
64  $drop['cfg_autostart_session'] = 'filename';  $drop['cfg_autostart_session'] = sqlarr('SELECT filename FROM cfg_sessions_citrix where serial='.$id, '', 'filename');
65    array_unshift($drop['cfg_autostart_session'], "");
66  $drop['mtime'] = 'showtime';  $drop['mtime'] = 'showtime';
67  $drop['mac'] = 'show';  $drop['mac'] = 'show';
68  $drop['client_serials_serial'] = 'show';  $drop['client_serials_serial'] = 'show';
69  $drop['password'] = 'password';  //$drop['password'] = 'password';
70  $drop['shell'] = 'password';  //$drop['shell'] = 'password';
71    $drop['client_auth_user'] = 'password';
72    $drop['root'] = 'password';
73  $drop['vnc'] = 'password';  $drop['vnc'] = 'password';
74  $drop['samba'] = 'password';  $drop['samba'] = 'password';
75  $drop['station'] = 'password';  $drop['station'] = 'password';
76  $drop['txt'] = 'txt';  $drop['txt'] = 'txt';
77  $drop['screensaver'] = array('','blank', 'random', 'ant', 'ant3d', 'apollonian', 'ball', 'bat', 'blot', 'bomb', 'bouboule',  $drop['screensaver'] = sqlarr('SELECT value FROM values_screensaver_screensaver where enabled=1', '', 'value');
78   'bounce', 'braid', 'bubble', 'bug', 'clock', 'coral', 'crystal', 'daisy', 'dclock', 'decay', 'deco',  //$drop['iface'] = array('eth0', 'wlan0');
  'demon', 'dilemma', 'discrete', 'dragon', 'drift', 'euler2d', 'eyes', 'fadeplot', 'fiberlamp', 'flag',  
  'flame', 'flow', 'forest', 'galaxy', 'goop', 'grav', 'helix', 'hop', 'hyper', 'ico', 'ifs', 'image',  
  'juggle', 'julia', 'kaleid', 'kumppa', 'laser', 'life', 'life1d', 'life3d', 'lightning', 'lisa', 'lissie',  
  'loop', 'lyapunov', 'mandelbrot', 'marquee', 'matrix', 'maze', 'mountain', 'munch', 'nose', 'pacman',  
  'penrose', 'petal', 'petri', 'polyominoes', 'puzzle',  'pyro', 'qix', 'roll',  'rotor', 'scooter', 'shape',  
  'sierpinski', 'slip', 'solitare', 'space', 'sphere', 'spiral', 'spline', 'star', 'starfish', 'strange',  
  'swarm', 'swirl', 't3d', 'tetris', 'thornbird', 'tik_tak', 'toneclock', 'triangle', 'tube', 'turtle',  
  'vines', 'voters', 'wator', 'wire', 'world', 'worm', 'xcl', 'xjack');  
 $drop['iface'] = array('eth0', 'wlan0');  
79  $drop['client_version_os'] = 'show';  $drop['client_version_os'] = 'show';
80  $drop['client_version_utils'] = 'show';  $drop['client_version_utils'] = 'show';
81    $drop['hwdetected'] = 'ignore';
82    
83  // ACHTUNG!!! wlan_-Felder heißen eigentlich wireless_  // ACHTUNG!!! wlan_-Felder heißen eigentlich wireless_
84  $drop['wireless_mode'] = array('', 'managed', 'ad-hoc', 'master', 'repeater', 'secondary', 'monitor', 'auto');  $drop['wireless_mode'] = array('', 'managed', 'ad-hoc', 'master', 'repeater', 'secondary', 'monitor', 'auto');
85  $drop['wireless_auth_mode'] = array('', 'wep', 'wpa', 'wpa2', 'off');  $drop['wireless_auth_mode'] = array('', 'wep', 'wpa', 'wpa2', 'off');
86  $drop['wireless_key_length'] = array('', '64', '128', '256');  $drop['wireless_key_length'] = array('', '64', '128', '256');
# Line 98  $drop['wireless_frequency'] = array('', Line 90  $drop['wireless_frequency'] = array('',
90  $drop['wireless_key'] = 'password';  $drop['wireless_key'] = 'password';
91  $drop['wireless_key_ascii'] = 'password';  $drop['wireless_key_ascii'] = 'password';
92    
93  // GGF. NEUEN DATENSATZ EINFÜGEN  // get current citrix apps
94    $citrix_apps = sqlarr('SELECT session FROM values_citrix_session where enabled=1', '', 'session');
95    // add an empty value add the first position of the array as session-default
96    array_unshift($citrix_apps, "");
97    // hackish, fix me
98    for ($i=0; $i<999; $i++) { $drop['cfg_sessions_citrix_'.$i.'_session'] = $citrix_apps; }
99    
100    // get current storefront apps
101    $storefront_apps = sqlarr('SELECT session FROM values_storefront_session where enabled=1', '', 'session');
102    // add an empty value add the first position of the array as session-default
103    array_unshift($storefront_apps, "");
104    // hackish, fix me
105    for ($i=0; $i<999; $i++) { $drop['cfg_sessions_storefront_'.$i.'_session'] = $storefront_apps; }
106    
107    // GGF. NEUEN DATENSATZ EINFÃœGEN
108  if(isset($_POST['do_add']))  if(isset($_POST['do_add']))
109  {  {
110   list($bla,$what) = explode(' ',$_POST['do_add']);   list($bla,$what) = explode(' ',$_POST['do_add']);
111   if($what=='COMMENT') sqladd('cfg_comments', array('serial'=>$id));   if($what=='COMMENT') sqladd('cfg_comments', array('serial'=>$id));
112   else if($what=='PRINTER') sqladd('cfg_printers', array('serial'=>$id));   else if($what=='PRINTER') sqladd('cfg_printers', array('serial'=>$id));
113   else if($what=='MODULE') sqladd('cfg_modules', array('serial'=>$id));   else if($what=='MODULE') sqladd('cfg_modules', array('serial'=>$id));
114   else if($what=='SESSION') sqladd('cfg_sessions', array('domain'=>'DOM_AKA_NT', 'browseradrs'=>'128.20.50.50;128.20.50.66;128.20.50.71;128.20.50.46;128.20.100.31;128.20.100.32', 'serial'=>$id));   else if($what=='SESSION-CITRIX') sqladd('cfg_sessions_citrix', array('domain'=>$citrix_domain_name, 'browseradrs'=>$citrix_browseradrs, 'serial'=>$id));
115     else if($what=='SESSION-STOREFRONT') sqladd('cfg_sessions_storefront', array('domain'=>$storefront_domain_name, 'store'=>$storefront_store, 'serial'=>$id));
116   else if($what=='MENUITEM') sqladd('cfg_other_menuitems', array('serial'=>$id));   else if($what=='MENUITEM') sqladd('cfg_other_menuitems', array('serial'=>$id));
117     else if($what=='AUTOSTART') sqladd('cfg_autostart', array('serial'=>$id));
118  }  }
119    
120    
# Line 142  if($_POST['do_upl']) Line 150  if($_POST['do_upl'])
150   }   }
151   }   }
152   }   }
 }  
153    
154     // reload site
155     header("location: show.php?id=".$id);
156    }
157    
158  // EINLESEN DER DATEN AUS SQL-TABELLEN  // EINLESEN DER DATEN AUS SQL-TABELLEN
159  foreach($tabs as $k=>$t)  foreach($tabs as $k=>$t)
# Line 159  function openabs($heading, $helpfile='') Line 169  function openabs($heading, $helpfile='')
169  {  {
170   global $absnames;   global $absnames;
171   $absnames[] = $heading;   $absnames[] = $heading;
172    
173   // <AufZuLink> <Bild/> <Heading/> </AufZuLink><BR/> <Absatz>   // <AufZuLink> <Bild/> <Heading/> </AufZuLink><BR/> <Absatz>
174    
175   if( $_SESSION['openclose'][$heading] )   if( $_SESSION['openclose'][$heading] )
176   {   {
177   echo '<a href="JavaScript:openclose(\''.$heading.'\',1);"><img border="0" src="pics/minus.gif" title="CLOSE" id="sch_bild_'.$heading.'"> <b>['.$heading.']</b></a>';   echo '<a href="JavaScript:openclose(\''.$heading.'\',1);"><img border="0" src="pics/minus.gif" title="CLOSE" id="sch_bild_'.$heading.'"> <b>['.$heading.']</b></a>';
178   if($helpfile!='') echo ' <a href="JavaScript:showhelp(\''.$helpfile.'\')" title="HELP">[?]</a>';   if($helpfile!='') echo ' <a href="JavaScript:showhelp(\''.$helpfile.'\')" title="HELP">[?]</a>';
179   echo '<br><div id="sch_absatz_'.$heading.'" style="top:0px; visibility:visible">';   echo '<br><div id="sch_absatz_'.$heading.'" style="top:0px; visibility:visible">';
180   }   }
181   else   else
182   {   {
# Line 179  function openabs($heading, $helpfile='') Line 189  function openabs($heading, $helpfile='')
189  function closeabs()  function closeabs()
190  {  {
191   // </Absatz> <BR/>   // </Absatz> <BR/>
   
192   echo '</div><br>';   echo '</div><br>';
193  }  }
194    
195    // ANZEIGEN
 // ANZEIGEN  
196    
197  function parsearr($name, $arr, $del=false, $wireless=false)  function parsearr($name, $arr, $del=false, $wireless=false)
198  {  {
# Line 199  function parsearr($name, $arr, $del=fals Line 207  function parsearr($name, $arr, $del=fals
207   foreach($arr as $k=>$v)   foreach($arr as $k=>$v)
208   {   {
209   if( (substr($k,0,9)=='wireless_') xor $wireless ) Continue;   if( (substr($k,0,9)=='wireless_') xor $wireless ) Continue;
210    
211   $d = $drop[$name.'_'.$k]; if($d==null) $d = $drop[$k];   $d = $drop[$name.'_'.$k]; if($d==null) $d = $drop[$k];
212   $k = str_replace('wireless_', '', $k);   $k = str_replace('wireless_', '', $k);
213   $k2 = $k;   $k2 = $k;
214    
  //replace some drivers on 0.5.3 or higher  
  if($alxos >= '0.5.3')  
  {  
  if($v == 'i810')  
  {  
  echo '<br><font color="#FF0000">Replaced "i810" with "intel" - Please press SAVE!</font><br>';  
  $v='intel';  
  }  
  if($v == 'r128')  
  {  
  echo '<br><font color="#FF0000">Replaced "r128" with "vesa" - Please press SAVE!</font><br>';  
  $v='vesa';  
  }  
   
  if($v == 'via')  
  {  
  echo '<br><font color="#FF0000">Replaced "via" with "openchrome" - Please press SAVE!</font><br>';  
  $v='openchrome';  
  }  
  }  
   
215   # tell something about vesa   # tell something about vesa
216   if ($v == 'vesa') echo '<br><font color="#FF0000">Warning: "vesa" graphic module doesn\'t support any resolutions higher than 1024x786x16@60hz!</font><br>';   if ($v == 'vesa') echo '<br><font color="#FF0000">Warning: "vesa" graphic module doesn\'t support any resolutions higher than 1024x786x16@60hz!</font><br>';
217    
   
218   if(is_array($d))   if(is_array($d))
219   {   {
220   echo '<tr><td class="key">'.$k2.'</td><td>= <select style="width:144px" name="'.$name.'_'.$k.'">';   echo '<tr><td class="key">'.$k2.'</td><td>= <select style="width:144px" name="'.$name.'_'.$k.'">';
# Line 244  function parsearr($name, $arr, $del=fals Line 230  function parsearr($name, $arr, $del=fals
230   else if($d=='showtime') echo '<tr><td class="key">'.$k2.'</td><td>= <b>'.date('d.m.y - H:i:s', $v).'</b></td></tr>';   else if($d=='showtime') echo '<tr><td class="key">'.$k2.'</td><td>= <b>'.date('d.m.y - H:i:s', $v).'</b></td></tr>';
231   else if($d=='password' && $v=='') echo '<tr><td class="key">'.$k2.'</td><td>= <input type=password style="width:144px" name="'.$name.'_'.$k.'" value=""></td></tr>';   else if($d=='password' && $v=='') echo '<tr><td class="key">'.$k2.'</td><td>= <input type=password style="width:144px" name="'.$name.'_'.$k.'" value=""></td></tr>';
232   else if($d=='password') echo '<tr><td class="key">'.$k2.'</td><td>= <input type=password style="width:144px" name="'.$name.'_'.$k.'" value="KEEPPASS"></td></tr>';   else if($d=='password') echo '<tr><td class="key">'.$k2.'</td><td>= <input type=password style="width:144px" name="'.$name.'_'.$k.'" value="KEEPPASS"></td></tr>';
233   else if($d=='txt') echo '<tr><td colspan=2><textarea style="width:240px; background-color:#d5e5ff" rows=4 name="'.$name.'_'.$k.'">'.$v.'</textarea></td></tr>';   else if($d=='txt') echo '<tr><td colspan=2><textarea style="width:240px; background-color:#d5e5ff" rows=6 name="'.$name.'_'.$k.'">'.$v.'</textarea></td></tr>';
234   else if($d!='ignore') echo '<tr><td class="key">'.$k2.'</td><td>= <input style="width:144px" name="'.$name.'_'.$k.'" value="'.$v.'"></td></tr>';   else if($d!='ignore') echo '<tr><td class="key">'.$k2.'</td><td>= <input style="width:144px" name="'.$name.'_'.$k.'" value="'.$v.'"></td></tr>';
235   }   }
236    
# Line 254  function parsearr($name, $arr, $del=fals Line 240  function parsearr($name, $arr, $del=fals
240    
241   if($name=='cfg_network' && !$wireless) parsearr($name.'_wireless', $arr, $del, true);   if($name=='cfg_network' && !$wireless) parsearr($name.'_wireless', $arr, $del, true);
242  }  }
243    
244  function parsearrs($name, $arr)  function parsearrs($name, $arr)
245  {  {
246   foreach($arr as $k=>$a)   foreach($arr as $k=>$a)
# Line 269  function parsearrs($name, $arr) Line 256  function parsearrs($name, $arr)
256   .keytab, input, textarea, select, option { font-size:8pt; font-family:Tahoma }   .keytab, input, textarea, select, option { font-size:8pt; font-family:Tahoma }
257   .but { font-size:10pt; font-family:Tahoma; height:23px }   .but { font-size:10pt; font-family:Tahoma; height:23px }
258  </style>  </style>
259    <script type="text/javascript" src="js/jquery-1.2.6.min.js"></script>
260  <script language="JavaScript" src="openclose_ajax.js"></script>  <script language="JavaScript" src="openclose_ajax.js"></script>
261  <script language="JavaScript">  <script language="JavaScript">
262    
263     // opens an url and shows retval in a javascript-alert on current site
264     function urlopen(url,typ) {
265     var $url = url.split("?");
266     $.ajax({type:""+typ+"",url:$url[0],data:$url[1],cache:false,success:function(data){ alert(data); }});
267     }
268    
269    /* ignore this atm, not always working, sometime open does not work
270     function openclose(nummer, act)
271     {
272     var bild = document.images['sch_bild_'+nummer];
273     var absatz = document.all['sch_absatz_'+nummer].style;
274     var senden = false;
275    
276     $("#sch_absatz_"+nummer).toggle(0, function(){
277     if($(this).css("display")=="none"){$("#sch_bild_"+nummer).attr({title:'OPEN',src:'pics/plus.gif'});}else{$("#sch_bild_"+nummer).attr({title:'CLOSE',src:'pics/minus.gif'});}
278     });
279     if(act<=1){ $("#sch_bild_"+nummer).attr({title:'CLOSE',src:'pics/minus.gif'}); }else{ $("#sch_bild_"+nummer).attr({title:'OPEN',src:'pics/plus.gif'}); };
280     }
281    */
282   function openclose(nummer, act)   function openclose(nummer, act)
283   {   {
284   var bild = document.images['sch_bild_'+nummer];   var bild = document.images['sch_bild_'+nummer];
285   var absatz = document.all['sch_absatz_'+nummer].style;   var absatz = document.all['sch_absatz_'+nummer].style;
286   var senden = false;   var senden = false;
# Line 302  function parsearrs($name, $arr) Line 309  function parsearrs($name, $arr)
309   act = 2;   act = 2;
310   }   }
311   }   }
   
312   if(senden) sendopenclose(nummer,act);   if(senden) sendopenclose(nummer,act);
313   }   }
314    
315   function showhelp(name)   function showhelp(name)
316   { window.open(name, 'HelpWin', 'width=620,height=500,scrollbars=yes'); }   { window.open(name, 'HelpWin', 'width=620,height=500,scrollbars=yes'); }
# Line 314  function parsearrs($name, $arr) Line 320  function parsearrs($name, $arr)
320    
321  <body><?  <body><?
322    
323  //echo '<body style="background-image:URL(logo.jpg);background-repeat:no-repeat; background-position:0px 0px; margin-top:25px">';  echo '<form action="show.php" method="post" onreset="return confirm(\'UNDO CHANGES?\')">';
 echo '<form action="show.php" method=post onreset="return confirm(\'UNDO CHANGES?\')">';  
324  echo '<input type=hidden name="do_upl" value="1">';  echo '<input type=hidden name="do_upl" value="1">';
325  echo '<input type=hidden name="id" value="'.$id.'">';  echo '<input type=hidden name="id" value="'.$id.'">';
326    
# Line 350  echo '</td><td valign=top>'; Line 355  echo '</td><td valign=top>';
355   $state = 'Off';   $state = 'Off';
356   if(count($conn)>0)   if(count($conn)>0)
357   {   {
358  // passthru($pingcmd." ".$conn['ip']." &> /dev/null && exit 0 || exit 1",$retval);   if($retval==0)
359   if($retval==0) $state = 'On';   {
360     // first try mcore, then get ssh
361     $ping_retval = ping_host($conn['ip'],$mcore_port,$ping_timeout);
362     if($ping_retval==1) $ping_retval = ping_host($dat['ip'],$ssh_port,$ping_timeout);
363     if($ping_retval==0)
364     {
365     $state = 'On';
366     }
367     }
368   }   }
369    
   
370   echo '<img src="pics/logo2.jpg"><br><br>';   echo '<img src="pics/logo2.jpg"><br><br>';
371    
372   echo '<input class="but" type=submit value="SAVE" style="width:150px"><br><br>';   echo '<input class="but" type=submit value="SAVE" style="width:150px"><br><br>';
373    
374   echo '<input class="but" type=submit name="do_add" value="SAVE+ADD COMMENT" style="width:150px"><br>';   echo '<input class="but" type=submit name="do_add" value="ADD COMMENT" style="width:150px"><br>';
375   echo '<input class="but" type=submit name="do_add" value="SAVE+ADD PRINTER" style="width:150px"><br>';   echo '<input class="but" type=submit name="do_add" value="ADD PRINTER" style="width:150px"><br>';
376   echo '<input class="but" type=submit name="do_add" value="SAVE+ADD SESSION" style="width:150px"><br>';   echo '<input class="but" type=submit name="do_add" value="ADD SESSION-CITRIX" style="width:150px"><br>';
377   echo '<input class="but" type=submit name="do_add" value="SAVE+ADD MODULE" style="width:150px"><br>';   echo '<input class="but" type=submit name="do_add" value="ADD SESSION-STOREFRONT" style="width:150px"><br>';
378   echo '<input class="but" type=submit name="do_add" value="SAVE+ADD MENUITEM" style="width:150px"><br><br>';   echo '<input class="but" type=submit name="do_add" value="ADD MODULE" style="width:150px"><br>';
379     echo '<input class="but" type=submit name="do_add" value="ADD MENUITEM" style="width:150px"><br>';
380     echo '<input class="but" type=submit name="do_add" value="ADD AUTOSTART" style="width:150px"><br>';
381     echo '<br>';
382    
383   if($id>0) $KILLCAP='DEACTIVATE'; else $KILLCAP='ACTIVATE';   if($id>0) $KILLCAP='DEACTIVATE'; else $KILLCAP='ACTIVATE';
384   echo '<input class="but" type=button value="'.$KILLCAP.'" style="width:150px" onclick="if(confirm(\''.$KILLCAP.' CLIENT #'.abs($id).' ?\')) { window.open(\'show.php?id='.$id.'&kill=1\', \'DeactWin\', \'width=200,height=100\'); location.href=\'index.php\'; }"><br>';   echo '<input class="but" type=button value="'.$KILLCAP.'" style="width:150px" onclick="if(confirm(\''.$KILLCAP.' CLIENT #'.abs($id).' ?\')) { window.open(\'show.php?id='.$id.'&kill=1\', \'DeactWin\', \'width=200,height=100\'); location.href=\'index.php\'; }"><br>';
# Line 379  echo '</td><td valign=top>'; Line 393  echo '</td><td valign=top>';
393   echo '<input class="but" type=button '.$disdanach.' value=">" style="width:30px" onclick="location.href=\'show.php?id='.($id+1).'\'">';   echo '<input class="but" type=button '.$disdanach.' value=">" style="width:30px" onclick="location.href=\'show.php?id='.($id+1).'\'">';
394   echo '<br><input class="but" type=button value="INDEX" style="width:150px; font-weight:bold" onclick="location.href=\'index.php\'"><br><br>';   echo '<br><input class="but" type=button value="INDEX" style="width:150px; font-weight:bold" onclick="location.href=\'index.php\'"><br><br>';
395    
396   echo '<br><br>';   echo '<br>';
397   echo '<div style="border:solid black 1px; padding:5px; background-color:#d5e5ff"><b>';   echo '<div style="border:solid black 1px; padding:5px; background-color:#d5e5ff"><b>';
398   if($id<0) echo '<b>DEACTIVATED!</b><br><br>';   if($id<0) echo '<b>DEACTIVATED!</b><br><br>';
399   echo '<u>Serial:</u>&nbsp;&nbsp;#'.$id.'<br>';   echo '<u>Serial:</u>&nbsp;&nbsp;#'.$id.'<br>';
# Line 388  echo '</td><td valign=top>'; Line 402  echo '</td><td valign=top>';
402   if($state=='On')   if($state=='On')
403   {   {
404   echo '<u>IP:</u> '.$conn['ip'].'<br><br>';   echo '<u>IP:</u> '.$conn['ip'].'<br><br>';
405   $osver = sshdo('os_ver=$(</etc/mageversion);cfg_ver=$(/sbin/magequery -n alxconfig-ng | cut -d" " -f5);pname=${cfg_ver%-*-*};cfg_ver=${cfg_ver/${pname}-};echo "${os_ver}:${cfg_ver}"', $conn['ip']);   echo '<u>OS:</u> '.$alxos.'<br>';
406   $osver = explode(':',$osver[1]);   echo '<u>Utils:</u> '.$alxutils.'<br>';
  if($osver[0] == '') $osver[0]='unkown';  
  if($osver[1] == '') $osver[1]='unkown';  
   
  # update os string in database  
  if($alxos == '' && $osver[0] >= '0.5.3')  
  {  
  mysql_query('insert into client_version(serial,os,utils) values("'.$id.'","'.$osver[0].'","'.$osver[1].'")  
  on duplicate key update os="'.$osver[0].'", utils="'.$osver[1].'"');  
  # reload the site  
  echo '<script type="text/javascript">setTimeout(\'window.location.reload()\',0);</script>';  
  }  
   
  echo '<u>OS:</u> '.$osver[0].'<br>';  
  echo '<u>Utils:</u> '.$osver[1].'<br>';  
   
  if($osver[0] <> 'unkown')  
  {  
  //write them to database  
  }  
407   }   }
408    
409   echo '</b></div>';   echo '</b></div>';
  //echo '<br><br>';  
410    
411   if($state=='On')   if($state=='On')
412   {   {
# Line 420  echo '</td><td valign=top>'; Line 414  echo '</td><td valign=top>';
414   echo '<input class="but" type=button value="SHUTDOWN" style="width:150px" onclick="if(confirm(\'SHUTDOWN CLIENT #'.$id.' ?\')) window.open(\'reboot.php?client='.$id.'&ip='.$conn['ip'].'&op=halt\', \'ShutdownWin\', \'width=200,height=100\')"><br>';   echo '<input class="but" type=button value="SHUTDOWN" style="width:150px" onclick="if(confirm(\'SHUTDOWN CLIENT #'.$id.' ?\')) window.open(\'reboot.php?client='.$id.'&ip='.$conn['ip'].'&op=halt\', \'ShutdownWin\', \'width=200,height=100\')"><br>';
415   echo '<br>';   echo '<br>';
416   echo '<div style="border:solid black 1px; padding:5px; background-color:#d5e5ff" align="center"><b>';   echo '<div style="border:solid black 1px; padding:5px; background-color:#d5e5ff" align="center"><b>';
417   echo 'Remote Shadow:</b></div>';   echo 'Hardware Detection:</b></div>';
418   echo '<input class="but" type=button value="VNC" style="width:150px" onclick="window.open(\'vncviewer.php?ip='.$conn['ip'].'\', \'VncViewer\', \'width=200,height=100\')"><br>';   echo '<input class="but" type=button value="LAN" style="width:50px" onclick="javascript:urlopen(\'include/hwinfo.php?ip='.$conn['ip'].'&cmd=lan\',\'POST\');">';
419   echo '<input class="but" type=button value="SSH" style="width:150px" onclick="window.open(\'mindterm.php?ip='.$conn['ip'].'\', \'MindTerm\', \'width=200,height=100\')"><br>';   echo '<input class="but" type=button value="WLAN" style="width:50px" onclick="javascript:urlopen(\'include/hwinfo.php?ip='.$conn['ip'].'&cmd=wlan\',\'POST\');">';
420     echo '<input class="but" type=button value="VGA" style="width:50px" onclick="javascript:urlopen(\'include/hwinfo.php?ip='.$conn['ip'].'&cmd=vga\',\'POST\');">';
421   echo '<br>';   echo '<br>';
422     echo '<input class="but" type=button value="PRN" style="width:50px" onclick="javascript:urlopen(\'include/hwinfo.php?ip='.$conn['ip'].'&cmd=printer\',\'POST\');">';
423     echo '<input class="but" type=button value="HRDW" style="width:50px" onclick="javascript:urlopen(\'include/hwinfo.php?ip='.$conn['ip'].'&cmd=system\',\'POST\');">';
424     echo '<input class="but" type=button value="FS" style="width:50px" onclick="javascript:urlopen(\'include/hwinfo.php?ip='.$conn['ip'].'&cmd=rootfs\',\'POST\');">';
425     echo '<br><br>';
426     echo '<div style="border:solid black 1px; padding:5px; background-color:#d5e5ff" align="center"><b>';
427     echo 'Remote Shadow:</b></div>';
428     echo '<input class="but" type=button value="VNC" style="width:75px" onclick="window.open(\'vncviewer.php?ip='.$conn['ip'].'\', \'VncViewer\', \'width=200,height=100\')">';
429     echo '<input class="but" type=button value="SSH" style="width:75px" onclick="window.open(\'mindterm.php?ip='.$conn['ip'].'\', \'MindTerm\', \'width=200,height=100\')">';
430     echo '<br><br>';
431   echo '<div style="border:solid black 1px; padding:5px; background-color:#d5e5ff" align="center"><b>';   echo '<div style="border:solid black 1px; padding:5px; background-color:#d5e5ff" align="center"><b>';
432   echo 'Client Update:</b></div>';   echo 'Client Update:</b></div>';
433   echo '<input class="but" type=button value="UPDATE MAGE DB" style="width:150px" onclick="if(confirm(\'UPDATE DB ON CLIENT #'.$id.' ?\')) window.open(\'mageupgrade.php?client='.$id.'&ip='.$conn['ip'].'&op=update\', \'ShutdownWin\', \'width=800,height=600\')"><br>';   echo '<input class="but" type=button value="UPDATE MAGE DB" style="width:150px" onclick="if(confirm(\'UPDATE DB ON CLIENT #'.$id.' ?\')) window.open(\'mageupgrade.php?client='.$id.'&ip='.$conn['ip'].'&op=update\', \'ShutdownWin\', \'width=800,height=600\')"><br>';

Legend:
Removed from v.2444  
changed lines
  Added in v.7140