$now = gmdate('D, d M Y H:i:s') . ' GMT';
// Send HTTP header
- sendHeader('HTTP/1.1 200 OK');
+ sendHeader('HTTP/1.1 ' . getHttpStatus());
// General headers for no caching
sendHeader('Expires: ' . $now); // RFC2616 - Section 14.21
// Rewrite message for output
$message = sprintf(getMessage('MAILER_HAS_DIED'), basename($F), $L, $message);
- // We don't want to log messages from debug_report_bug() itself...
- if ($F != 'debug_report_bug') {
- // Better log this message away
- logDebugMessage($F, $L, $message);
- } // END - if
-
// Load the message template
loadTemplate('app_die_message', false, $message);
// Is the header already sent?
if (($GLOBALS['header_sent'] != 1) && ($GLOBALS['header_sent'] != 2)) {
+ // Set default HTTP status to "200 OK"
+ setHttpStatus('200 OK');
+
// If not in CSS mode generate the header
if (getOutputMode() != 1) {
// Prepare the header for HTML output
return compileCode($code, false, true, $full);
}
+// Setter for HTTP status
+function setHttpStatus ($status) {
+ $GLOBALS['http_status'] = (string) $status;
+}
+
+// Getter for HTTP status
+function getHttpStatus () {
+ return $GLOBALS['http_status'];
+}
+
// [EOF]
?>
// 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('MODULE_REGISTRY_404', getModule()));
}
break;
case '404':
+ // 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('MODULE_REGISTRY_404', getModule()));
} // END - if
break;
default:
+ // Unknown module status
logDebugMessage(__FILE__, __LINE__, sprintf("Unknown status %s return from module check. Module=%s", $check, getModule()));
addFatalMessage(__FILE__, __LINE__, getMaskedMessage('UNKNOWN_MODULE_STATUS', $check));
break;