Tons of rewrites (SQL queries), surfbar nearly finished (working: surfing with static...
[mailer.git] / inc / modules / member / what-logout.php
index 6c7926ac2a9376c7ee3897e5c84dbcffb2ca23f1..d2f8e71bbd83b1eb319b0035e317475d931cae60 100644 (file)
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-}
- elseif (!IS_LOGGED_IN())
-{
+} elseif (!IS_LOGGED_IN()) {
        LOAD_URL("modules.php?module=index");
 }
 
@@ -50,8 +47,7 @@ $URL = URL."/modules.php?module=index";
 // NEW: Fixed the Set of Cookies, you mus add right TimeSet, if you changed it in What_login.php! (eg. time()- cookieTime
 
 
-if (set_session("userid", "") && set_session("u_hash", "") && set_session("lifetime", ""))
-{
+if (destroy_user_session()) {
        // Remove theme cookie as well
        set_session("mxchange_theme", "");
 
@@ -60,14 +56,13 @@ if (set_session("userid", "") && set_session("u_hash", "") && set_session("lifet
 
        // Destroy session here
        @session_destroy();
-}
- else
-{
+} else {
        // Cannot logout! :-(
        $URL .= "&msg=".CODE_LOGOUT_FAILED;
 }
 
-//
+// Load the URL
 LOAD_URL($URL);
+
 //
 ?>