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 9474 by niro, Thu Apr 6 13:58:42 2017 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_fluxbox_autostart', 'client_serials', 'cfg_comments', 'cfg_printers', 'cfg_sessions_citrix', 'cfg_sessions_storefront', 'cfg_sessions_rdesktop', 'cfg_modules', 'cfg_fluxbox_menuitem', '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, 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);   if($method=='DEACTIVATE') mysql_query('UPDATE client_serials SET enabled="0" WHERE serial='.$id);
24     else mysql_query('UPDATE client_serials SET enabled="1" WHERE serial='.$id);
25    
26   echo '<body onload="window.setTimeout(\'window.close()\', 1750)">';   echo '<body onload="window.setTimeout(\'window.close()\', 1750)">';
27   echo '<table width=100% height=100% style="border:solid black 1px; background-color:#d5e5ff"><tr><td valign=middle align=center>';   echo '<table width=100% height=100% style="border:solid black 1px; background-color:#d5e5ff"><tr><td valign=middle align=center>';
28    
29   if($id<0) echo 'ACTIVATED #'.abs($id);   if($method=='DEACTIVATE') echo 'DEACTIVATED #'.$id;
30   else echo 'DEACTIVATED #'.$id;   else echo 'ACTIVATED #'.$id;
31    
32   echo '</td></tr></table>';   echo '</td></tr></table>';
33   return true;   return true;
# Line 33  if($kill==1) Line 35  if($kill==1)
35    
36  // FELD-DEFINITIONEN  (ARRAY=>DROPDOWN / HIDDEN / IGNORE / 1 / BOLD / PASSWORD / SHOW / SHOWTIME / MONITORID)  // FELD-DEFINITIONEN  (ARRAY=>DROPDOWN / HIDDEN / IGNORE / 1 / BOLD / PASSWORD / SHOW / SHOWTIME / MONITORID)
37  $drop = array();  $drop = array();
38  if($alxos >= '0.5.3')  $drop['cfg_graphic_module'] = sqlarr('SELECT value FROM values_graphic_module where enabled=1', '', 'value');
39    if($gfxinfo['module'] == 'intel')
40  {  {
41   $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');
42  }  }
43  else  else
44  {  {
45   $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';
46  }  }
47  $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');
48  $drop['depth'] = array('24', '16', '8');  $drop['depth'] = sqlarr('SELECT value FROM values_graphic_depth where enabled=1', '', 'value');
49  $drop['mouse'] = array('Auto', 'IMPS/2', 'PS/2');  //$drop['mouse'] = array('Auto', 'IMPS/2', 'PS/2');
50  $drop['keyboard'] = array('PC105');  //$drop['keyboard'] = array('PC105');
51  $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');
52    $drop['cfg_network_module'] = sqlarr('SELECT value FROM values_network_module where enabled=1', '', 'value');
53  $drop['networking'] = array('dhcp', 'static');  $drop['networking'] = array('dhcp', 'static');
54  $drop['port'] = array('lpt1', 'usb1', 'usb2', 'com1', 'com2', 'lpd', 'socket', 'ipp');  $drop['port'] = sqlarr('SELECT value FROM values_printers_port where enabled=1', '', 'value');
55  $drop['location'] = sqlarr('SELECT location FROM client_locations', '', 'location');  //for ($i=0; $i<999; $i++) { $drop['cfg_printers_'.$i.'_ip'] = 'ignore'; }
56    $drop['share'] = 'ignore';
57    $drop['location'] = sqlarr('SELECT location FROM client_locations where enabled=1', '', 'location');
58  $drop['id'] = 'hidden';  $drop['id'] = 'hidden';
59  $drop['flg_modified'] = '1';  $drop['flg_modified'] = '1';
60  $drop['serial'] = 'ignore';  $drop['serial'] = 'ignore';
61  if($alxos>='0.5.3')  $drop['monitorid'] = 'ignore';
62  {  $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';  
 }  
