]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/login.php
But only when it is not empty
[mailer.git] / inc / modules / login.php
index 7e717d182f5a9653a1143007db79d8a2ce00f827..3cb50ada28afd95204392089f7595b8c3edd56b8 100644 (file)
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
-       die();
+       exit();
 } elseif (!isMember()) {
-       $URL = 'modules.php?module=index';
-       if (checkModulePermissions('login') == 'mem_only') $URL .= '&code=' . getCode('MODULE_MEM_ONLY') . '&mod=' . getModule();
-       redirectToUrl($URL);
+       // Redirect to login form with displayed error code
+       redirectToUrl('modules.php?module=index&what=login&code=' . getCode('MODULE_MEMBER_ONLY') . '&mod=' . getModule());
 } // END - if
 
 // Disable block mode by default
-enableBlockMode(false);
+enableBlockMode(FALSE);
 
 // Generate a tableset for the menu title and content
-loadTemplate('member_header', false, array('date_time' => generateDateTime(time(), 1)));
+loadTemplate('member_header', FALSE, array('date_time' => generateDateTime(time(), 1)));
 
 // Add code-message here
 handleCodeMessage();
@@ -60,22 +57,24 @@ loadTemplate('member_menu_start');
 
 // Adding the main content module here
 if (!isActionSet()) {
-       if (!isWhatSet()) setWhat('welcome');
+       if (!isWhatSet()) {
+               setWhat('welcome');
+       } // END - if
 } else {
        $action = getAction();
 }
 
 // Add the member's menu here...
-if ((getConfig('member_menu') == 'Y') || (!isExtensionActive('sql_patches', true))) {
+if ((isMemberMenuEnabled()) || (!isExtensionActive('sql_patches', TRUE))) {
        addMenu('member', getActionFromModuleWhat('member', getWhat()), getWhat());
 } // END - if
 
 // Disable block-mode again
-enableBlockMode(false);
+enableBlockMode(FALSE);
 
 // Menu -> content
-outputHtml("   </td>
-  <td valign=\"top\" align=\"center\" rowspan=\"3\" class=\"member_content\">");
+outputHtml('   </td>
+  <td valign="top" align="center" rowspan="3" class="member_content">');
 
 $inc = sprintf("inc/modules/member/action-%s.php", $action);
 if ((isIncludeReadable($inc)) && (isMenuActionValid('member', getAction(), getWhat()))) {
@@ -86,16 +85,16 @@ if ((isIncludeReadable($inc)) && (isMenuActionValid('member', getAction(), getWh
        redirectToUrl('modules.php?module=login');
 }
 
-if ((getConfig('member_menu') == 'Y') || (!isExtensionActive('sql_patches', true))) {
+if ((isMemberMenuEnabled()) || (!isExtensionActive('sql_patches', TRUE))) {
        // Right side of content (hint: a good place for 120x600 skyscraper banner!)
        loadTemplate('member_content_right');
 
        // Some advertising stuff?
        loadTemplate('member_advert');
-}
+} // END - if
 
-outputHtml("  </td>
-</tr>");
+outputHtml('  </td>
+</tr>');
 
 // Load same template for 'Goto TOP'
 loadTemplate('member_goto_top');
@@ -103,5 +102,5 @@ loadTemplate('member_goto_top');
 // Footer template (Thanx to Mr. Glaus!)
 loadTemplate('member_footer');
 
-//
+// [EOF]
 ?>