--- alx-src/branches/alx-web-070/show.php 2015/09/11 15:15:07 7119 +++ alx-src/branches/alx-web-070/show.php 2016/02/08 09:57:19 8522 @@ -6,8 +6,8 @@ // INCLUDE CURRENT-PROBLEMS include('include/current-problems.php'); -$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', 'cfg_plugins'); -$multi= array( 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1); +$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'); +$multi= array( 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0); $data = array(); // get alx version info for @@ -20,13 +20,14 @@ if($kill==1) { - 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); + else mysql_query('UPDATE client_serials SET enabled="1" WHERE serial='.$id); echo ''; echo '
'; - if($id<0) echo 'ACTIVATED #'.abs($id); - else echo 'DEACTIVATED #'.$id; + if($method=='DEACTIVATE') echo 'DEACTIVATED #'.$id; + else echo 'ACTIVATED #'.$id; echo '
'; return true; @@ -61,12 +62,12 @@ $drop['refresh_rate'] = sqlarr('SELECT value FROM values_graphic_refresh_rate where enabled=1', '', 'value'); $drop['hostname'] = 'bold'; $drop['session'] = 'bold'; -$drop['cfg_autostart_session'] = sqlarr('SELECT filename FROM cfg_sessions where serial='.$id, '', 'filename'); +$drop['cfg_autostart_session'] = sqlarr('SELECT filename FROM cfg_sessions_citrix where serial='.$id, '', 'filename'); array_unshift($drop['cfg_autostart_session'], ""); $drop['mtime'] = 'showtime'; $drop['mac'] = 'show'; $drop['client_serials_serial'] = 'show'; -//$drop['password'] = 'password'; +$drop['password'] = 'password'; //$drop['shell'] = 'password'; $drop['client_auth_user'] = 'password'; $drop['root'] = 'password'; @@ -75,51 +76,51 @@ $drop['station'] = 'password'; $drop['txt'] = 'txt'; $drop['screensaver'] = sqlarr('SELECT value FROM values_screensaver_screensaver where enabled=1', '', 'value'); -$drop['iface'] = array('eth0', 'wlan0'); +//$drop['iface'] = array('eth0', 'wlan0'); $drop['client_version_os'] = 'show'; $drop['client_version_utils'] = 'show'; $drop['hwdetected'] = 'ignore'; -// ACHTUNG!!! wlan_-Felder heißen eigentlich wireless_ -$drop['wireless_mode'] = array('', 'managed', 'ad-hoc', 'master', 'repeater', 'secondary', 'monitor', 'auto'); -$drop['wireless_auth_mode'] = array('', 'wep', 'wpa', 'wpa2', 'off'); -$drop['wireless_key_length'] = array('', '64', '128', '256'); -$drop['wireless_channel'] = array('', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14'); -$drop['wireless_frequency'] = array('', '2.412G', '2.417G', '2.422G', '2.427G', '2.432G', '2.437G', '2.442G', - '2.447G', '2.452G', '2.457G', '2.462G', '2.467G', '2.472G', '2.484G'); +// ACHTUNG!!! wlan_-Felder heißen eigentlich wireless_ +$drop['wireless_mode'] = sqlarr('SELECT value FROM values_network_wireless_mode where enabled=1', '', 'value'); +$drop['wireless_auth_mode'] = sqlarr('SELECT value FROM values_network_wireless_auth_mode where enabled=1', '', 'value'); +$drop['wireless_bitrate'] = sqlarr('SELECT value FROM values_network_wireless_bitrate where enabled=1', '', 'value'); +$drop['wireless_key_length'] = sqlarr('SELECT value FROM values_network_wireless_key_length where enabled=1', '', 'value'); +$drop['wireless_channel'] = sqlarr('SELECT value FROM values_network_wireless_channel where enabled=1', '', 'value'); +$drop['wireless_frequency'] = sqlarr('SELECT value FROM values_network_wireless_frequency where enabled=1', '', 'value'); $drop['wireless_key'] = 'password'; $drop['wireless_key_ascii'] = 'password'; -// plugin support -for ($i=0; $i<999; $i++) { $drop['cfg_plugins_'.$i.'_plugin'] = 'pluginconfig'; } -for ($i=0; $i<999; $i++) -{ - $drop['cfg_plugins_'.$i.'_plugin_array'] = sqlarr('SELECT plugin FROM avail_plugins', '', 'plugin'); - array_unshift($drop['cfg_plugins_'.$i.'_plugin_array'], ""); -} - -// get current citrix sessions -// split all citrix server into an array to get the first server from list -$citrix_query_browser = split(";", $citrix_browseradrs); -exec($wwwroot.'/pnabrowse-wrapper -A '.$citrix_query_browser[0], $returned_citrix_sessions, $retval); -if ($retval == 0) -{ - $citrix_public_applications = str_replace("'", "", $returned_citrix_sessions); - // add an empty value add the first position of the array as session-default - array_unshift($citrix_public_applications, ""); - for ($i=0; $i<999; $i++) { $drop['cfg_sessions_'.$i.'_session'] = $citrix_public_applications; } -} +// get current citrix apps +$citrix_apps = sqlarr('SELECT session FROM values_citrix_session where enabled=1', '', 'session'); +// add an empty value add the first position of the array as session-default +array_unshift($citrix_apps, ""); +// hackish, fix me +for ($i=0; $i<999; $i++) { $drop['cfg_sessions_citrix_'.$i.'_session'] = $citrix_apps; } + +// get current storefront apps +$storefront_apps = sqlarr('SELECT session FROM values_storefront_session where enabled=1', '', 'session'); +// add an empty value add the first position of the array as session-default +array_unshift($storefront_apps, ""); +// hackish, fix me +for ($i=0; $i<999; $i++) { $drop['cfg_sessions_storefront_'.$i.'_session'] = $storefront_apps; } + +$drop['enabled'] = 'ignore'; +$drop['filename'] = 'ignore'; +$drop['autostart'] = array('0','1'); -// GGF. NEUEN DATENSATZ EINFÜGEN +// GGF. NEUEN DATENSATZ EINFÃœGEN if(isset($_POST['do_add'])) { list($bla,$what) = explode(' ',$_POST['do_add']); if($what=='COMMENT') sqladd('cfg_comments', array('serial'=>$id)); else if($what=='PRINTER') sqladd('cfg_printers', array('serial'=>$id)); else if($what=='MODULE') sqladd('cfg_modules', array('serial'=>$id)); - else if($what=='SESSION') sqladd('cfg_sessions', 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)); + else if($what=='SESSION-STOREFRONT') sqladd('cfg_sessions_storefront', array('domain'=>$storefront_domain_name, 'store'=>$storefront_store, 'serial'=>$id)); + else if($what=='SESSION-RDP') sqladd('cfg_sessions_rdesktop', array('domain'=>$rdesktop_domain_name, 'server'=>$rdesktop_server, 'serial'=>$id)); else if($what=='MENUITEM') sqladd('cfg_other_menuitems', array('serial'=>$id)); - else if($what=='PLUGIN') sqladd('cfg_plugins', array('serial'=>$id)); + else if($what=='AUTOSTART') sqladd('cfg_autostart', array('serial'=>$id)); } @@ -133,8 +134,10 @@ $arr = array(); foreach($_POST as $k=>$v) + { if((substr($k,0,$prelen)==$prefix) && ($v!='KEEPPASS')) $arr[substr($k,$prelen)] = stripslashes($v); + } return $arr; } @@ -174,14 +177,14 @@ { global $absnames; $absnames[] = $heading; - + //
- + if( $_SESSION['openclose'][$heading] ) { echo ' ['.$heading.']'; if($helpfile!='') echo ' [?]'; - echo '
'; + echo '
'; } else { @@ -194,12 +197,10 @@ function closeabs() { //
- echo '

'; } - -// ANZEIGEN +// ANZEIGEN function parsearr($name, $arr, $del=false, $wireless=false) { @@ -214,13 +215,13 @@ foreach($arr as $k=>$v) { if( (substr($k,0,9)=='wireless_') xor $wireless ) Continue; - + $d = $drop[$name.'_'.$k]; if($d==null) $d = $drop[$k]; $k = str_replace('wireless_', '', $k); $k2 = $k; # tell something about vesa - if ($v == 'vesa') echo '
Warning: "vesa" graphic module doesn\'t support any resolutions higher than 1024x786x16@60hz!
'; +// if ($v == 'vesa') echo '
Warning: "vesa" graphic module doesn\'t support any resolutions higher than 1024x786x16@60hz!
'; if(is_array($d)) { @@ -231,19 +232,6 @@ else if($d=='hidden') echo ''; else if($d=='1') echo ''; else if($d=='monitorid') echo ''.$k2.'= '; - else if($d=='pluginconfig') - { - $dplugin = $drop[$name.'_'.$k.'_array']; if($dplugin==null) $dplugin = $drop[$k]; - if(is_array($dplugin)) - { - echo ''.$k2.'= '; - } - // $v contains the pluginname, get the configure flag - $pflag = sqlfirst('SELECT configflag FROM avail_plugins WHERE plugin="'.$v.'"'); - if ($pflag[configflag]==1) echo 'configure= '; - } else if($d=='bold') echo ''.$k2.'= '; else if($d=='filename') echo 'filename= '; else if($d=='show') echo ''.$k2.'= '.$v.''; @@ -285,27 +273,13 @@ var $url = url.split("?"); $.ajax({type:""+typ+"",url:$url[0],data:$url[1],cache:false,success:function(data){ alert(data); }}); } - function plugin(name,id) { window.open('plugin.php?plugin='+name+'&id='+id, '', 'width=350,height=180'); } -/* 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'}); }; - } -*/ - function openclose(nummer, act) - { - var bild = document.images['sch_bild_'+nummer]; - var absatz = document.all['sch_absatz_'+nummer].style; - var senden = false; - if(bild.title == 'OPEN') { if(act<=1) @@ -330,7 +304,6 @@ act = 2; } } - if(senden) sendopenclose(nummer,act); } @@ -377,26 +350,35 @@ $state = 'Off'; if(count($conn)>0) { - if($retval==0) $state = 'On'; + if($retval==0) + { + // first try mcore, then get ssh + $ping_retval = ping_host($conn['ip'],$mcore_port,$ping_timeout); + if($ping_retval==1) $ping_retval = ping_host($dat['ip'],$ssh_port,$ping_timeout); + if($ping_retval==0) + { + $state = 'On'; + } + } } echo '

'; echo '

'; - echo '
'; - echo '
'; - echo '
'; - echo '
'; - echo '
'; - if($alxos >= '0.6.0') - { - echo '
'; - } + echo '
'; + echo '
'; + echo '
'; + echo '
'; + echo '
'; + echo '
'; + echo '
'; + echo '
'; echo '
'; - if($id>0) $KILLCAP='DEACTIVATE'; else $KILLCAP='ACTIVATE'; - echo '
'; + $clientstatus = sqlfirst('SELECT * FROM client_serials WHERE serial='.$id); + if($clientstatus['enabled']>0) $KILLCAP='DEACTIVATE'; else $KILLCAP='ACTIVATE'; + echo '
'; echo '
'; echo '

'; @@ -416,7 +398,10 @@ echo 'Status: '.$state.'line
'; if($state=='On') { - echo 'IP: '.$conn['ip'].'

'; + echo 'IP: '.$conn['ip'].'
'; + if($conn['netboot'] == 1) echo 'Boot: Netboot (PXE)
'; + else echo 'Boot: Local Disk
'; + echo '
'; echo 'OS: '.$alxos.'
'; echo 'Utils: '.$alxutils.'
'; } @@ -426,34 +411,16 @@ if($state=='On') { echo '
'; - echo '
'; + echo '
'; echo '
'; echo '
'; - echo 'Hardware Detection:
'; - echo ''; - echo ''; - echo ''; - echo '
'; - echo ''; - echo ''; - echo ''; - echo '

'; - echo '
'; echo 'Remote Shadow:
'; echo ''; echo ''; - echo '

'; - echo '
'; - echo 'Client Update:
'; - echo '
'; - echo '
'; - echo '
'; } else echo '
'; - echo '
[ChangeLog] [FAQs]
'; - echo ''; echo ''; ?>