Fixes/rewrites for content-type
authorRoland Häder <roland@mxchange.org>
Wed, 16 Dec 2009 19:45:35 +0000 (19:45 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 16 Dec 2009 19:45:35 +0000 (19:45 +0000)
admin.php
agb.php
confirm.php
inc/functions.php
inc/modules/admin/what-usr_online.php
inc/modules/guest/what-register.php
js.php
ref.php
sponsor_confirm.php
sponsor_ref.php

index b2c5768..629a255 100644 (file)
--- a/admin.php
+++ b/admin.php
@@ -47,7 +47,7 @@ $GLOBALS['output_mode'] = -1;
 require('inc/config-global.php');
 
 // Set content type for e.g. search engines
-if (isSpider()) setContentType('text/html');
+setContentType('text/html');
 
 // Is the admin logged-in and no sql_patches installed?
 if ((isAdmin()) && (!isExtensionActive('sql_patches'))) {
diff --git a/agb.php b/agb.php
index 102f160..fb1630b 100644 (file)
--- a/agb.php
+++ b/agb.php
@@ -47,7 +47,7 @@ $GLOBALS['output_mode'] = -1;
 require('inc/config-global.php');
 
 // Set content type for e.g. search engines
-if (isSpider()) setContentType('text/html');
+setContentType('text/html');
 
 // Simply redirect... :-)
 redirectToUrl('modules.php?module=index&amp;what=agb');
index b413408..84c94b6 100644 (file)
@@ -47,7 +47,7 @@ $GLOBALS['output_mode'] = -1;
 require('inc/config-global.php');
 
 // Set content type for e.g. search engines
-if (isSpider()) setContentType('text/html');
+setContentType('text/html');
 
 // No hash provided by default
 $URL = 'modules.php?module=index';
index 744aadb..dcdf01e 100644 (file)
@@ -2292,11 +2292,8 @@ function app_die ($F, $L, $message) {
                // Make sure, that the script realy realy diese here and now
                $GLOBALS['app_died'] = true;
 
-               // Set content type if not set
-               if (!isContentTypeSet()) {
-                       // text/html is the right one
-                       setContentType('text/html');
-               } // END - if
+               // Set content type as text/html
+               setContentType('text/html');
 
                // Load header
                loadIncludeOnce('inc/header.php');
index 019b564..24c0db7 100644 (file)
@@ -39,7 +39,7 @@
 // Some security stuff...
 if ((!defined('__SECURITY')) || (!isAdmin())) {
        die();
-}
+} // END - if
 
 // Add description as navigation point
 addMenuDescription('admin', __FILE__);
@@ -97,7 +97,7 @@ if (isExtensionActive('online')) {
 
                // Remember rows and fancy time in array
                $content['rows']           = $OUT;
-               $content['online_timeout'] = getMaskedMessage('ONLINE_TIMEOUT_IS');
+               $content['online_timeout'] = getMessage('ONLINE_TIMEOUT_IS');
 
                // Load footer template
                loadTemplate('admin_list_online', false, $content);
index 827231b..98c7d4e 100644 (file)
@@ -61,46 +61,49 @@ if ((isFormSent()) && (isRegistrationDataComplete())) {
        // Output success registration
        loadTemplate('admin_settings_saved', false, getMessage('REGISTRATION_DONE'));
 } else {
-       if (postRequestParameter('agree') == '!') {
-               registerOutputFailedMessage('HAVE_TO_AGREE');
-       } // END - if
-
-       if (postRequestParameter('email') == '!') {
-               registerOutputFailedMessage('ENTER_EMAIL');
-               setPostRequestParameter('email', '');
-       } elseif (postRequestParameter('email') == '?') {
-               registerOutputFailedMessage('EMAIL_ALREADY_DB');
-               setPostRequestParameter('email', '');
-       }
-
-       if (postRequestParameter('surname') == '!') {
-               registerOutputFailedMessage('ENTER_SURNAME');
-               setPostRequestParameter('surname', '');
-       } // END - if
-
-       if (postRequestParameter('family') == '!') {
-               registerOutputFailedMessage('ENTER_FAMILY');
-               setPostRequestParameter('family', '');
-       } // END - if
-
-       if ((postRequestParameter('pass1') == '!') && (postRequestParameter('pass2') == '!')) {
-               registerOutputFailedMessage('ENTER_BOTH_PASSWORDS');
-       } elseif (postRequestParameter('pass1') == '!') {
-               registerOutputFailedMessage('ENTER_PASS1');
-       } elseif (postRequestParameter('pass2') == '!') {
-               registerOutputFailedMessage('ENTER_PASS2');
-       }
-
-       if ($GLOBALS['registration_short_password'] === true) {
-               registerOutputFailedMessage('SHORT_PASS', ': ' . getConfig('pass_len'));
-       } // END - if
-
-       if ($GLOBALS['registration_ip_timeout'] === true) {
-               registerOutputFailedMessage('REMOTE_ADDR_TIMEOUT');
-       } // END - if
-
-       if ((!empty($GLOBALS['register_selected_cats'])) && ($GLOBALS['register_selected_cats'] < getConfig('least_cats'))) {
-               registerOutputFailedMessage('', getMessage('CATS_LEAST'));
+       // Do this only if form is sent
+       if (isFormSent()) {
+               if (postRequestParameter('agree') == '!') {
+                       registerOutputFailedMessage('HAVE_TO_AGREE');
+               } // END - if
+
+               if (postRequestParameter('email') == '!') {
+                       registerOutputFailedMessage('ENTER_EMAIL');
+                       setPostRequestParameter('email', '');
+               } elseif (postRequestParameter('email') == '?') {
+                       registerOutputFailedMessage('EMAIL_ALREADY_DB');
+                       setPostRequestParameter('email', '');
+               }
+
+               if (postRequestParameter('surname') == '!') {
+                       registerOutputFailedMessage('ENTER_SURNAME');
+                       setPostRequestParameter('surname', '');
+               } // END - if
+
+               if (postRequestParameter('family') == '!') {
+                       registerOutputFailedMessage('ENTER_FAMILY');
+                       setPostRequestParameter('family', '');
+               } // END - if
+
+               if ((postRequestParameter('pass1') == '!') && (postRequestParameter('pass2') == '!')) {
+                       registerOutputFailedMessage('ENTER_BOTH_PASSWORDS');
+               } elseif (postRequestParameter('pass1') == '!') {
+                       registerOutputFailedMessage('ENTER_PASS1');
+               } elseif (postRequestParameter('pass2') == '!') {
+                       registerOutputFailedMessage('ENTER_PASS2');
+               }
+
+               if ((isset($GLOBALS['registration_short_password'])) && ($GLOBALS['registration_short_password'] === true)) {
+                       registerOutputFailedMessage('SHORT_PASS', ': ' . getConfig('pass_len'));
+               } // END - if
+
+               if ((isset($GLOBALS['registration_ip_timeout'])) && ($GLOBALS['registration_ip_timeout'] === true)) {
+                       registerOutputFailedMessage('REMOTE_ADDR_TIMEOUT');
+               } // END - if
+
+               if ((!empty($GLOBALS['register_selected_cats'])) && ($GLOBALS['register_selected_cats'] < getConfig('least_cats'))) {
+                       registerOutputFailedMessage('', getMessage('CATS_LEAST'));
+               } // END - if
        } // END - if
 
        // Generate birthday selection
diff --git a/js.php b/js.php
index 6cdea2a..b12d527 100644 (file)
--- a/js.php
+++ b/js.php
@@ -55,11 +55,11 @@ $GLOBALS['module'] = 'js';
 // Load the required file(s)
 require('inc/config-global.php');
 
+// Set header
+setContentType('text/javascript');
+
 // Is 'js' is provied?
 if (isGetRequestParameterSet('js')) {
-       // Set header
-       setContentType('text/javascript');
-
        // Load header
        loadIncludeOnce('inc/header.php');
 
diff --git a/ref.php b/ref.php
index f3fa259..a475c51 100644 (file)
--- a/ref.php
+++ b/ref.php
@@ -47,7 +47,7 @@ $GLOBALS['output_mode'] = -1;
 require('inc/config-global.php');
 
 // Set content type for e.g. search engines
-if (isSpider()) setContentType('text/html');
+setContentType('text/html');
 
 // No refid by default
 $URL = 'modules.php?module=index';
index 875728f..c6301e3 100644 (file)
@@ -48,7 +48,7 @@ $GLOBALS['output_mode'] = -2;
 require('inc/config-global.php');
 
 // Set content type for e.g. search engines
-if (isSpider()) setContentType('text/html');
+setContentType('text/html');
 
 // No hash provided by default
 $URL = 'modules.php?module=index';
index 6fccdfd..8f732c0 100644 (file)
@@ -48,7 +48,7 @@ $GLOBALS['output_mode'] = -2;
 require('inc/config-global.php');
 
 // Set content type for e.g. search engines
-if (isSpider()) setContentType('text/html');
+setContentType('text/html');
 
 // Base URL for redirection
 $URL = 'modules.php?module=index&amp;what=sponsor_reg&amp;refid=';