Removes an undefined variable warning in AdminModule.
[platal.git] / modules / platal.php
index 05b8caf..3591fff 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2008 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -442,8 +442,10 @@ Adresse de secours : " . Post::v('email') : ""));
             Platal::session()->killLoginFormCookies();
         }
 
-        S::logger()->log('deconnexion', @$_SERVER['HTTP_REFERER']);
-        Platal::session()->destroy();
+        if (S::logged()) {
+            S::logger()->log('deconnexion', @$_SERVER['HTTP_REFERER']);
+            Platal::session()->destroy();
+        }
 
         if (Get::has('redirect')) {
             http_redirect(rawurldecode(Get::v('redirect')));