63  $drop['hostname'] = 'bold';  $drop['hostname'] = 'bold';
64  $drop['session'] = 'bold';  $drop['session'] = 'bold';
 $drop['cfg_autostart_session'] = 'filename';  
65  $drop['mtime'] = 'showtime';  $drop['mtime'] = 'showtime';
66  $drop['mac'] = 'show';  $drop['mac'] = 'show';
67  $drop['client_serials_serial'] = 'show';  $drop['client_serials_serial'] = 'show';
68  $drop['password'] = 'password';  $drop['password'] = 'password';
69  $drop['shell'] = 'password';  //$drop['shell'] = 'password';
70    $drop['client_auth_user'] = 'password';
71    $drop['root'] = 'password';
72  $drop['vnc'] = 'password';  $drop['vnc'] = 'password';
73  $drop['samba'] = 'password';  $drop['samba'] = 'password';
74  $drop['station'] = 'password';  $drop['station'] = 'password';
75  $drop['txt'] = 'txt';  $drop['txt'] = 'txt';
76  $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');
77   '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');  
78  $drop['client_version_os'] = 'show';  $drop['client_version_os'] = 'show';
79  $drop['client_version_utils'] = 'show';  $drop['client_version_utils'] = 'show';
80    $drop['hwdetected'] = 'ignore';
81    
82  // ACHTUNG!!! wlan_-Felder heißen eigentlich wireless_  // ACHTUNG!!! wlan_-Felder heißen eigentlich wireless_
83  $drop['wireless_mode'] = array('', 'managed', 'ad-hoc', 'master', 'repeater', 'secondary', 'monitor', 'auto');  $drop['wireless_mode'] = sqlarr('SELECT value FROM values_network_wireless_mode where enabled=1', '', 'value');
84  $drop['wireless_auth_mode'] = array('', 'wep', 'wpa', 'wpa2', 'off');  $drop['wireless_auth_mode'] = sqlarr('SELECT value FROM values_network_wireless_auth_mode where enabled=1', '', 'value');
85  $drop['wireless_key_length'] = array('', '64', '128', '256');  $drop['wireless_bitrate'] = sqlarr('SELECT value FROM values_network_wireless_bitrate where enabled=1', '', 'value');
86  $drop['wireless_channel'] = array('', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14');  $drop['wireless_key_length'] = sqlarr('SELECT value FROM values_network_wireless_key_length where enabled=1', '', 'value');
87  $drop['wireless_frequency'] = array('', '2.412G', '2.417G', '2.422G', '2.427G', '2.432G', '2.437G', '2.442G',  $drop['wireless_channel'] = sqlarr('SELECT value FROM values_network_wireless_channel where enabled=1', '', 'value');
88   '2.447G', '2.452G', '2.457G', '2.462G', '2.467G', '2.472G', '2.484G');  $drop['wireless_frequency'] = sqlarr('SELECT value FROM values_network_wireless_frequency where enabled=1', '', 'value');
89  $drop['wireless_key'] = 'password';  $drop['wireless_key'] = 'password';
90  $drop['wireless_key_ascii'] = 'password';  $drop['wireless_key_ascii'] = 'password';
91    
92  // GGF. NEUEN DATENSATZ EINFÜGEN  // get current citrix apps
93    $citrix_apps = sqlarr('SELECT session FROM values_citrix_session where enabled=1', '', 'session');
94    // add an empty value add the first position of the array as session-default
95    array_unshift($citrix_apps, "");
96    // hackish, fix me
97    for ($i=0; $i<999; $i++) { $drop['cfg_sessions_citrix_'.$i.'_session'] = $citrix_apps; }
98    
99    // get current storefront apps
100    $storefront_apps = sqlarr('SELECT session FROM values_storefront_session where enabled=1', '', 'session');
101    // add an empty value add the first position of the array as session-default
102    array_unshift($storefront_apps, "");
103    // hackish, fix me
104    for ($i=0; $i<999; $i++) { $drop['cfg_sessions_storefront_'.$i.'_session'] = $storefront_apps; }
105    
106    $drop['enabled'] = 'ignore';
107    $drop['filename'] = 'ignore';
108    $drop['autostart'] = array('0','1');
109    
110    // GGF. NEUEN DATENSATZ EINFÃœGEN
111  if(isset($_POST['do_add']))  if(isset($_POST['do_add']))
112  {  {
113   list($bla,$what) = explode(' ',$_POST['do_add']);   list($bla,$what) = explode(' ',$_POST['do_add']);
114   if($what=='COMMENT') sqladd('cfg_comments', array('serial'=>$id));   if($what=='COMMENT') sqladd('cfg_comments', array('serial'=>$id));
115   else if($what=='PRINTER') sqladd('cfg_printers', array('serial'=>$id));   else if($what=='PRINTER') sqladd('cfg_printers', array('serial'=>$id));
116   else if($what=='MODULE') sqladd('cfg_modules', array('serial'=>$id));   else if($what=='MODULE') sqladd('cfg_modules', array('serial'=>$id));
117   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, 'serverlist'=>$citrix_serverlist, 'serial'=>$id));
118   else if($what=='MENUITEM') sqladd('cfg_other_menuitems', array('serial'=>$id));   else if($what=='SESSION-STOREFRONT') sqladd('cfg_sessions_storefront', array('domain'=>$storefront_domain_name, 'store'=>$storefront_store, 'serial'=>$id));
119     else if($what=='SESSION-RDP') sqladd('cfg_sessions_rdesktop', array('domain'=>$rdesktop_domain_name, 'server'=>$rdesktop_server, 'serial'=>$id));
120     else if($what=='MENUITEM') sqladd('cfg_fluxbox_menuitem', array('serial'=>$id));
121     else if($what=='AUTOSTART') sqladd('cfg_fluxbox_autostart', array('serial'=>$id));
122  }  }
123    
124    
# Line 120  if($_POST['do_upl']) Line 132  if($_POST['do_upl'])
132    
133   $arr = array();   $arr = array();
134   foreach($_POST as $k=>$v)   foreach($_POST as $k=>$v)
135     {
136   if((substr($k,0,$prelen)==$prefix) && ($v!='KEEPPASS'))   if((substr($k,0,$prelen)==$prefix) && ($v!='KEEPPASS'))
137   $arr[substr($k,$prelen)] = stripslashes($v);   $arr[substr($k,$prelen)] = stripslashes($v);
138     }
139    
140   return $arr;   return $arr;
141   }   }
# Line 142  if($_POST['do_upl']) Line 156  if($_POST['do_upl'])
156   }   }
157   }   }
158   }   }
 }  
