<?php require_once('includes/requireadminlogin.inc.php'); require_once('includes/upgrade/upgrade.inc.php'); $istest=TGET('istest'); $localpackage=$_SESSION[SESSKEYPFX.'_upgrade']['localpackage']; if (!$localpackage) { header("HTTP/1.1 500 Internal Error"); echo "Wrong upgrade procedure."; die; } $unpacktmppath=getcwd(); $unpackresult=unpack_upgrade_package($localpackage,$unpacktmppath,$istest); if ($unpackresult['status']!='OK') { header("HTTP/1.1 500 Internal Error"); if ($unpackresult['errorfiles']) { echo 'ERROR: cannot write to the following file(s).<br/>'; foreach ($unpackresult['errorfiles'] as $ef) echo $ef.'<br/>'; } else if (!$unpackresult) echo 'ERROR: wrong package.'; purge_array_by_key_prefix($_SESSION[SESSKEYPFX.'_upgrade'],'unpack.returned.'); } else { $_SESSION[SESSKEYPFX.'_upgrade']['unpack.returned.reserv']=$unpackresult['returned']; echo 'OK'; } ?>