Merge branch 'support/3.0' into develop

This commit is contained in:
Stephen Abello
2023-05-02 09:25:55 +02:00
2 changed files with 5 additions and 7 deletions

View File

@@ -136,6 +136,9 @@ try
* As a result we're setting a token file to make sure the restore is called by an authenticated user with the correct rights !
*/
case 'restore_get_token':
$oPage = new JsonPage();
$oPage->SetOutputDataOnly(true);
$sEnvironment = utils::ReadParam('environment', 'production', false, 'raw_data');
$oRestoreMutex = new iTopMutex('restore.'.$sEnvironment);
if ($oRestoreMutex->IsLocked())
@@ -148,12 +151,7 @@ try
$sTokenFile = APPROOT.'/data/restore.'.$sToken.'.tok';
file_put_contents($sTokenFile, $sFile);
$oPage->add_ready_script(
<<<JS
$("#restore_token").val('$sToken');
JS
);
$oPage->SetData(['token' => $sToken]);
$oPage->output();
break;

View File

@@ -466,7 +466,7 @@ function LaunchRestoreNow(sBackupFile, sConfirmationMessage)
$.post(GetAbsoluteUrlModulePage('itop-backup', 'ajax.backup.php'), oParams, function(data){
// Get the value of restore_token
$('#backup_errors').append(data);
$('#restore_token').val(data.token);
var oParams = {};
oParams.operation = 'restore_exec';