Magellan Linux

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

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

revision 7740 by niro, Tue Nov 3 10:58:03 2015 UTC revision 8513 by niro, Mon Feb 8 09:20:06 2016 UTC
# Line 6  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_citrix', 'cfg_sessions_storefront', '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_sessions_rdesktop', 'cfg_modules', 'cfg_other_menuitems', 'cfg_screensaver', 'client_version');
10  $multi= array( 0, 0, 0, 0, 1, 0, 1, 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
# Line 20  $gfxinfo = sqlfirst('SELECT * FROM cfg_g Line 20  $gfxinfo = sqlfirst('SELECT * FROM cfg_g
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 115  if(isset($_POST['do_add'])) Line 116  if(isset($_POST['do_add']))
116   if($what=='COMMENT') sqladd('cfg_comments', array('serial'=>$id));   if($what=='COMMENT') sqladd('cfg_comments', array('serial'=>$id));
117   else if($what=='PRINTER') sqladd('cfg_printers', array('serial'=>$id));   else if($what=='PRINTER') sqladd('cfg_printers', array('serial'=>$id));
118   else if($what=='MODULE') sqladd('cfg_modules', array('serial'=>$id));   else if($what=='MODULE') sqladd('cfg_modules', array('serial'=>$id));
119   else if($what=='SESSION-CITRIX') sqladd('cfg_sessions_citrix', array('domain'=>$citrix_domain_name, 'browseradrs'=>$citrix_browseradrs, 'serial'=>$id));   else if($what=='SESSION-CITRIX') sqladd('cfg_sessions_citrix', array('domain'=>$citrix_domain_name, 'serverlist'=>$citrix_serverlist, 'serial'=>$id));
120   else if($what=='SESSION-STOREFRONT') sqladd('cfg_sessions_storefront', array('domain'=>$storefront_domain_name, 'store'=>$storefront_store, 'serial'=>$id));   else if($what=='SESSION-STOREFRONT') sqladd('cfg_sessions_storefront', array('domain'=>$storefront_domain_name, 'store'=>$storefront_store, 'serial'=>$id));
121     else if($what=='SESSION-RDP') sqladd('cfg_sessions_rdesktop', array('domain'=>$rdesktop_domain_name, 'server'=>$rdesktop_server, 'serial'=>$id));
122   else if($what=='MENUITEM') sqladd('cfg_other_menuitems', array('serial'=>$id));   else if($what=='MENUITEM') sqladd('cfg_other_menuitems', array('serial'=>$id));
123   else if($what=='AUTOSTART') sqladd('cfg_autostart', array('serial'=>$id));   else if($what=='AUTOSTART') sqladd('cfg_autostart', array('serial'=>$id));
124  }  }
# Line 132  if($_POST['do_upl']) Line 134  if($_POST['do_upl'])
134    
135   $arr = array();   $arr = array();
136   foreach($_POST as $k=>$v)   foreach($_POST as $k=>$v)
137     {
138   if((substr($k,0,$prelen)==$prefix) && ($v!='KEEPPASS'))   if((substr($k,0,$prelen)==$prefix) && ($v!='KEEPPASS'))
139   $arr[substr($k,$prelen)] = stripslashes($v);   $arr[substr($k,$prelen)] = stripslashes($v);
140     }
141    
142   return $arr;   return $arr;
143   }   }
# Line 217  function parsearr($name, $arr, $del=fals Line 221  function parsearr($name, $arr, $del=fals
221   $k2 = $k;   $k2 = $k;
222    
223   # tell something about vesa   # tell something about vesa
224   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>';
225    
226   if(is_array($d))   if(is_array($d))
227   {   {
# Line 270  function parsearrs($name, $arr) Line 274  function parsearrs($name, $arr)
274   $.ajax({type:""+typ+"",url:$url[0],data:$url[1],cache:false,success:function(data){ alert(data); }});   $.ajax({type:""+typ+"",url:$url[0],data:$url[1],cache:false,success:function(data){ alert(data); }});
275   }   }
276    
 /* ignore this atm, not always working, sometime open does not work  
  function openclose(nummer, act)  
  {  
  var bild = document.images['sch_bild_'+nummer];  
  var absatz = document.all['sch_absatz_'+nummer].style;  
  var senden = false;  
   
  $("#sch_absatz_"+nummer).toggle(0, function(){  
  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'});}  
  });  
  if(act<=1){ $("#sch_bild_"+nummer).attr({title:'CLOSE',src:'pics/minus.gif'}); }else{ $("#sch_bild_"+nummer).attr({title:'OPEN',src:'pics/plus.gif'}); };  
  }  
 */  
