Overview
Comment:Show error if database is corrupted when restoring
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA3-256: 69227580ebdc47f745b81f87578d22eafdd4ef92d0a999216e063d8b00a5babf
User & Date: bohwaz on 2022-01-28 14:53:45
Other Links: manifest | tags
Context
2022-01-29
22:27
Fix import of analytical projects in custom CSV import check-in: fff0f2d011 user: bohwaz tags: trunk, stable
2022-01-28
14:53
Show error if database is corrupted when restoring check-in: 69227580eb user: bohwaz tags: trunk, stable
12:32
Check transaction lines when doing sums check-in: 8b04c61522 user: bohwaz tags: trunk, stable
Changes

Modified src/templates/admin/config/backup/restore.tpl from [cb8b7573a9] to [fe1e0e7549].

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
		contenues dans le fichier fourni.
	</p>
	<p class="help">
		Une sauvegarde des données courantes sera effectuée avant le remplacement,
		en cas de besoin d'annuler cette restauration.
	</p>
	<dl>
		{input type="file" name="file" required=true}
	</dl>
	<p class="submit">
		{csrf_field key="backup_restore"}
		{button type="submit" name="restore_file" label="Restaurer depuis le fichier sélectionné" shape="upload" class="main"}
	</p>
	{if $code && ($code == Sauvegarde::INTEGRITY_FAIL && ALLOW_MODIFIED_IMPORT)}
	<p>







|







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
		contenues dans le fichier fourni.
	</p>
	<p class="help">
		Une sauvegarde des données courantes sera effectuée avant le remplacement,
		en cas de besoin d'annuler cette restauration.
	</p>
	<dl>
		{input type="file" name="file" label="Fichier de sauvegarde à restaurer" required=true}
	</dl>
	<p class="submit">
		{csrf_field key="backup_restore"}
		{button type="submit" name="restore_file" label="Restaurer depuis le fichier sélectionné" shape="upload" class="main"}
	</p>
	{if $code && ($code == Sauvegarde::INTEGRITY_FAIL && ALLOW_MODIFIED_IMPORT)}
	<p>

Modified src/www/admin/config/backup/restore.php from [c5bad54374] to [1f7464bcbf].

34
35
36
37
38
39
40



41
42
43
44
45
46
47
48
49
50
51
52
	$check = (ALLOW_MODIFIED_IMPORT && f('force_import')) ? false : true;

	try {
		$r = $s->restoreFromUpload($_FILES['file'], $session->getUser()->id, $check);
		Utils::redirect(Utils::getSelfURI(['ok' => 'restore', 'code' => (int)$r]));
	} catch (UserException $e) {
		$code = $e->getCode();



	}
}, 'backup_restore');


$ok_code = qg('code'); // return code
$ok = qg('ok'); // return message

$list = $s->getList();

$tpl->assign(compact('code', 'list', 'ok', 'ok_code'));

$tpl->display('admin/config/backup/restore.tpl');







>
>
>












34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
	$check = (ALLOW_MODIFIED_IMPORT && f('force_import')) ? false : true;

	try {
		$r = $s->restoreFromUpload($_FILES['file'], $session->getUser()->id, $check);
		Utils::redirect(Utils::getSelfURI(['ok' => 'restore', 'code' => (int)$r]));
	} catch (UserException $e) {
		$code = $e->getCode();
		if ($code == 0) {
			throw $e;
		}
	}
}, 'backup_restore');


$ok_code = qg('code'); // return code
$ok = qg('ok'); // return message

$list = $s->getList();

$tpl->assign(compact('code', 'list', 'ok', 'ok_code'));

$tpl->display('admin/config/backup/restore.tpl');