Log disconnection only if the user is logged.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Wed, 14 Jan 2009 22:05:48 +0000 (23:05 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Wed, 14 Jan 2009 22:05:48 +0000 (23:05 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
modules/platal.php

index cf73869..c9b4287 100644 (file)
@@ -452,8 +452,10 @@ Adresse de secours : " . Post::v('email') : ""));
             Cookie::kill('ORGdomain');
         }
 
-        $ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
-        S::logger()->log('deconnexion',$ref);
+        if (S::logged()) {
+            $ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
+            S::logger()->log('deconnexion', $ref);
+        }
         Platal::session()->destroy();
 
         if (Get::has('redirect')) {