..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 explain..
xAnalyze is a module that can search through corrupt data and configuration files in order to find the exact position of errors
<?php
/* Create widgets based on data file
Author: Remco Kouw
Site: http://www.hacksuite.com
Last Edit: 14-11-2014
*/
if(!defined('IN_SCRIPT')){
exit;
}
if($_CONTEXT['rightdisplay']['show_widgets']){
$_CONTEXT['htmlo'] .= " <div class=\"subname\" id=\"wdgts\">search widgets</div>\n";
$_CONTEXT['htmlo'] .= " <div class=\"wdgts\">\n";
$_CONTEXT['htmlo'] .= " <div class=\"lnk\">\n";
// widgets
$iActive = 0;
if(isset($_CONTEXT['widgets'])){
foreach($_CONTEXT['widgets'] as $sLabel=>$aValues){
// only display active widgets
if($_CONTEXT['widgets'][$sLabel]['active']==1){
$iActive++;
$_CONTEXT['htmlo'] .= " <div class=\"widgets\">\n";
$_CONTEXT['htmlo'] .= " <form method=\"".$_CONTEXT['widgets'][$sLabel]['form']['method']."\" action=\"".$_CONTEXT['widgets'][$sLabel]['form']['action']."\" target=\"".$_CONTEXT['widgets'][$sLabel]['form']['target']."\">\n";
// construct input fields
for($i=0;$i<count($_CONTEXT['widgets'][$sLabel]['form']['fields']);$i++){
$_CONTEXT['htmlo'] .= " <input size=\"15\" type=\"".$_CONTEXT['widgets'][$sLabel]['form']['fields'][$i]['type']."\"";
// does it have a name?
$_CONTEXT['htmlo'] .= (isset($_CONTEXT['widgets'][$sLabel]['form']['fields'][$i]['name']) ? " name=\"".$_CONTEXT['widgets'][$sLabel]['form']['fields'][$i]['name']."\"" : "");
// does it have a value?
$_CONTEXT['htmlo'] .= (isset($_CONTEXT['widgets'][$sLabel]['form']['fields'][$i]['value']) ? " value=\"".$_CONTEXT['widgets'][$sLabel]['form']['fields'][$i]['value']."\"" : " value=\"\"");
// does it have a title?
$_CONTEXT['htmlo'] .= (isset($_CONTEXT['widgets'][$sLabel]['form']['fields'][$i]['title']) ? " title=\"".$_CONTEXT['widgets'][$sLabel]['form']['fields'][$i]['title']."\"" : "");
// do we have a submisison button image?
$_CONTEXT['htmlo'] .= (isset($_CONTEXT['widgets'][$sLabel]['form']['fields'][$i]['location']) && $_CONTEXT['widgets'][$sLabel]['form']['fields'][$i]['type']=="image" ? " src=\"".$_PATHS['style_root_http']."/images/".$_CONTEXT['widgets'][$sLabel]['form']['fields'][$i]['location']."\" align=\"absmiddle\"" : "");
// if the field is ordinary input field add a new line
$_CONTEXT['htmlo'] .= $_CONTEXT['widgets'][$sLabel]['form']['fields'][$i]['type']=="input" ? " /><br />\n" : " />";
}
$_CONTEXT['htmlo'] .= " </form>\n";
$_CONTEXT['htmlo'] .= " </div>\n";
}
}
if($iActive==0){
$_CONTEXT['htmlo'] .= " <div class=\"lnk\">no active widgets</div>\n";
}
}
$_CONTEXT['htmlo'] .= " </div>\n";
$_CONTEXT['htmlo'] .= " </div>\n";
}
?>