159    
160     // reload site
161     header("location: show.php?id=".$id);
162    }
163    
164  // EINLESEN DER DATEN AUS SQL-TABELLEN  // EINLESEN DER DATEN AUS SQL-TABELLEN
165  foreach($tabs as $k=>$t)  foreach($tabs as $k=>$t)
# Line 159  function openabs($heading, $helpfile='') Line 175  function openabs($heading, $helpfile='')
175  {  {
176   global $absnames;   global $absnames;
177   $absnames[] = $heading;   $absnames[] = $heading;
178    
179   // <AufZuLink> <Bild/> <Heading/> </AufZuLink><BR/> <Absatz>   // <AufZuLink> <Bild/> <Heading/> </AufZuLink><BR/> <Absatz>
180    
181   if( $_SESSION['openclose'][$heading] )   if( $_SESSION['openclose'][$heading] )
182   {   {
183   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>';
184   if($helpfile!='') echo ' <a href="JavaScript:showhelp(\''.$helpfile.'\')" title="HELP">[?]</a>';   if($helpfile!='') echo ' <a href="JavaScript:showhelp(\''.$helpfile.'\')" title="HELP">[?]</a>';
185   echo '<br><div id="sch_absatz_'.$heading.'" style="top:0px; visibility:visible">';   echo '<br><div id="sch_absatz_'.$heading.'" style="top:0px; visibility:visible">';
186   }   }
187   else   else
188   {   {
# Line 179  function openabs($heading, $helpfile='') Line 195  function openabs($heading, $helpfile='')
195  function closeabs()  function closeabs()
196  {  {
197   // </Absatz> <BR/>   // </Absatz> <BR/>
   
198   echo '</div><br>';   echo '</div><br>';
199  }  }
200    
201    // ANZEIGEN
 // ANZEIGEN  
202    
203  function parsearr($name, $arr, $del=false, $wireless=false)  function parsearr($name, $arr, $del=false, $wireless=false)
204  {  {
# Line 199  function parsearr($name, $arr, $del=fals Line 213  function parsearr($name, $arr, $del=fals
213   foreach($arr as $k=>$v)   foreach($arr as $k=>$v)
214   {   {
215   if( (substr($k,0,9)=='wireless_') xor $wireless ) Continue;   if( (substr($k,0,9)=='wireless_') xor $wireless ) Continue;
216    
217   $d = $drop[$name.'_'.$k]; if($d==null) $d = $drop[$k];   $d = $drop[$name.'_'.$k]; if($d==null) $d = $drop[$k];
218   $k = str_replace('wireless_', '', $k);   $k = str_replace('wireless_', '', $k);
219   $k2 = $k;   $k2 = $k;
220    
  //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';  
  }  
  }  
   
221   # tell something about vesa   # tell something about vesa
222   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>';
   
223    
224   if(is_array($d))   if(is_array($d))
225   {   {
# Line 244  function parsearr($name, $arr, $del=fals Line 236  function parsearr($name, $arr, $del=fals
236   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>';
237   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>';
238   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>';
239   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>';
240   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>';
241   }   }
242    
# Line 254  function parsearr($name, $arr, $del=fals Line 246  function parsearr($name, $arr, $del=fals
246    
247   if($name=='cfg_network' && !$wireless) parsearr($name.'_wireless', $arr, $del, true);   if($name=='cfg_network' && !$wireless) parsearr($name.'_wireless', $arr, $del, true);
248  }  }
249    
250  function parsearrs($name, $arr)  function parsearrs($name, $arr)
251  {  {
252   foreach($arr as $k=>$a)   foreach($arr as $k=>$a)
# Line 269  function parsearrs($name, $arr) Line 262  function parsearrs($name, $arr)
262   .keytab, input, textarea, select, option { font-size:8pt; font-family:Tahoma }   .keytab, input, textarea, select, option { font-size:8pt; font-family:Tahoma }
263   .but { font-size:10pt; font-family:Tahoma; height:23px }   .but { font-size:10pt; font-family:Tahoma; height:23px }
264  </style>  </style>
265    <script type="text/javascript" src="js/jquery-1.2.6.min.js"></script>
266  <script language="JavaScript" src="openclose_ajax.js"></script>  <script language="JavaScript" src="openclose_ajax.js"></script>
267  <script language="JavaScript">  <script language="JavaScript">
268    
269     // opens an url and shows retval in a javascript-alert on current site
270     function urlopen(url,typ) {
271     var $url = url.split("?");
272     $.ajax({type:""+typ+"",url:$url[0],data:$url[1],cache:false,success:function(data){ alert(data); }});
273     }
274    
275   function openclose(nummer, act)   function openclose(nummer, act)
276   {   {
277   var bild = document.images['sch_bild_'+nummer];   var bild = document.images['sch_bild_'+nummer];
278   var absatz = document.all['sch_absatz_'+nummer].style;   var absatz = document.all['sch_absatz_'+nummer].style;
279   var senden = false;   var senden = false;
# Line 302  function parsearrs($name, $arr) Line 302  function parsearrs($name, $arr)
302   act = 2;   act = 2;
303   }   }
304   }   }
   
305   if(senden) sendopenclose(nummer,act);   if(senden) sendopenclose(nummer,act);
306   }   }
307    
308   function showhelp(name)   function showhelp(name)
309   { 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 313  function parsearrs($name, $arr)
313    
314  <body><?  <body><?
315    
316  //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?\')">';  
317  echo '<input type=hidden name="do_upl" value="1">';  echo '<input type=hidden name="do_upl" value="1">';
318  echo '<input type=hidden name="id" value="'.$id.'">';  echo '<input type=hidden name="id" value="'.$id.'">';
319    
# Line 350  echo '</td><td valign=top>'; Line 348  echo '</td><td valign=top>';
348   $state = 'Off';   $state = 'Off';
349   if(count($conn)>0)   if(count($conn)>0)
350   {   {
351  // passthru($pingcmd." ".$conn['ip']." &> /dev/null && exit 0 || exit 1",$retval);   if($retval==0)
352   if($retval==0) $state = 'On';   {
353     $ping_retval = ping_host($conn['ip'],$mcore_port,$ping_timeout);
354     if($ping_retval==0)
355     {
356     $state = 'On';
357     }
358     }
359   }   }
360    
   
361   echo '<img src="pics/logo2.jpg"><br><br>';   echo '<img src="pics/logo2.jpg"><br><br>';
362    
363   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>';
364    
365   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>';
366   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>';
367   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>';
368   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>';
369   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 SESSION-RDP" style="width:150px"><br>';
370     echo '<input class="but" type=submit name="do_add" value="ADD MODULE" style="width:150px"><br>';
371     echo '<input class="but" type=submit name="do_add" value="ADD MENUITEM" style="width:150px"><br>';
372   if($id>0) $KILLCAP='DEACTIVATE'; else $KILLCAP='ACTIVATE';   echo '<input class="but" type=submit name="do_add" value="ADD AUTOSTART" style="width:150px"><br>';
373   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 '<br>';
374    
375     $clientstatus = sqlfirst('SELECT * FROM client_serials WHERE serial='.$id);
376     if($clientstatus['enabled']>0) $KILLCAP='DEACTIVATE'; else $KILLCAP='ACTIVATE';
377     echo '<input class="but" type=button value="'.$KILLCAP.'" style="width:150px" onclick="if(confirm(\''.$KILLCAP.' CLIENT #'.$id.' ?\')) { window.open(\'show.php?id='.$id.'&kill=1&method='.$KILLCAP.'\', \'DeactWin\', \'width=200,height=100\'); location.href=\'index.php\'; }"><br>';
378   echo '<input class="but" type=button value="IMPORT FROM..." style="width:150px" onclick="location.href=\'import.php?id='.$id.'\'"><br>';   echo '<input class="but" type=button value="IMPORT FROM..." style="width:150px" onclick="location.href=\'import.php?id='.$id.'\'"><br>';
379   echo '<input class="but" type=reset value="UNDO CHANGES" style="width:150px"><br><br>';   echo '<input class="but" type=reset value="UNDO CHANGES" style="width:150px"><br><br>';
380    
# Line 379  echo '</td><td valign=top>'; Line 386  echo '</td><td valign=top>';
386   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).'\'">';
387   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>';
388    
389   echo '<br><br>';   echo '<br>';
390   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>';
391   if($id<0) echo '<b>DEACTIVATED!</b><br><br>';   if($id<0) echo '<b>DEACTIVATED!</b><br><br>';
392   echo '<u>Serial:</u>&nbsp;&nbsp;#'.$id.'<br>';   echo '<u>Serial:</u>&nbsp;&nbsp;#'.$id.'<br>';
# Line 387  echo '</td><td valign=top>'; Line 394  echo '</td><td valign=top>';
394   echo '<u>Status:</u> <img src="pics/'.strtolower($state).'line.gif" align=top> '.$state.'line<br>';   echo '<u>Status:</u> <img src="pics/'.strtolower($state).'line.gif" align=top> '.$state.'line<br>';
395   if($state=='On')   if($state=='On')
396   {   {
397   echo '<u>IP:</u> '.$conn['ip'].'<br><br>';   echo '<u>IP:</u> '.$conn['ip'].'<br>';
398   $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']);   if($conn['netboot'] == 1) echo '<u>Boot:</u> Netboot (PXE)<br>';
399   $osver = explode(':',$osver[1]);   else echo '<u>Boot:</u> Local Disk<br>';
400   if($osver[0] == '') $osver[0]='unkown';   echo '<br>';
401   if($osver[1] == '') $osver[1]='unkown';   echo '<u>OS:</u> '.$alxos.'<br>';
402     echo '<u>Utils:</u> '.$alxutils.'<br>';
  # 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  
  }  
403   }   }
404    
405   echo '</b></div>';   echo '</b></div>';
  //echo '<br><br>';  
406    
407   if($state=='On')   if($state=='On')
408   {   {
409   echo '<input class="but" type=button value="REBOOT" style="width:150px" onclick="if(confirm(\'REBOOT CLIENT #'.$id.' ?\')) window.open(\'reboot.php?client='.$id.'&ip='.$conn['ip'].'&op=reboot\', \'ShutdownWin\', \'width=200,height=100\')"><br>';   echo '<input class="but" type=button value="REBOOT" style="width:150px" onclick="if(confirm(\'REBOOT CLIENT #'.$id.' ?\')) window.open(\'reboot.php?client='.$id.'&ip='.$conn['ip'].'&op=reboot\', \'ShutdownWin\', \'width=200,height=100\')"><br>';
410   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=shutdown\', \'ShutdownWin\', \'width=200,height=100\')"><br>';
411   echo '<br>';   echo '<br>';
412   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>';
413   echo 'Remote Shadow:</b></div>';   echo 'Remote Shadow:</b></div>';
414   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="VNC" style="width:75px" onclick="window.open(\'vncviewer.php?ip='.$conn['ip'].'\', \'VncViewer\', \'width=200,height=100\')">';
415   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="SSH" style="width:75px" onclick="window.open(\'mindterm.php?ip='.$conn['ip'].'\', \'MindTerm\', \'width=200,height=100\')">';
  echo '<br>';  
  echo '<div style="border:solid black 1px; padding:5px; background-color:#d5e5ff" align="center"><b>';  
  echo 'Client Update:</b></div>';  
  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="CALC DEPS" style="width:150px" onclick="if(confirm(\'CALC DEPS FOR CLIENT #'.$id.' ?\')) window.open(\'mageupgrade.php?client='.$id.'&ip='.$conn['ip'].'&op=calc\', \'ShutdownWin\', \'width=800,height=600\')"><br>';  
  echo '<input class="but" type=button value="UPGRADE CLIENT" style="width:150px" onclick="if(confirm(\'UPGRADE ALL PACKAGES ON CLIENT #'.$id.' ?\')) window.open(\'mageupgrade.php?client='.$id.'&ip='.$conn['ip'].'&op=upgrade\', \'ShutdownWin\', \'width=800,height=600\');setTimeout(\'window.location.reload()\',0);"><br>';  
416   }   }
417   else   else
418   echo '<input class="but" type=button value="WAKE ON LAN" style="width:150px" onclick="if(confirm(\'WAKE CLIENT #'.$id.' ?\')) window.open(\'wake_on_lan.php?mac='.$data['client_serials']['mac'].'\', \'WakeWin\', \'width=200,height=100\')"><br>';   echo '<input class="but" type=button value="WAKE ON LAN" style="width:150px" onclick="if(confirm(\'WAKE CLIENT #'.$id.' ?\')) window.open(\'wake_on_lan.php?mac='.$data['client_serials']['mac'].'\', \'WakeWin\', \'width=200,height=100\')"><br>';
419    
420   echo '<br><center><a href="share/ChangeLog.html" target="_blank">[ChangeLog]</a> <a href="share/FAQ.html" target="_blank">[FAQs]</a></center>';   // print version info
421     $version = file_get_contents('./VERSION', FILE_USE_INCLUDE_PATH);
422     echo '<br><br><font size="1">v'.$version.'</font>';
423    
424  echo '</td></tr></table>';  echo '</td></tr></table>';
425  echo '</form>';  echo '</form>';

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