\n";
if(count($_POST))
{
$filename = "dump".$_POST["backupdate"]."txt";
$filename = $objConfig->Get("Backup_Path")."/".$filename;
}
else
$filename = $_GET["Filename"];
$FileOffset = (int)$_GET["Offset"];
//echo "FileOffset: $FileOffset
\n";
if(!file_exists($filename))
{
echo prompt_language("la_restore_file_not_found")." : $filename";
exit();
}
if(!is_readable($filename))
{
echo prompt_language("la_restore_access_denied");
exit();
}
$TotalSize = filesize($filename);
$MaxLines = 200;
$PageTitle = admin_language("la_text_Restore_in_progress");
$CancelURL = $rootURL ."admin/backup/restore1.php?env=".BuildEnv();
stats($PageTitle,$FileOffset,$TotalSize);
//echo "FileOffset: $FileOffset
\n";
if($FileOffset < $TotalSize)
{
$FileOffset = RunRestoreFile($conn,$filename,$FileOffset,$MaxLines);
if($FileOffset>-1)
{
if($FileOffset ==0)
$FileOffset = $TotalSize;
$url = $_SERVER['PHP_SELF']."?env=".BuildEnv()."&Offset=$FileOffset&Filename=$filename";
}
else
{
switch($FileOffset)
{
case -1:
$error = prompt_language("la_restore_file_error");
break;
case -2:
$error = prompt_language("la_restore_read_error");
break;
default:
$error = "(".$FileOffset.") ".prompt_language("la_restore_unknown_error");
break;
}
echo $error;
die();
}
}
else
$url = $adminURL."/backup/restore4.php?env=".BuildEnv();
reload($url);
echo "