Display a confirmation message after the importation

This commit is contained in:
Némunaire 2013-10-10 05:22:52 +02:00
parent ea27ea5855
commit ce28dd8cbb
2 changed files with 8 additions and 8 deletions

View File

@ -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
{

View File

@ -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
{