..cool, we will make a new module and not just some new module, nope let's make a fully automatic injection script! This tutorial is the first step into making this. Let's first..
Creates a blueprint/map of a server folder
<?php
/* Checks if there are new updates for the hacksuite
Author: Remco Kouw
Site: http://www.hacksuite.com
Last Edit: 19-01-2015
*/
if(!defined('IN_SCRIPT')){
exit;
}
// check if we have updates, unless remote locations is disabled
if($_CONTEXT['allow_remote_locations']){
$_CONTEXT['updateinfo'] = "<i class=\"plholder\">checking for updates</i>";
$sCode .= "<script>\n";
$sCode .= "\$(document).ready(function(){\n";
$sCode .= " dataString = \$('form.formsend').serialize();\n";
$sCode .= " \$.ajax({\n";
$sCode .= " type: \"POST\",\n";
$sCode .= " url: \"updates.php\",\n";
$sCode .= " dataType: \"json\",\n";
$sCode .= " beforesend: function(xhr, textStatus, errorThrown){\n";
$sCode .= " \$('i.plholder').html('polling update server');\n";
$sCode .= " },\n";
$sCode .= " success: function(json){\n";
$sCode .= " if(json.jresult){\n";
$sCode .= " \$('i.plholder').html('new update ready for download');\n";
$sCode .= " }\n";
$sCode .= " else{\n";
$sCode .= " \$('i.plholder').html('no new updates');\n";
$sCode .= " }\n";
$sCode .= " },\n";
$sCode .= " error: function(xhr, textStatus, errorThrown){\n";
$sCode .= " \$('i.plholder').html('failed to poll update server');\n";
$sCode .= " }\n";
$sCode .= " });\n";
$sCode .= "});\n";
$sCode .= "</script>\n";
}
else{
$_CONTEXT['updateinfo'] = "<i class=\"plholder\">remote locations is disabled</i>";
}
?>