)
*
* @todo BOM could be used for charset autodetection
*/
if ($offset == $size) {
// UTF-8
if (strncmp($result, "\xEF\xBB\xBF", 3) == 0) {
$result = substr($result, 3);
// UTF-16 BE, LE
} elseif (strncmp($result, "\xFE\xFF", 2) == 0 || strncmp($result, "\xFF\xFE", 2) == 0) {
$result = substr($result, 2);
}
}
return $result;
}
function untar_archive($tarname, $untar_path, $file_list = array(), $handle_remote = false){
global $globals, $can_write, $ftp;
// Create directory if not there
if(!is_dir($untar_path)){
@mkdir($untar_path);
}
$tar_archive = new softtar($tarname, '', $handle_remote);
if(empty($file_list)){
$res = $tar_archive->extractModify($untar_path, '');
}else{
$res = $tar_archive->extractList($file_list, $untar_path);
}
if(!$res){
return false;
}
return true;
}
function optGET($name, $default = ''){
global $error;
//Check the GETED NAME was GETed
if(isset($_GET[$name])){
return inputsec(htmlizer(trim($_GET[$name])));
}else{
return $default;
}
}
function optREQ($name, $default = ''){
global $error;
//Check the POSTED NAME was posted
if(isset($_REQUEST[$name])){
return inputsec(htmlizer(trim($_REQUEST[$name])));
}else{
return $default;
}
}
function inputsec($string){
//get_magic_quotes_gpc is depricated in php 7.4
if(version_compare(PHP_VERSION, '7.4', '<')){
if(!get_magic_quotes_gpc()){
$string = addslashes($string);
}else{
$string = stripslashes($string);
$string = addslashes($string);
}
}else{
$string = addslashes($string);
}
// This is to replace ` which can cause the command to be executed in exec()
$string = str_replace('`', '\`', $string);
return $string;
}
function htmlizer($string){
global $globals;
$string = htmlentities($string, ENT_QUOTES, 'UTF-8');
preg_match_all('/(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)/', $string, $matches);//r_print($matches);
foreach($matches[1] as $mk => $mv){
$tmp_m = entity_check($matches[2][$mk]);
$string = str_replace($matches[1][$mk], $tmp_m, $string);
}
return $string;
}
function entity_check($string){
//Convert Hexadecimal to Decimal
$num = ((substr($string, 0, 1) === 'x') ? hexdec(substr($string, 1)) : (int) $string);
//Squares and Spaces - return nothing
$string = (($num > 0x10FFFF || ($num >= 0xD800 && $num <= 0xDFFF) || $num < 0x20) ? '' : ''.$num.';');
return $string;
}
function rmdir_recursive_fn($path){
$path = (substr($path, -1) == '/' || substr($path, -1) == '\\' ? $path : $path.'/');
resetfilelist();
$files = filelist_fn($path, 1, 0, 'all');
$files = (!is_array($files) ? array() : $files);
//First delete the files only
foreach($files as $k => $v){
@chmod($k, 0777);
if(file_exists($k) && is_file($k) && @filetype($k) == "file"){
@unlink($k);
}
}
@clearstatcache();
$folders = filelist_fn($path, 1, 1, 'all');
$folders = (!is_array($folders) ? array() : $folders);
@krsort($folders);
//Now Delete the FOLDERS
foreach($folders as $k => $v){
@chmod($k, 0777);
if(is_dir($k)){
@rmdir($k);
}
}
@rmdir($path);
@clearstatcache();
}
function filelist_fn($startdir="./", $searchSubdirs=1, $directoriesonly=0, $maxlevel="all", $level=1, $reset = 1) {
//list the directory/file names that you want to ignore
$ignoredDirectory[] = ".";
$ignoredDirectory[] = "..";
$ignoredDirectory[] = "_vti_cnf";
global $directorylist; //initialize global array
if(substr($startdir, -1) != '/'){
$startdir = $startdir.'/';
}
if (is_dir($startdir)) {
if ($dh = opendir($startdir)) {
while (($file = readdir($dh)) !== false) {
if (!(array_search($file,$ignoredDirectory) > -1)) {
if (@filetype($startdir . $file) == "dir") {
//build your directory array however you choose;
//add other file details that you want.
$directorylist[$startdir . $file]['level'] = $level;
$directorylist[$startdir . $file]['dir'] = 1;
$directorylist[$startdir . $file]['name'] = $file;
$directorylist[$startdir . $file]['path'] = $startdir;
if ($searchSubdirs) {
if ((($maxlevel) == "all") or ($maxlevel > $level)) {
filelist_fn($startdir . $file . "/", $searchSubdirs, $directoriesonly, $maxlevel, ($level + 1), 0);
}
}
} else {
if (!$directoriesonly) {
// echo substr(strrchr($file, "."), 1);
//if you want to include files; build your file array
//however you choose; add other file details that you want.
$directorylist[$startdir . $file]['level'] = $level;
$directorylist[$startdir . $file]['dir'] = 0;
$directorylist[$startdir . $file]['name'] = $file;
$directorylist[$startdir . $file]['path'] = $startdir;
}}}}
closedir($dh);
}}
if(!empty($reset)){
$r = $directorylist;
$directorylist = array();
return($r);
}
}
function tar_archive($tarname, $file_list){
global $globals;
$tar_archive = new softtar($tarname, 'gz');
$res = $tar_archive->createModify($file_list, '', '');
if(!$res){
return false;
}
return true;
}
function resetfilelist(){
global $directorylist;
$directorylist = array();
}
function softdie($txt, $l_file = ''){
global $data, $can_write;
$array = array();
$array['settings'] = $GLOBALS['settings'];
$array['result'] = $txt;
$array['data'] = $GLOBALS['data'];
// Add last backed up file to the array if the process is still INCOMPLETE
if(!empty($l_file)){
$array['l_file'] = $l_file;
}
// Send the current status of the operation performed according to which the next operation will be performed.
if(!empty($GLOBALS['current_status'])){
$array['current_status'] = $GLOBALS['current_status'];
}
// Was there an error ?
if(!empty($GLOBALS['error'])){
$array['local_tarname'] = $GLOBALS['local_tarname'];
$array['error'] = $GLOBALS['error'];
restore_clean(1);
}
if($txt == 'DONE'){
$array['local_tarname'] = $GLOBALS['local_tarname'];
restore_clean(1);
}
// In case the restore is incomplete we call clean without force so it will delete files that are not required anymore
restore_clean();
echo ''.base64_encode(serialize($array)).'';die();
}
// Clean the Backup files
function backup_clean($data){
foreach($GLOBALS['bfh'] as $v){
@fclose($v);
}
rmdir_recursive_fn($data['path'].'/tmp/'.$data['name']);
return false;
}
// Copy from source to destination
function copydir_fn($source, $destination){
$source = (substr($source, -1) == '/' || substr($source, -1) == '\\' ? $source : $source.'/');
$destination = (substr($destination, -1) == '/' || substr($destination, -1) == '\\' ? $destination : $destination.'/');
$source_ = substr($source, 0, -1);
$destination_ = substr($destination, 0, -1);
if(!is_dir($destination)){
mkdir($destination);
}
resetfilelist();
$files = filelist_fn($source, 1, 1, 'all');
$files = (!is_array($files) ? array() : $files);
// Make the folders
foreach($files as $k => $v){
mkdir(str_replace($source_, $destination_, $k), $globals['dirchmod'], 1);
@chmod(str_replace($source_, $destination_, $k), fileperms($k));
}
@clearstatcache();
resetfilelist();
$files = filelist_fn($source, 1, 0, 'all');
$files = (!is_array($files) ? array() : $files);
// Copy the files
foreach($files as $k => $v){
if(file_exists($k) && is_file($k) && @filetype($k) == "file"){
if(!empty($GLOBALS['last_file']) && $GLOBALS['start'] == 0){
if(preg_match('#^'.$GLOBALS['last_file'].'$#', $k)){
$GLOBALS['start'] = 1; // give a jump start once the last backed up file is found..
}
continue; //return true to skip files
}
copy($k, str_replace($source_, $destination_, $k));
@chmod(str_replace($source_, $destination_, $k), fileperms($k));
// We can run the scripts for the end time already set
if(time() >= $GLOBALS['end']){
$GLOBALS['end_file'] = $last_file; // set end file so that we know where to start from
break;
}
}
}
@clearstatcache();
resetfilelist();
return true;
}
function soft_mysql_connect($host, $user, $pass, $newlink = false){
// php 8.1 throws mysqli_sql_exception if the db/dbuser doesn't exists
try{
if(extension_loaded('mysqli')){
//echo 'mysqli';
//To handle connection if user passes a custom port along with the host as 127.0.0.1:6446.
//For testing, use port 127.0.0.1 instead of localhost as 127.0.0.1:6446 http://php.net/manual/en/mysqli.construct.php#112328
$exh = explode(':', $host);
if(!empty($exh[1])){
//In webuzo we connect to MYSQL through mysql.sock e.g localhost:/var/lib/mysql/mysql.sock
//In case of socket $exh[1] will have the socket path and socket is the 6th parameter
if(!is_numeric($exh[1])){
$sconn = @mysqli_connect($exh[0], $user, $pass, '', 3306, $exh[1]);
}else{
$sconn = @mysqli_connect($exh[0], $user, $pass, '', $exh[1]);
}
}else{
$sconn = @mysqli_connect($host, $user, $pass);
}
}else{
//echo 'mysql';
$sconn = @mysql_connect($host, $user, $pass, $newlink);
}
}catch(Exception $e){
return false;
}
return $sconn;
}
function soft_mysql_select_db($db, $conn){
if(empty($conn)){
return false;
}
try{
if(extension_loaded('mysqli')){
$return = @mysqli_select_db($conn, $db);
}else{
$return = @mysql_select_db($db, $conn);
}
}catch(Exception $e){
return false;
}
return $return;
}
function soft_mysql_query($query, $conn, $unbuffer_mode = 0){
if(empty($conn) || empty($query)){
return false;
}
try{
if(extension_loaded('mysqlnd') && !empty($unbuffer_mode)){
$return = @mysqli_query($conn, $query, MYSQLI_USE_RESULT);
}elseif(extension_loaded('mysqli')){
$return = @mysqli_query($conn, $query);
}else{
$return = @mysql_query($query, $conn);
}
}catch(Exception $e){
return false;
}
return $return;
}
function soft_mysql_error($conn){
if(empty($conn)){
return false;
}
if(extension_loaded('mysqli')){
$return = @mysqli_error($conn);
// In mysqli if connection is not made then we will get connection error using the following function.
if(empty($conn)){
$return = @mysqli_connect_error();
}
}else{
$return = @mysql_error($conn);
}
return $return;
}
function soft_mysql_num_rows($result){
// If $result is not a resource return else it will lead to FATAL error
if(empty($result)){
return false;
}
// $result->type == 1 when mysqlnd and unbuffered queries i.e. with use result
// $result->type == 0 when not mysqlnd and buffered queries i.e. without use result
if(extension_loaded('mysqlnd') && !empty($result->type)){
$return = (int) (!empty($result));
}elseif(extension_loaded('mysqli')){
$return = @mysqli_num_rows($result);
}else{
$return = @mysql_num_rows($result);
}
return $return;
}
function soft_mysql_fetch_array($result){
// If $result is not a resource return else it will lead to FATAL error
if(empty($result)){
return false;
}
if(extension_loaded('mysqli')){
$return = @mysqli_fetch_array($result);
}else{
$return = @mysql_fetch_array($result);
}
return $return;
}
function soft_stream_wrapper_register($protocol, $classname){
$protocols = array('dropbox', 'gdrive', 'softftpes', 'softsftp', 'webdav','softaws', 'onedrive');
if(!in_array($protocol, $protocols)){
return true;
}
@include_once('_'.$protocol.'.php');
if(!stream_wrapper_register($protocol, $classname)){
return false;
}
return true;
}
function soft_preg_replace($pattern, $file, &$var, $valuenum, $stripslashes = ''){
preg_match($pattern, $file, $matches);
if(empty($stripslashes)){
$var = @trim($matches[$valuenum]);
}else{
$var = @stripslashes(trim($matches[$valuenum]));
}
}
function r_print($array){
echo '';
print_r($array);
echo '
';
}
function restore_clean($force = 0){
global $data;
//Delete the temporarily downloaded archive if some error occur in the restore
if($GLOBALS['current_status'] >= 4 || !empty($force)){
@unlink($GLOBALS['local_tarname']);
}
// Delete these always, we will unzip these files everytime
@unlink($data['softpath'].'/softperms.txt');
@unlink($data['softpath'].'/softver.txt');
//Delete the softsql.sql file
if((file_exists($data['softpath'].'/'.$data['dbexist']) && $GLOBALS['current_status'] >= 2) || !empty($force)){
@unlink($data['softpath'].'/'.$data['dbexist']);
if(file_exists($data['softpath'].'/'.$data['fname'].'.partial')){
@unlink($data['softpath'].'/'.$data['fname'].'.partial');
}
}
//Delete softdatadir
if((file_exists($data['softpath'].'/softdatadir') && $GLOBALS['current_status'] >= 3) || !empty($force)){
rmdir_recursive_fn($data['softpath'].'/softdatadir');
@unlink($data['softdatadir'].'/softperms.txt');
}
//Delete wwwdir
if((file_exists($data['softpath'].'/wwwdir') && $GLOBALS['current_status'] >= 4) || !empty($force)){
rmdir_recursive_fn($data['softpath'].'/wwwdir');
@unlink($data['wwwdir'].'/softperms.txt');
}
}
@unlink(__FILE__); // More has to be done here !
// The settings
$settings = unserialize(base64_decode('[[[settings]]]'));
$data = unserialize(base64_decode('[[[data]]]'));
$backupinfo = unserialize(base64_decode('[[[backupinfo]]]'));
$remote_location = unserialize(base64_decode('[[[remote_location]]]'));
global $globals, $theme, $softpanel, $iscripts, $catwise, $error, $can_write, $ftp;
$can_write = can_create_file(); // Check if we can write
if(!$can_write){
//Installation's ftp stream
///////////Send the protocol class files for sftp and ftps
$data['softpath'] = $settings['protocol'].'://'.rawurlencode(($settings['protocol'] == 'softsftp' && empty($settings['ftp_pass']) ? $settings['id'] : $settings['ftp_user'])).':'.rawurlencode($settings['ftp_pass']).'@'.$settings['softdomain'].(!empty($settings['port']) ? ':'.$settings['port'] : '').$settings['ftp_softpath'];
soft_stream_wrapper_register($settings['protocol'], $settings['protocol']);
$globals['odc'] = 0777;
$globals['ofc'] = 0666;
}
// Dont abort if user aborts
ignore_user_abort(true);
// We need to stop execution in 25 secs.. We will be called again if the process is incomplete
// Is custom keep alive time defained ?
if(!empty($settings['SOFTACULOUS_KEEP_ALIVE'])){
$keepalive = (int) $settings['SOFTACULOUS_KEEP_ALIVE'];
}
// Set default value
if(empty($keepalive)){
$keepalive = 25;
}
$GLOBALS['end'] = (int) time() + $keepalive;
// Empty last file everytime as a precaution
$GLOBALS['last_file'] = '';
$GLOBALS['last_file'] = optREQ('last_file');
if(!empty($GLOBALS['last_file'])){
$GLOBALS['last_file'] = rawurldecode($GLOBALS['last_file']);
}
$GLOBALS['current_status'] = 0;
$GLOBALS['current_status'] = (int) optGET('current_status');
if(!empty($GLOBALS['current_status'])){
$GLOBALS['current_status'] = $GLOBALS['current_status'];
}
// Extract softperms & softver
// empty($data['restore_dir']):this condition is empty because while unzipping DIR we are going to extract everything anyways
if(empty($data['restore_dir']) && !empty($data['restore_datadir']) && !empty($data['restore_wwwdir'])){
untar_archive($data['backup_dir'].'/'.$data['fname'], $data['softpath'], array('softperms.txt', 'softver.txt'), true);
}
// Restore files
if(!empty($data['restore_dir']) && empty($GLOBALS['current_status'])){
// Store the progress
//soft_progress($GLOBALS['ssk'], 10, $l['res_dir']);
$GLOBALS['progress'] = 10;
// If soft_version is not there than it means the backup is <= 4.1.2 (i.e ZIP FILE)
if(!empty($data['soft_version'])){
// Set default values
$GLOBALS['start'] = 0;
$GLOBALS['end_file'] = '';
if(!untar_archive($data['backup_dir'].'/'.$data['fname'], $data['softpath'], array(), true)){
$error[] = 'There was some error while unzipping the backup files';
softdie('restoreerror');
}
// Is the backup process INCOMPLETE ?
if(!empty($GLOBALS['end_file'])){
softdie('INCOMPLETE-'.$GLOBALS['progress'], $GLOBALS['end_file']);
}
}
// See if a permission list is there ?
$perms = @file($data['softpath'].'/softperms.txt');
if(is_array($perms)){
foreach($perms as $k => $v){
$link = $target = $dest_file = '';
$v = trim($v);
$perm = substr($v, -4);
// Do this only if the restore of files is already completed
if(empty($GLOBALS['end_file'])){
if(preg_match('/(.*?)linkto=(.*?)('.$perm.')/', $v, $out)){
$link = trim($out[1]);
$target = trim($out[2]);
if (substr($link, 0, 1) == '/'){
$link = $data['softpath'].$link;
}else{
$link = $data['softpath'].'/'.$link;
}
if(!empty($target)){
if(!@symlink($target, $link)){
$error[] = 'Unable to extract symbolic link {' . $link . '}';
softdie('restoresymlink');
}
}
}
}
if(is_numeric($perm)){
if(empty($link)){
$dest_file = $data['softpath'].'/'.substr($v, 0, -5);
}else{
$dest_file = $link;
}
@chmod($dest_file, octdec($perm));
}
}
}
$GLOBALS['current_status'] = 1;
}
// Restore Database
if(!empty($data['restore_db']) && $GLOBALS['current_status'] < 2){
// Store the progress
//soft_progress($GLOBALS['ssk'], 70, $l['res_db']);
$GLOBALS['progress'] = 70;
$dbuser = (empty($softpanel->backupmysql['user']) ? $data['softdbuser'] : $softpanel->backupmysql['user']);
$dbpass = (empty($softpanel->backupmysql['pass']) ? $data['softdbpass'] : $softpanel->backupmysql['pass']);
// Does the USER exist ?
$mysql = @soft_mysql_connect($data['softdbhost'], $dbuser, $dbpass, true);
// Try to select the DB if connection was successful
if($mysql){
$_mysql = @soft_mysql_select_db($data['softdb'], $mysql);
}
// Could not connect to the DB, so try to CREATE
if(!empty($data['create_db']) && empty($_mysql)){
if(!$softpanel->createdb($data['softdb'], $dbuser, $dbpass)){
$error['err_db_create'] = 'Error occured while creating Database';
softdie('err_db_create');
}
}
// Only for TAR
if(!empty($data['soft_version'])){
if(!file_exists($data['softpath'].'/'.$data['dbexist'])){
if(!untar_archive($data['backup_dir'].'/'.$data['fname'], $data['softpath'], array($data['dbexist']), true)){
$error[] = 'There was some error while unzipping the backup files';
softdie('restoreerror');
}
}
}
//$sql_data = file_get_contents($data['softpath'].'/'.$data['dbexist']);
//Make the Connection
$__conn = @soft_mysql_connect($data['softdbhost'], $dbuser, $dbpass, true);
soft_mysql_query('SET CHARACTER SET utf8mb4', $__conn);
//CHECK Errors and SELECT DATABASE
if(!empty($__conn)){
if(!(@soft_mysql_select_db($data['softdb'], $__conn))){
//$softpanel->deldb($dbuser, $dbpass);
$error[] = 'Could not select the database to restore'.'
'.soft_mysql_error($__conn);
softdie('res_err_selectmy');
}
}else{
$error[] = 'Could not connect to the database'.'
'.soft_mysql_error($__conn);
softdie('err_myconn');
}
// We did not create the database ! So just backup the tables required for this database
if(empty($data['dbcreated']) && !empty($data['softdbtables'])){
// Do we have to get the tables list from backup info ?
if(!empty($backupinfo['softdbtables'])){
$thisdb_tables = $backupinfo['softdbtables'];
$additional_tables = (!empty($backupinfo['additional_tables']) ? $backupinfo['additional_tables'] : array());
}else{
$thisdb_tables = $data['softdbtables'];
$additional_tables = (!empty($data['additional_tables']) ? $data['additional_tables'] : array());
}
if(!is_array($data['softdbtables'])){
$thisdb_tables = unserialize($data['softdbtables']);
}
$thisdb_tables = (!empty($additional_tables) ? array_merge($additional_tables, $thisdb_tables) : $thisdb_tables);
// This is just to remove the ` since we are not getting it in $tables below
foreach($thisdb_tables as $tk => $tv){
$_thisdb_tables[trim($tk, '`')] = trim($tv, '`');
}
}
$res = soft_mysql_query("SHOW TABLES", $__conn);
if(soft_mysql_num_rows($res) > 0){
while($row = soft_mysql_fetch_array($res)){
// We do not need to backup this table
if(isset($_thisdb_tables) && is_array($_thisdb_tables) && !in_array($row[0], $_thisdb_tables)){
continue;
}
$tables[] = $row[0];
}
}
// Some tables cause problem
$res = soft_mysql_query("SET foreign_key_checks = 0", $__conn);
foreach($tables as $k => $v){
$res = soft_mysql_query("DROP TABLE `$v`", $__conn);
}
//Softaculous Function to import Data
soft_import($data['softpath'].'/'.$data['dbexist'], $__conn);
if(!empty($error)){
return false;
}
@unlink($data['softpath'].'/'.$data['dbexist']);
if(file_exists($data['softpath'].'/'.$data['fname'].'.partial')){
@unlink($data['softpath'].'/'.$data['fname'].'.partial');
}
//r_print($data);
$GLOBALS['current_status'] = 2;
}
//Restore data directory
if(!empty($data['restore_datadir']) && $GLOBALS['current_status'] < 3){
// Store the progress
//soft_progress($GLOBALS['ssk'], 85, $l['res_datadir']);
$GLOBALS['progress'] = 85;
if(!file_exists($data['softpath'].'/softdatadir')){
if(!untar_archive($data['backup_dir'].'/'.$data['fname'], $data['softpath'], array('softdatadir/*'), true)){
$error[] = 'There was some error while unzipping the data directory';
softdie('restoreerror');
}
// Is the backup process INCOMPLETE ?
if(!empty($GLOBALS['end_file'])){
softdie('INCOMPLETE-'.$GLOBALS['progress'], $GLOBALS['end_file']);
}
}
if(!copydir_fn($data['softpath'].'/softdatadir', $data['softdatadir'])){
$error[] = 'Unable to restore data directory';
softdie('restoredatadir');
}
rmdir_recursive_fn($data['softpath'].'/softdatadir');
// See if a permission list is there ?
$perms = @file($data['softdatadir'].'/softperms.txt');
if(is_array($perms)){
foreach($perms as $k => $v){
$v = trim($v);
$perm = substr($v, -4);
if(is_numeric($perm)){
@chmod($data['softdatadir'].'/'.substr($v, 0, -5), octdec($perm));
}
}
}
$GLOBALS['current_status'] = 3;
}
//Restore the cron
/* if(!empty($data['cron_time']) && !empty($data['cron_command'])){
$cron_time = explode(',', $data['cron_time']);
$softpanel->addcron($cron_time[0], $cron_time[1], $cron_time[2], $cron_time[3], $cron_time[4], base64_decode($data['cron_command']));
} */
//Restore Web directory
if(!empty($data['restore_wwwdir']) && $GLOBALS['current_status'] < 4){
// Store the progress
//soft_progress($GLOBALS['ssk'], 90, $l['res_datadir']);
$GLOBALS['progress'] = 90;
if(!file_exists($data['softpath'].'/wwwdir')){
if(!untar_archive($data['backup_dir'].'/'.$data['fname'], $data['softpath'], array('wwwdir/*'), true)){
$error[] = 'There was some error while unzipping the Web directory';
softdie('restoreerror');
}
// Is the backup process INCOMPLETE ?
if(!empty($GLOBALS['end_file'])){
softdie('INCOMPLETE-'.$GLOBALS['progress'], $GLOBALS['end_file']);
}
}
if(!copydir_fn($data['softpath'].'/wwwdir', $data['wwwdir'])){
$error[] = 'Unable to restore Web directory';
softdie('restorewww');
}
rmdir_recursive_fn($data['softpath'].'/wwwdir');
// See if a permission list is there ?
$perms = @file($data['wwwdir'].'/softperms.txt');
if(is_array($perms)){
foreach($perms as $k => $v){
$v = trim($v);
$perm = substr($v, -4);
if(is_numeric($perm)){
@chmod($data['wwwdir'].'/'.substr($v, 0, -5), octdec($perm));
}
}
}
$GLOBALS['current_status'] = 4;
}
$GLOBALS['current_status'] = 5;
// The process is complete. Send a NULL Value
//soft_progress($GLOBALS['ssk'], NULL, NULL);
softdie('DONE');