diff -urp holding/README.txt holdingNEW/README.txt
--- holding/README.txt	2009-08-13 19:17:38.000000000 -0500
+++ holdingNEW/README.txt	2010-06-17 21:15:28.000000000 -0500
@@ -1,15 +1,15 @@
 # $Id: README.txt,v 1.1.2.1 2009/08/13 18:17:37 joachim Exp $
 
 Introduction
-============
+=================
 The Holding page module lets you show visitors a static holding page while you work on setting the site or making changes. This gives you more flexibility than Drupal's site maintenance mode, as you can show your own HTML page or even a small site made up of a set of pages.
 
 Installation
-============
+=================
 Enable the module as normal.
 
 Setup
-============
+=================
 Go to admin/settings/holding to set the module up.
 
 The settings are:
@@ -19,14 +19,22 @@ The settings are:
   The path to the file that Drupal should return instead of your site. This is relative to Drupal root.
   You need to give the full filename, not just a path as there is no directory indexing involved.
   Examples: 'holding/index.html', 'sites/all/themes/YOURTHEME/holding/index.html'.
+- Parse holding page for tokens
+  Checking this box will invoke the Token module (if installed and enabled) and replace known tokens. Details of which can be found at admin/help/token
+
+Additional Tokens
+=================
+This module also introduces a new type of Token called 'server'. This simply implements the values of the predefined php variable $_SERVER.
+Simply pass the same index value (http://php.net/manual/en/reserved.variables.server.php), except in lower case, for the Token to be replaced.
+For example [http_host] will be replaced by the domain name of the site including the www. Eg. www.example.com
 
 Usage
-============
+=================
 All paths that begin with /user and /admin are allowed through to the Drupal site: this is to prevent locking yourself out.
 All logged-in users are allowed through.
 
 Examples
-============
+=================
 Single site: 
   - Set holding to 'default'. Anonymous users who wish to see the real site can use an IP to reach it.
 Multisites:
@@ -36,7 +44,7 @@ Multisites:
      You can then set holding to 'example.com' and work at dev.example.com.
 
 Notes
-============
+=================
 Any URLs in your holding pagess should be relative to Drupal root:
   <imc src="holding/image.jpg">
   <a href="holding/page2.html">
diff -urp holding/holding.info holdingNEW/holding.info
--- holding/holding.info	2009-09-23 16:16:10.000000000 -0500
+++ holdingNEW/holding.info	2010-06-17 21:17:08.000000000 -0500
@@ -1,5 +1,5 @@
 ; $Id: holding.info,v 1.1 2009/08/13 13:17:33 joachim Exp $
-name = Holding page
+name = Holding Page
 description = Display a holding page or site for anonymous users.
 core = 6.x
 
diff -urp holding/holding.install holdingNEW/holding.install
--- holding/holding.install	2009-08-13 14:17:34.000000000 -0500
+++ holdingNEW/holding.install	2010-06-17 21:17:48.000000000 -0500
@@ -12,6 +12,7 @@
 function holding_uninstall() {
   variable_del('holding_sites');
   variable_del('holding_page');
+  variable_del('holding_parse_state');
 }
 
 
diff -urp holding/holding.module holdingNEW/holding.module
--- holding/holding.module	2009-09-23 16:07:32.000000000 -0500
+++ holdingNEW/holding.module	2010-06-17 23:06:18.000000000 -0500
@@ -1,5 +1,5 @@
 <?php
-// $Id: holding.module,v 1.1.2.10 2009/09/23 15:07:32 joachim Exp $
+// $Id: holding.module,v 1.3 2010/06/17 16:40:00 joachim,corneloues Exp $
 
 /**
  * @file holding.module
@@ -15,7 +15,8 @@
 /**
  * Implementation of hook_boot().
  *
- * Show the holding page if needed.
+ * All the pre-display checks.
+ * Will also display the holding page if token replacement is not required.
  */
 function holding_boot() {
   // Allow logged in users through.
@@ -41,7 +42,43 @@ function holding_boot() {
       return;
     }
   }
+  
+  $holding_parse_state = variable_get('holding_parse_state', 0);
+  
+  if (!$holding_parse_state) {
+    print "boot";
+    holding_display($holding_parse_state);
+  }
+
+  exit;
+}
+
+/**
+ * Implementation of hook_init().
+ *
+ * Show the holding page if token replacement is required.
+ */
+function holding_init() {
+  // Allow login and admin, otherwise you could totally lock yourself out.
+  if (!empty($_GET['q'])) {
+    list($path_base, ) = explode('/', $_GET['q']);
+    if (in_array($path_base, array('admin', 'user'))) {
+      return;
+    }
+  }
+  
+  print "init";
+  holding_display(variable_get('holding_parse_state', 0));
+  
+  exit;
+}
 
