diff --git a/maarch_entreprise/trunk/index.php b/maarch_entreprise/trunk/index.php
index 980cb355fd1ad2062c211ae62cc2765a156abc51..24751dab73ca5e8b9ac63859232f060bdc46f0b9 100644
--- a/maarch_entreprise/trunk/index.php
+++ b/maarch_entreprise/trunk/index.php
@@ -106,12 +106,7 @@ foreach ($_REQUEST as $name => $value) {
     }
 }
 
-if (isset($_REQUEST['display'])) {
-     $core->insert_page();
-     exit();
-}
-
-if (! isset($_SESSION['user']['UserId'])) {
+if (! isset($_SESSION['user']['UserId']) && $_REQUEST['page'] <> 'login' && $_REQUEST['page'] <> 'log' ) {
 
     $_SESSION['HTTP_REFERER'] = Url::requestUri();
     if (trim($_SERVER['argv'][0]) <> '') {
@@ -122,6 +117,11 @@ if (! isset($_SESSION['user']['UserId'])) {
     exit();
 }
 
+if (isset($_REQUEST['display'])) {
+     $core->insert_page();
+     exit();
+}
+
 if (isset($_GET['show'])) {
     $show = $_GET['show'];
 } else {