Began to rewrite whole script for newly added filters, new extension stub 'network...
[mailer.git] / inc / functions.php
index 992c4a7373af6cc475fd21b82865921d640073eb..999c6e8e64c792af404dce3b14196a2a5f5fe32d 100644 (file)
@@ -239,6 +239,11 @@ function LOAD_TEMPLATE($template, $return=false, $content=array()) {
                $_CONFIG['num_templates']++;
        }
 
+       // Prepare IP number and User Agent
+       $REMOTE_ADDR     = GET_REMOTE_ADDR();
+       if (!defined('REMOTE_ADDR')) define('REMOTE_ADDR', $REMOTE_ADDR);
+       $HTTP_USER_AGENT = GET_USER_AGENT();
+
        // Init some data
        $ret = "";
        if (empty($GLOBALS['refid'])) $GLOBALS['refid'] = 0;
@@ -2824,7 +2829,7 @@ function DETERMINE_REFID () {
 }
 
 // Destroys the admin session
-function DESTROY_ADMIN_SESSION () {
+function DESTROY_ADMIN_SESSION ($destroy = true) {
        // Kill maybe existing session variables including array elements
        set_session('admin_login', "");
        set_session('admin_md5'  , "");
@@ -2832,7 +2837,12 @@ function DESTROY_ADMIN_SESSION () {
        set_session('admin_to'   , "");
 
        // Destroy session and return status
-       return @session_destroy();
+       if ($destroy) {
+               return @session_destroy();
+       } // END - if
+
+       // All fine if we shall not really destroy the session
+       return true;
 }
 
 // Checks if a given apache module is loaded