#!/usr/bin/php &1"); $ShellExecResult=shell_exec("cat /tmp/register.html"); if ($ShellExecResult == "Register Successfull." ){ $ShellExecResult=shell_exec("echo $registerCode>/proto/SxM_webui/fpkmgr/registered"); print "Congratulations, You have Registered FeaturePack Manager Successfully."; print "
Back to Main Menu"; } else { print " The Registration code is not correct, please enter the Registration code again."; $ACTION="REGISTER-DISPLAY"; } } if ($ACTION == "REGISTER-DISPLAY") { $ShellExecResult=shell_exec("wget http://highlevelbits.free.fr/download-MBWEW/MybookRegister.html -O /tmp/register.html 2>&1"); $ShellExecResult=shell_exec("cat /tmp/register.html"); print $ShellExecResult; } if ($ACTION == "FP_UNINSTALL_FEATURE") { $folder=$_REQUEST["Feature"]; $ShellExecResult=shell_exec("sh /proto/SxM_webui/fpkmgr/fpks/".$folder."/_uninstall"); print " $folder Feature uninstallation complete."; print "
Back to Main Menu"; } if ($ACTION == "FP_List") { $rgc=""; if (file_exists("/proto/SxM_webui/fpkmgr/registered")) { $rgc=`cat /proto/SxM_webui/fpkmgr/registered`; $rgc=substr($rgc,0, -1); } printHeader(); print "
List of installed Feature Packs :
"; print "
"; $tmp=shell_exec("wget http://highlevelbits.free.fr/download-MBWEW/FP_list -O /proto/SxM_webui/fpkmgr/FP_list >/dev/nul 2>&1"); $handle=opendir("/proto/SxM_webui/fpkmgr/fpks"); while ($folder = readdir($handle)) { if ($folder != "." && $folder != ".." && substr($folder, 0, 1) != "_" ) { if ( is_dir( "/proto/SxM_webui/fpkmgr/fpks/".$folder )) { print ""; if (file_exists( "/proto/SxM_webui/fpkmgr/fpks/".$folder."/_.jpg")) { print ""; } else { print ""; } print ""; if (file_exists( "/proto/SxM_webui/fpkmgr/fpks/".$folder."/_info")) { $version=shell_exec("cat /proto/SxM_webui/fpkmgr/fpks/".$folder."/_info|grep FP_VERSION"); $version= substr($version, 11,-1); } if (file_exists( "/proto/SxM_webui/fpkmgr/FP_list")) { $newitem=shell_exec("cat /proto/SxM_webui/fpkmgr/FP_list|grep $folder"); $newiteminfo= explode(",",$newitem); $descr=$newiteminfo[4]; } print ""; print ""; print "
".$folder."$descr".$version.""; if ( !( $newitem == "" )) { if ( ! ( $version == $newiteminfo[1]) ) { $url=$newiteminfo[2]; $url=str_replace ( "#",$rgc,$url ); print "
"; print ""; print ""; print ""; print ""; print ""; print ""; print "
"; } } if ( file_exists( "/proto/SxM_webui/fpkmgr/fpks/".$folder."/_uninstall")) { print "
"; print ""; print ""; print ""; print "
"; } print "
"; }#isdir } } print "
"; print "
List of Available FeaturePacks :
"; print "
"; $ListAvailable =`cat "/proto/SxM_webui/fpkmgr/FP_list"`; $nl="\n"; $AvailableArray = ""; $AvailableArray = explode($nl, $ListAvailable); sort ($AvailableArray); print ""; foreach ($AvailableArray as $itemavail) { if (strpos ( $itemavail, ",") > 0 ) { $newiteminfo= explode(",",$itemavail); $folder= $newiteminfo[0]; $version= $newiteminfo[1]; $url=$newiteminfo[2]; $img=$newiteminfo[3]; $descr=$newiteminfo[4]; $registeredlink = strpos($url,"#"); $Displayinstall="true"; if ( $registeredlink > 0 ) { if ( ! file_exists( "/proto/SxM_webui/fpkmgr/registered") ) {$Displayinstall="false";} } if ( ! ( file_exists( "/proto/SxM_webui/fpkmgr/fpks/".$folder."/_info" ) ) ) { print ""; print ""; print " " ; print ""; print ""; print ""; } } # if line contain "," } #loop print "
"; print "$folder $descr $version "; if ($Displayinstall == "true" ) { $url=str_replace ( "#",$rgc,$url ); print ""; print ""; print ""; print ""; print ""; print ""; } else {print "Registered version only"; } print "
"; print "
"; } if ($ACTION=="" || $ACTION=="ExecScript") { $ACTIONScriptParams=$_REQUEST["Params"]; $myFile = "/proto/SxM_webui/fpkmgr/fpks/".$ScriptFolder."/".$ScriptName.".vars"; $fh = fopen($myFile, 'w'); foreach ( $_REQUEST as $key => $value ) { $key=str_replace ( "-","",$key ); $value=str_replace ( "\n","",$value ); $value=str_replace ( "(","",$value ); $value=str_replace ( ")","",$value ); $stringData="export GUI_".$key."=".$value."\n"; fwrite($fh, $stringData); } fclose($fh); # $ShellExecResult=shell_exec("sh /proto/SxM_webui/fpkmgr/fpks/".$ScriptFolder."/".$ScriptName.".sh ".$ACTIONScriptParams." 2>&1"); $ShellExecResult=`sh "/proto/SxM_webui/fpkmgr/fpks/$ScriptFolder/$ScriptName.sh" "$ACTIONScriptParams" 2>&1`; printHeader(); print "
"; print "
"; $handle=opendir("/proto/SxM_webui/fpkmgr/fpks"); while ($folder = readdir($handle)) { if ($folder != "." && $folder != ".." && substr($folder, 0, 1) != "_" ) { if ( is_dir( "/proto/SxM_webui/fpkmgr/fpks/".$folder )) { print ""; if (file_exists( "/proto/SxM_webui/fpkmgr/fpks/".$folder."/_.jpg")) { print ""; } else { print ""; } print ""; print "
".$folder."
"; $cmd="cd /proto/SxM_webui/fpkmgr/fpks/".$folder.";find -name '*.sh' 2>&1" ; $FindScripts = shell_exec($cmd); $nl="\n"; $Scriptsunsorted = explode($nl,$FindScripts); sort ($Scriptsunsorted); print ""; foreach ($Scriptsunsorted as $Script) { $Scriptname=substr($Script, 2,-3); print ""; $ScriptDescr=""; if (file_exists( "/proto/SxM_webui/fpkmgr/fpks/".$folder."/$Scriptname.descr")) { $ScriptDescr=shell_exec( 'cat /proto/SxM_webui/fpkmgr/fpks/".$folder."/$Scriptname.descr'); } if (file_exists( "/proto/SxM_webui/fpkmgr/fpks/".$folder."/$Scriptname.jpg")) { print ""; } else { print ""; } print ""; } #end foreach }#is_dir }# . and .. check }#while closedir($handle); print "
"; print "$Scriptname
"; print "
"; print "
"; } if ($ACTION == "ExecScript") { $nl="\n"; $ResultArray = explode("\n",$ShellExecResult); print ""; foreach ($ResultArray as $ResultLine) { print ""; } print "
".$ResultLine."
"; } print "
"; print ""; } function PrintHeader() { $MainHeaderHTML=`cat "/proto/SxM_webui/fpkmgr/HTML/Header_Features.html"` ; print $MainHeaderHTML; print " "; print ""; print ""; } ?>