Security line in all includes changed
[mailer.git] / inc / modules / member / what-surfbar_start.php
index b90d08d33807f1b9fa565df1f037667e2b3d8d1b..2308f2a275bd185d2ca3aa3f597b4e7db7ac3870 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
  * MXChange v0.2.1                                    Start: 09/05/2008 *
- * ================                             Last change: 09/05/2008 *
+ * ================                             Last change: 09/08/2008 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : what-surfbar_start.php                           *
@@ -12,7 +12,7 @@
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003, 2004, 2005, 2006, 2007 by Roland Haeder          *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-} elseif (!IS_LOGGED_IN()) {
-       LOAD_URL(URL."/modules.php?module=index");
+} elseif (!IS_MEMBER()) {
+       // Not logged in
+       LOAD_URL("modules.php?module=index");
+} elseif (!EXT_IS_ACTIVE("surfbar")) {
+       // Extension "surfbar" is not active
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "surfbar");
+       return;
 }
 
 // Add description as navigation point
@@ -50,11 +55,8 @@ $content = array(
        'surfbar_dynamic_percent' => TRANSLATE_COMMA($_CONFIG['surfbar_dynamic_percent'])
 );
 
-// Construct template name
-$templateName = "member_".substr(basename(__FILE__), 5, -4)."_".strtolower($_CONFIG['surfbar_pay_model']);
-
 // Load the template
-LOAD_TEMPLATE($templateName, false, $content);
+LOAD_TEMPLATE("member_surfbar_start_".strtolower($_CONFIG['surfbar_pay_model']), false, $content);
 
 // Load surfbar link template
 LOAD_TEMPLATE("member_surfbar_link");