277   function openclose(nummer, act)   function openclose(nummer, act)
278   {   {
279   var bild = document.images['sch_bild_'+nummer];   var bild = document.images['sch_bild_'+nummer];
# Line 379  echo '</td><td valign=top>'; Line 370  echo '</td><td valign=top>';
370   echo '<input class="but" type=submit name="do_add" value="ADD PRINTER" style="width:150px"><br>';   echo '<input class="but" type=submit name="do_add" value="ADD PRINTER" style="width:150px"><br>';
371   echo '<input class="but" type=submit name="do_add" value="ADD SESSION-CITRIX" style="width:150px"><br>';   echo '<input class="but" type=submit name="do_add" value="ADD SESSION-CITRIX" style="width:150px"><br>';
372   echo '<input class="but" type=submit name="do_add" value="ADD SESSION-STOREFRONT" style="width:150px"><br>';   echo '<input class="but" type=submit name="do_add" value="ADD SESSION-STOREFRONT" style="width:150px"><br>';
373     echo '<input class="but" type=submit name="do_add" value="ADD SESSION-RDP" style="width:150px"><br>';
374   echo '<input class="but" type=submit name="do_add" value="ADD MODULE" style="width:150px"><br>';   echo '<input class="but" type=submit name="do_add" value="ADD MODULE" style="width:150px"><br>';
375   echo '<input class="but" type=submit name="do_add" value="ADD MENUITEM" style="width:150px"><br>';   echo '<input class="but" type=submit name="do_add" value="ADD MENUITEM" style="width:150px"><br>';
376   echo '<input class="but" type=submit name="do_add" value="ADD AUTOSTART" style="width:150px"><br>';   echo '<input class="but" type=submit name="do_add" value="ADD AUTOSTART" style="width:150px"><br>';
377   echo '<br>';   echo '<br>';
378    
379   if($id>0) $KILLCAP='DEACTIVATE'; else $KILLCAP='ACTIVATE';   $clientstatus = sqlfirst('SELECT * FROM client_serials WHERE serial='.$id);
380   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>';   if($clientstatus['enabled']>0) $KILLCAP='DEACTIVATE'; else $KILLCAP='ACTIVATE';
381     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>';
382   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>';
383   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>';
384    
# Line 405  echo '</td><td valign=top>'; Line 398  echo '</td><td valign=top>';
398   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>';
399   if($state=='On')   if($state=='On')
400   {   {
401   echo '<u>IP:</u> '.$conn['ip'].'<br><br>';   echo '<u>IP:</u> '.$conn['ip'].'<br>';
402     if($conn['netboot'] == 1) echo '<u>Boot:</u> Netboot (PXE)<br>';
403     else echo '<u>Boot:</u> Local Disk<br>';
404     echo '<br>';
405   echo '<u>OS:</u> '.$alxos.'<br>';   echo '<u>OS:</u> '.$alxos.'<br>';
406   echo '<u>Utils:</u> '.$alxutils.'<br>';   echo '<u>Utils:</u> '.$alxutils.'<br>';
407   }   }
# Line 415  echo '</td><td valign=top>'; Line 411  echo '</td><td valign=top>';
411   if($state=='On')   if($state=='On')
412   {   {
413   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>';
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=shutdown\', \'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>';
  echo 'Hardware Detection:</b></div>';  
  echo '<input class="but" type=button value="LAN" style="width:50px" onclick="javascript:urlopen(\'include/hwinfo.php?ip='.$conn['ip'].'&cmd=lan\',\'POST\');">';  
  echo '<input class="but" type=button value="WLAN" style="width:50px" onclick="javascript:urlopen(\'include/hwinfo.php?ip='.$conn['ip'].'&cmd=wlan\',\'POST\');">';  
  echo '<input class="but" type=button value="VGA" style="width:50px" onclick="javascript:urlopen(\'include/hwinfo.php?ip='.$conn['ip'].'&cmd=vga\',\'POST\');">';  
  echo '<br>';  
  echo '<input class="but" type=button value="PRN" style="width:50px" onclick="javascript:urlopen(\'include/hwinfo.php?ip='.$conn['ip'].'&cmd=printer\',\'POST\');">';  
  echo '<input class="but" type=button value="HRDW" style="width:50px" onclick="javascript:urlopen(\'include/hwinfo.php?ip='.$conn['ip'].'&cmd=system\',\'POST\');">';  
  echo '<input class="but" type=button value="FS" style="width:50px" onclick="javascript:urlopen(\'include/hwinfo.php?ip='.$conn['ip'].'&cmd=rootfs\',\'POST\');">';  
  echo '<br><br>';  
  echo '<div style="border:solid black 1px; padding:5px; background-color:#d5e5ff" align="center"><b>';  
417   echo 'Remote Shadow:</b></div>';   echo 'Remote Shadow:</b></div>';
418   echo '<input class="but" type=button value="VNC" style="width:75px" onclick="window.open(\'vncviewer.php?ip='.$conn['ip'].'\', \'VncViewer\', \'width=200,height=100\')">';   echo '<input class="but" type=button value="VNC" style="width:75px" onclick="window.open(\'vncviewer.php?ip='.$conn['ip'].'\', \'VncViewer\', \'width=200,height=100\')">';
419   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 '<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><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>';  
420   }   }
421   else   else
422   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>';
423    
  echo '<br><center><a href="share/ChangeLog.html" target="_blank">[ChangeLog]</a> <a href="share/FAQ.html" target="_blank">[FAQs]</a></center>';  
   
424  echo '</td></tr></table>';  echo '</td></tr></table>';
425  echo '</form>';  echo '</form>';
426  ?>  ?>

Legend:
Removed from v.7740  
changed lines
  Added in v.8513