+/**
+ * holding_display().
+ *
+ * Show the holding page if needed.
+ */
+function holding_display($parse) {
   // Now check the requested site.
   $site = substr(conf_path(), 6);
   $holding_sites = unserialize(variable_get('holding_sites', ''));
@@ -55,11 +92,18 @@ function holding_boot() {
       return;
     }
 
-    drupal_page_header();
     $output = file_get_contents($holding_page);
-    print $output;
 
-    exit;
+    // If required, parse the holding page for global and node tokens
+    if (module_exists('token') and $parse) {
+      $output = token_replace($output, 'server');
+      $output = token_replace($output, 'global');
+      $output = token_replace($output, 'user');
+      $output = token_replace($output, 'node');
+    }
+    
+    drupal_page_header();
+    print $output;
   }
 }
 
@@ -68,7 +112,7 @@ function holding_boot() {
  */
 function holding_menu() {
   $items['admin/settings/holding'] = array(
-    'title' => 'Holding page',
+    'title' => 'Holding Page',
     'description' => 'Settings for the site domain holding page.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('holding_admin'),
@@ -96,6 +140,14 @@ function holding_admin($form_state) {
     '#default_value' => variable_get('holding_page', ''),
   );
 
+  // New for v1.3
+  $form['holding_parse_state'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Parse holding page for tokens'),
+    '#description' => t("Tick to parse the holding page for the tokens. The Token module is required for this."),
+    '#default_value' => variable_get('holding_parse_state', 0),
+  );
+
   $form['#submit'][] = 'holding_admin_submit';
   return system_settings_form($form);
 }
@@ -135,3 +187,101 @@ function holding_admin_submit($form_id, 
   $sites = array_map('trim', explode("\n", $form_state['values']['holding_sites']));
   $form_state['values']['holding_sites'] = serialize($sites);
 }
+
+/**
+ * Implementation of token_token_values().
+ *
+ * New For v1.3 - Replaces the hook_boot() with hook_init()
+ *
+ * Adds support for the predefined php variable $_SERVER
+ */
+function holding_token_values($type, $object = NULL, $options = array()) {
+  if ($type == 'server') {
+    $tokens['php_self']             = $_SERVER['PHP_SELF'];
+    $tokens['argv']                 = $_SERVER['argv'];
+    $tokens['argc']                 = $_SERVER['argc'];
+    $tokens['gateway_interface)']   = $_SERVER['GATEWAY_INTERFACE'];
+    $tokens['server_addr']          = $_SERVER['SERVER_ADDR'];
+    $tokens['server_name']          = $_SERVER['SERVER_NAME'];
+    $tokens['server_software']      = $_SERVER['SERVER_SOFTWARE'];
+    $tokens['server_protocol']      = $_SERVER['SERVER_PROTOCOL'];
+    $tokens['request_method']       = $_SERVER['REQUEST_METHOD'];
+    $tokens['request_time']         = $_SERVER['REQUEST_TIME'];
+    $tokens['query_string']         = $_SERVER['QUERY_STRING'];
+    $tokens['document_root']        = $_SERVER['DOCUMENT_ROOT'];
+    $tokens['http_accept']          = $_SERVER['HTTP_ACCEPT'];
+    $tokens['http_accept_charset']  = $_SERVER['HTTP_ACCEPT_CHARSET'];
+    $tokens['http_accept_encoding'] = $_SERVER['HTTP_ACCEPT_ENCODING'];
+    $tokens['http_accept_language'] = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
+    $tokens['http_connection']      = $_SERVER['HTTP_CONNECTION'];
+    $tokens['http_host']            = $_SERVER['HTTP_HOST'];
+    $tokens['http_referer']         = $_SERVER['HTTP_REFERER'];
+    $tokens['http_user_agent']      = $_SERVER['HTTP_USER_AGENT'];
+    $tokens['https']                = $_SERVER['HTTPS'];
+    $tokens['remote_addr']          = $_SERVER['REMOTE_ADDR'];
+    $tokens['remote_host']          = $_SERVER['REMOTE_HOST'];
+    $tokens['remote_port']          = $_SERVER['REMOTE_PORT'];
+    $tokens['script_filename']      = $_SERVER['SCRIPT_FILENAME'];
+    $tokens['server_admin']         = $_SERVER['SERVER_ADMIN'];
+    $tokens['server_port']          = $_SERVER['SERVER_PORT'];
+    $tokens['server_signature']     = $_SERVER['SERVER_SIGNATURE'];
+    $tokens['path_translated']      = $_SERVER['PATH_TRANSLATED'];
+    $tokens['script_name']          = $_SERVER['SCRIPT_NAME'];
+    $tokens['request_uri']          = $_SERVER['REQUEST_URI'];
+    $tokens['php_auth_digest']      = $_SERVER['PHP_AUTH_DIGEST'];
+    $tokens['php_auth_digest']      = $_SERVER['PHP_AUTH_USER'];
+    $tokens['php_auth_pw']          = $_SERVER['PHP_AUTH_PW'];
+    $tokens['auth_type']            = $_SERVER['AUTH_TYPE'];
+    $tokens['path_info']            = $_SERVER['PATH_INFO'];
+    $tokens['orig_path_info']       = $_SERVER['ORIG_PATH_INFO'];
+    return $tokens;
+  }
+}
+
+/**
+ * Implementation of token_token_values().
+ *
+ * Provides a list of the tokens for the admin/help/token page
+ */
+function holding_token_list($type = 'all') {
+  if ($type == 'server' || $type == 'all') {
+    $tokens['server']['php_self']             = t("The filename of the currently executing script, relative to the document root.");
+    $tokens['server']['argv']                 = t("Array of arguments passed to the script.");
+    $tokens['server']['argc']                 = t("Contains the number of command line parameters passed to the script.");
+    $tokens['server']['gateway_interface)']   = t("What revision of the CGI specification the server is using.");
+    $tokens['server']['server_addr']          = t("The IP address of the server under which the current script is executing.");
+    $tokens['server']['server_name']          = t("The name of the server host under which the current script is executing.");
+    $tokens['server']['server_software']      = t("Server identification string, given in the headers when responding to requests.");
+    $tokens['server']['server_protocol']      = t("Name and revision of the information protocol via which the page was requested.");
+    $tokens['server']['request_method']       = t("Which request method was used to access the page.");
+    $tokens['server']['request_time']         = t("The timestamp of the start of the request.");
+    $tokens['server']['query_string']         = t("The query string, if any, via which the page was accessed.");
+    $tokens['server']['document_root']        = t("The document root directory under which the current script is executing.");
+    $tokens['server']['http_accept']          = t("Contents of the Accept: header from the current request.");
+    $tokens['server']['http_accept_charset']  = t("Contents of the Accept-Charset: header from the current request.");
+    $tokens['server']['http_accept_encoding'] = t("Contents of the Accept-Encoding: header from the current request.");
+    $tokens['server']['http_accept_language'] = t("Contents of the Accept-Language: header from the current request.");
+    $tokens['server']['http_connection']      = t("Contents of the Connection: header from the current request.");
+    $tokens['server']['http_host']            = t("Contents of the Host: header from the current request, if there is one.");
+    $tokens['server']['http_referer']         = t("The address of the page (if any) which referred the user agent to the current page");
+    $tokens['server']['http_user_agent']      = t("Contents of the User-Agent: header from the current request.");
+    $tokens['server']['https']                = t("Set to a non-empty value if the script was queried through the HTTPS protocol.");
+    $tokens['server']['remote_addr']          = t("The IP address from which the user is viewing the current page.");
+    $tokens['server']['remote_host']          = t("The Host name from which the user is viewing the current page");
+    $tokens['server']['remote_port']          = t("The port being used on the user's machine to communicate with the web server.");
+    $tokens['server']['script_filename']      = t("The absolute pathname of the currently executing script.");
+    $tokens['server']['server_admin']         = t("The value given to the SERVER_ADMIN (for Apache) directive in the web server configuration file.");
+    $tokens['server']['server_port']          = t("The port on the server machine being used by the web server for communication.");
+    $tokens['server']['server_signature']     = t("String containing the server version and virtual host name which are added to server-generated pages.");
+    $tokens['server']['path_translated']      = t("Filesystem- (not document root-) based path to the current script, after the server has done any virtual-to-real mapping.");
+    $tokens['server']['script_name']          = t("Contains the current script's path.");
+    $tokens['server']['request_uri']          = t("The URI which was given in order to access this page.");
+    $tokens['server']['php_auth_digest']      = t("When running under Apache as module doing Digest HTTP authentication this variable is set to the 'Authorization' header sent by the client.");
+    $tokens['server']['php_auth_digest']      = t("When running under Apache or IIS (ISAPI on PHP 5) as module doing HTTP authentication this variable is set to the username provided by the user.");
+    $tokens['server']['php_auth_pw']          = t("When running under Apache or IIS (ISAPI on PHP 5) as module doing HTTP authentication this variable is set to the password provided by the user.");
+    $tokens['server']['auth_type']            = t("When running under Apache as module doing HTTP authenticated this variable is set to the authentication type.");
+    $tokens['server']['path_info']            = t("Contains any client-provided pathname information trailing the actual script filename but preceding the query string.");
+    $tokens['server']['orig_path_info']       = t("Original version of 'PATH_INFO' before processed by PHP.");
+    return $tokens;
+  }
+}
\ No newline at end of file
