]> git.mxchange.org Git - mailer.git/commitdiff
Missing HTTP status set, some minor rewrites
authorRoland Häder <roland@mxchange.org>
Wed, 3 Nov 2010 22:24:41 +0000 (22:24 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 3 Nov 2010 22:24:41 +0000 (22:24 +0000)
inc/extensions/ext-imprint.php
inc/functions.php
inc/module-functions.php
inc/modules/admin/what-extensions.php
inc/wrapper-functions.php
mailid.php
mailid_top.php
modules.php

index 5c842bd3c8ab01c2b072e6a24af6f7bc280fd258..4155fdf4926bafbd3e5b767bfeb42003760cd174 100644 (file)
@@ -46,6 +46,9 @@ setThisExtensionVersion('0.0');
 // Version history array (add more with , '0.1.0' and so on)
 setExtensionVersionHistory(array('0.0'));
 
+// This extension is in development (non-productive)
+enableExtensionProductive(false);
+
 switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
                // SQL commands to run
@@ -73,7 +76,7 @@ PRIMARY KEY (`imprint_id`)
 
                // Init imprint data
                addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_imprint_data` (`imprint_key`) VALUES ('company'),('surname'),('family'),('street_nr1'),('street_nr2'),('zip'),('city'),('state'),('country'),('phone'),('fax'),('email'),('footer')");
-               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_imprint_data` SET `imprint_value`='{?WEBMASTER?}' WHERE `imprint_key`='email' LIMIT 1");
+               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_imprint_data` SET `imprint_value`='{OPEN_CONFIG}WEBMASTER{CLOSE_CONFIG}' WHERE `imprint_key`='email' LIMIT 1");
                break;
 
        case 'remove': // Do stuff when removing extension
index 99ff9804f5ebc9e3fea65fc32852eb39ed54374f..8394f5f98c3e62932c4a10c59e4a06283368c0ad 100644 (file)
@@ -149,7 +149,9 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = '
        } // END - if
 
        // Fix HTML parameter (default is no!)
-       if (empty($isHtml)) $isHtml = 'N';
+       if (empty($isHtml)) {
+               $isHtml = 'N';
+       } // END - if
 
        // Debug mode enabled?
        if (isDebugModeEnabled()) {
index d0f00c8fa60c1f2602cd434fd4c4741d4f6ae60b..bf629eb46227b27e14d945201cbca2d8d04ffb82 100644 (file)
@@ -322,7 +322,7 @@ VALUES
                rebuildCache('modules', 'modules');
        } elseif ($found === false) {
                // Problem with module detected
-               logDebugMessage(__FUNCTION__, __LINE__, sprintf("Problem in module %s detected. ret=%s,locked=%d,hidden=%d,mem=%d,admin=%d,output_mode=%s",
+               logDebugMessage(__FUNCTION__, __LINE__, sprintf("Problem in module %s detected. getModuleStatus()=%s,locked=%d,hidden=%d,mem=%d,admin=%d,output_mode=%s",
                        $module_chk,
                        getModuleStatus($module_chk),
                        intval(isModuleLocked($module_chk)),
index 04d84cc623c372ec7849e7090bca57b3c7da6f22..88aefc57e2dc6ed629daa23455f95e8364788dbf 100644 (file)
@@ -188,7 +188,7 @@ if (isGetRequestParameterSet('reg_ext')) {
                        // Listing of SQLs enabled?
                        if (isVerboseSqlEnabled()) {
                                // Load SQL commands in remove mode
-                               if (loadExtension($ext_name, 'remove', '', true)) {
+                               if (loadExtension($ext_name, 'remove', '0.0', true)) {
                                        // Generate extra table with loaded SQL commands
                                        $VERBOSE_OUT = addExtensionVerboseSqlTable();
                                } // END - if
index 74f30d01b012a6e43b215658adaa12cdbf630e72..d910f8da2d136956ea73ca75feb66e755fc98666 100644 (file)
@@ -945,6 +945,13 @@ function setHttpStatus ($status) {
 
 // Getter for HTTP status
 function getHttpStatus () {
+       // Is the status set?
+       if (!isset($GLOBALS['http_status'])) {
+               // Abort here
+               debug_report_bug(__FUNCTION__, __LINE__, 'No HTTP status set!');
+       } // END - if
+
+       // Return it
        return $GLOBALS['http_status'];
 }
 
index 7f684cef9b477d1afb5f2a58c44aca8a119bec7e..417ad84f3a114161e65f941bd7d560b63fbd8d22 100644 (file)
@@ -49,8 +49,9 @@ $errorCode = '';
 // Load the required file(s)
 require('inc/config-global.php');
 
-// Set content type
+// Set content type and HTTP status
 setContentType('text/html');
+setHttpStatus('404 NOT FOUND');
 
 // Is the extension active?
 redirectOnUninstalledExtension('mailid');
@@ -181,6 +182,9 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr
                                                } // END - if
 
                                                if (($time > 0) && (($payment > 0) || ($points > 0))) {
+                                                       // Set HTTP status to okay
+                                                       setHttpStatus('200 OK');
+
                                                        // Export data into constants for the template
                                                        $content = array(
                                                                'userid'  => $userId,
index 8b812839c4f142799e26bf750395e0c4a1d7a7f7..c546edf28c41fe85e738809d0c9a81a636980911 100644 (file)
@@ -48,8 +48,9 @@ $GLOBALS['output_mode'] = -1;
 // Load the required file(s)
 require('inc/config-global.php');
 
-// Set content type
+// Set content type and HTTP status
 setContentType('text/html');
+setHttpStatus('404 NOT FOUND');
 
 // Is the extension mailid active?
 redirectOnUninstalledExtension('mailid');
@@ -240,6 +241,9 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr
 
                                                                        // Right code entered?
                                                                        if (bigintval(postRequestParameter('gfx_check')) == $img_code) {
+                                                                               // Set HTTP status to okay
+                                                                               setHttpStatus('200 OK');
+
                                                                                // Add points over referal system is the default
                                                                                $template = 'mailid_points_done';
 
index 3b6905a4ec08233841ebb512d81c966289cdd97f..6a0ab78b379b22399fb7dd34f02ce7b377b2d8ba 100644 (file)
@@ -107,11 +107,11 @@ if ((isExtensionActive('maintenance')) && (getConfig('maintenance') == 'Y') && (
 
                case 'locked':
                        // Set HTTP status
-                       setHttpStatus('403');
+                       setHttpStatus('403 FORBIDDEN');
 
                        if (!isIncludeReadable($GLOBALS['module_inc'])) {
-                               // Set HTTP status
-                               setHttpStatus('404');
+                               // Set HTTP status again
+                               setHttpStatus('404 NOT FOUND');
 
                                // Module does addionally not exists
                                addFatalMessage(__FILE__, __LINE__, getMaskedMessage('MODULE_REGISTRY_404', getModule()));