mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 00:58:48 +02:00
N°6009 - Fix restore backup button not working when JS dependencies are present
This commit is contained in:
@@ -137,6 +137,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())
|
||||
@@ -149,12 +152,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;
|
||||
|
||||
|
||||
@@ -471,7 +471,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';
|
||||
|
||||
Reference in New Issue
Block a user