// Load a template file and return it's content (only it's name; do not use ' or ")
function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
// Add more variables which you want to use in your template files
- global $DATA, $_CONFIG, $username;
+ global $DATA, $username;
+
+ // Get whole config array
+ $_CONFIG = getConfigArray();
// Make all template names lowercase
$template = strtolower($template);
if ((substr($URL, 0, 7) != "http://") && (substr($URL, 0, 8) != "https://")) {
// Make all URLs full-qualified
$URL = "".$URL;
- }
+ } // END - if
- // Get output buffer
+ // Three different debug ways...
//* DEBUG: */ debug_report_bug(sprintf("%s[%s:] URL=%s", __FUNCTION__, __LINE__, $URL));
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, $URL);
+ //* DEBUG: */ die($URL);
+
+ // Get output buffer
$OUTPUT = ob_get_contents();
// Clear it only if there is content
LOAD_TEMPLATE("redirect_url", false, str_replace("&", "&", $URL));
LOAD_INC("inc/footer.php");
}
+
+ // Shut the mailer down here
shutdown();
}
// Generates an error code from given account status
function GEN_ERROR_CODE_FROM_ACCOUNT_STATUS ($status) {
// Default error code if unknown account status
- $ERROR = getCode('UNKNOWN_STATUS');
+ $errorCode = getCode('UNKNOWN_STATUS');
// Generate constant name
$constantName = sprintf("ID_%s", $status);
// Is the constant there?
if (isCodeSet($constantName)) {
// Then get it!
- $ERROR = getCode($constantName);
+ $errorCode = getCode($constantName);
} else {
// Unknown status
DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unknown error status %s detected.", $status));
}
// Return error code
- return $ERROR;
+ return $errorCode;
}
// Clears the output buffer. This function does *NOT* backup sent content.
$admin = "<span class=\"admin_note\">{--ADMIN_NO_ADMIN_ASSIGNED--}</span>";
// Zero? = Not assigned
- if ($aid > 0) {
+ if (bigintval($aid) > 0) {
// Load admin's login
$login = GET_ADMIN_LOGIN($aid);
+
+ // Is the login valid?
if ($login != "***") {
// Is the extension there?
if (EXT_IS_ACTIVE("admins")) {
// Log this message away
$fp = fopen(constant('PATH')."inc/cache/debug.log", 'a') or app_die(__FUNCTION__, __LINE__, "Cannot write logfile debug.log!");
- fwrite($fp, date("d.m.Y|H:i:s", time())."|".basename($funcFile)."|".$line."|".strip_tags($message)."\n");
+ fwrite($fp, date("d.m.Y|H:i:s", time())."|".$GLOBALS['module']."|".basename($funcFile)."|".$line."|".strip_tags($message)."\n");
fclose($fp);
} // END - if
}