Fix for if session has expired and user is still in login area
[mailer.git] / inc / modules / login.php
index 67b049ad2e9abf09fce5cd3a8b75519c7a671627..06c4ffb97b7eef26451804c53eada28a86c7020b 100644 (file)
@@ -42,7 +42,7 @@ if (!defined('__SECURITY')) {
        require($INC);
 } elseif (!IS_MEMBER()) {
        $URL = 'modules.php?module=index';
-       if ($check == 'mem_only') $URL .= '&msg='.getCode('MODULE_MEM_ONLY') . '&mod='.getModule();
+       if (checkModulePermissions('login') == 'mem_only') $URL .= '&msg='.getCode('MODULE_MEM_ONLY') . '&mod='.getModule();
        redirectToUrl($URL);
 }
 
@@ -58,7 +58,7 @@ if ($GLOBALS['status'] != 'CONFIRMED') {
 define('__MEMBER_ADVERT', LOAD_TEMPLATE('member_banner', true));
 
 // Disable block mode by default
-$GLOBALS['block_mode'] = false;
+enableBlockMode(false);
 
 // Generate a tableset for the menu title and content
 LOAD_TEMPLATE('member_header');
@@ -79,6 +79,9 @@ if ((getConfig('member_menu') == 'Y') || (!EXT_IS_ACTIVE('sql_patches', true)))
        ADD_MENU('member', getModeAction('member', getWhat()), getWhat());
 } // END - if
 
+// Disable block-mode again
+enableBlockMode(false);
+
 // Menu -> content
 OUTPUT_HTML("   </td>
   <td valign=\"top\" align=\"center\" rowspan=\"3\" class=\"member_content\">");