Deprecated variables for templates removed, mor EL-rewrites, getMessage() rewritten:
[mailer.git] / modules.php
index f2d1639a6c88f7e1554c53df40caec2c1f67dcbd..796b1e8128191000cc04810ef640d0afc45390f7 100644 (file)
@@ -76,7 +76,7 @@ $check = 'failed';
 // Is the maintenance mode active or goes all well?
 if ((isExtensionActive('maintenance')) && (getConfig('maintenance') == 'Y') && (!isAdmin()) && (getModule() != 'admin')) {
        // Maintain mode is active and you are no admin
-       addFatalMessage(__FILE__, __LINE__, getMessage('LANG_DOWN_MAINTAINCE'));
+       addFatalMessage(__FILE__, __LINE__, getMessage('MAILER_DOWN_FOR_MAINTENANCE'));
 } elseif ((SQL_IS_LINK_UP()) && (!ifFatalErrorsDetected())) {
        // Construct module name
        $GLOBALS['module_inc'] =  sprintf("inc/modules/%s.php", getModule());
@@ -93,32 +93,46 @@ if ((isExtensionActive('maintenance')) && (getConfig('maintenance') == 'Y') && (
                                // Module is valid, active and located on the local disc...
                                $isModuleValid = true;
                        } elseif (!ifFatalErrorsDetected()) {
+                               // Set HTTP status
+                               setHttpStatus('404');
+
                                // Module not found!
-                               addFatalMessage(__FILE__, __LINE__, getMaskedMessage('LANG_MOD_REG_404', getModule()));
+                               addFatalMessage(__FILE__, __LINE__, getMaskedMessage('MODULE_REGISTRY_404', getModule()));
                        }
                        break;
 
                case '404':
-                       addFatalMessage(__FILE__, __LINE__, getMaskedMessage('LANG_MOD_REG_404', getModule()));
+                       // Set HTTP status
+                       setHttpStatus('404');
+
+                       // Add fatal message
+                       addFatalMessage(__FILE__, __LINE__, getMaskedMessage('MODULE_REGISTRY_404', getModule()));
                        break;
 
                case 'locked':
+                       // Set HTTP status
+                       setHttpStatus('403');
+
                        if (!isIncludeReadable($GLOBALS['module_inc'])) {
+                               // Set HTTP status
+                               setHttpStatus('404');
+
                                // Module does addionally not exists
-                               addFatalMessage(__FILE__, __LINE__, getMaskedMessage('LANG_MOD_REG_404', getModule()));
+                               addFatalMessage(__FILE__, __LINE__, getMaskedMessage('MODULE_REGISTRY_404', getModule()));
                        } // END - if
 
                        // Add fatal message
-                       addFatalMessage(__FILE__, __LINE__, getMaskedMessage('LANG_MOD_REG_LOCKED', getModule()));
+                       addFatalMessage(__FILE__, __LINE__, getMaskedMessage('MODULE_IS_LOCKED', getModule()));
                        break;
 
                default:
+                       // Unknown module status
                        logDebugMessage(__FILE__, __LINE__, sprintf("Unknown status %s return from module check. Module=%s", $check, getModule()));
-                       addFatalMessage(__FILE__, __LINE__, getMaskedMessage('LANG_MOD_REG_UNKNOWN', $check));
+                       addFatalMessage(__FILE__, __LINE__, getMaskedMessage('UNKNOWN_MODULE_STATUS', $check));
                        break;
        } // END - switch
 } elseif (!ifFatalErrorsDetected()) {
-       // MySQL problems!
+       // MySQL problems detected
        addFatalMessage(__FILE__, __LINE__, getMessage('MYSQL_ERRORS'));
 }