From ce28dd8cbbfe585d8f7a3576f4d0dc5ddc64c698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9munaire?= Date: Thu, 10 Oct 2013 05:22:52 +0200 Subject: [PATCH] Display a confirmation message after the importation --- onyx/include/admin/import_exercices.php | 6 ++++-- onyx/include/admin/import_users.php | 10 ++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/onyx/include/admin/import_exercices.php b/onyx/include/admin/import_exercices.php index 69cda624..9471d913 100644 --- a/onyx/include/admin/import_exercices.php +++ b/onyx/include/admin/import_exercices.php @@ -4,6 +4,8 @@ if(!defined('ONYX')) exit; if ($SESS->level > 1) { + $page = "admin/import_exercices"; + if (!empty($_FILES["inputFile"]['tmp_name'])) { $doc = new DOMDocument(); @@ -70,9 +72,9 @@ if ($SESS->level > 1) erreur("Unable to add '".$ex->id."' exercice."); } } - } - $page = "admin/import_exercices"; + erreur("XML file successfully imported.", "success"); + } } else { diff --git a/onyx/include/admin/import_users.php b/onyx/include/admin/import_users.php index f31d6ab4..7987d403 100644 --- a/onyx/include/admin/import_users.php +++ b/onyx/include/admin/import_users.php @@ -4,10 +4,12 @@ if(!defined('ONYX')) exit; if ($SESS->level > 1) { + $page = "admin/import_users"; + if (!empty($_FILES["inputFile"]['tmp_name'])) { $doc = new DOMDocument(); - if (!$doc->load($_FILES["inputFile"]['tmp_name'])) + if (@!$doc->load($_FILES["inputFile"]['tmp_name'])) { erreur("Unable to parse given file. A XML file was expected."); return; @@ -44,12 +46,8 @@ if ($SESS->level > 1) erreur("Unable to add user ".$user->username); } } - - // Define thema information - $theme = new Theme(); + erreur("XML file successfully imported.", "success"); } - - $page = "admin/import_users"; } else {