..a different index page for the suite. It's very easy because the only thing you need to do is change the content of default.php. I don't want to create something like hello world or..
xAnalyze is a module that can search through corrupt data and configuration files in order to find the exact position of errors
<?php
/* Handler for task management
Author: Remco Kouw
Site: http://www.hacksuite.com
Last Edit: 12-11-2014
*/
session_cache_limiter('nocache');
header('Expires: '.gmdate('r',0));
header('Content-type: application/json');
$_DYNAMIC_ROOT = "..";
include_once("../header.php");
$aDataR = array();
$aDataR['jresult'] = false;
$aActions = array("clearall","runningtasks","completedtasks","alltasks","remove","complete");
$sDataFile = "../Data/running.txt";
if(!function_exists("RawToArray")){
$sDest = "../Functions/raw_to_array.php";
include_once($sDest);
}
if(false!==($aRow = RawToArray($sDataFile))){
$iRow = count($aRow);
}
else{
/* empty task file */
$aDataR['jerror'] = "No data in task file";
die(json_encode($aDataR));
}
if(@in_array($_POST['sAction'],$aActions)){
if(!function_exists("WriteF")){
$sDest = "../Functions/fwrite.php";
include_once($sDest);
}
if(isset($_POST['sAction']) && isset($_POST['sID'])){
/* change a single task */
$sData = "";
$sID = trim($_POST['sID']);
for($x=0;$x<$iRow;$x++){
if(trim($aRow[$x][3])==$sID){
if($_POST['sAction']=="remove"){
continue;
}
else{
$sData .= $aRow[$x][0]."|".$aRow[$x][1]."|".time()."|".substr(md5($aRow[$x][0]."|".$aRow[$x][1]),0,10)."\n";
}
}
else{
$sData .= @implode("|",$aRow[$x]);
}
}
// write file
$aDataR['jresult'] = (!WriteF($sDataFile,$sData,"w") ? false : true);
if($aDataR['jresult']){
$aDataR['jmessage'] = "Successfully updated task file";
$aDataR['jline'] = $sID;
$aDataR['jaction'] = ($_POST['sAction']=="remove" ? "remove" : "complete");
if($iRow==1 && $aDataR['jaction']=="remove"){
$aDataR['jempty'] = 1;
}
}
else{
$aDataR['jerror'] = "Failed to update task file";
}
}
elseif(isset($_POST['sAction'])){
/* do an action to the task file */
if($_POST['sAction']=="clearall"){
// clean task file
$aDataR['jresult'] = (!WriteF($sDataFile,"","w") ? false : true);
}
else{
/* can only clear all */
$aDataR['jerror'] = "Action doesn't exist";
}
}
}
else{
/* invalid action */
$aDataR['jerror'] = "Invalid action specified";
}
echo json_encode($aDataR);
?>