includes/template.php
changeset 30 7e8fd44b36b0
parent 29 e5484a9e0818
child 36 425261984266
--- a/includes/template.php	Thu Jun 28 11:13:39 2007 -0400
+++ b/includes/template.php	Thu Jun 28 13:49:40 2007 -0400
@@ -14,6 +14,15 @@
  
 class template {
   var $tpl_strings, $tpl_bool, $theme, $style, $no_headers, $additional_headers, $sidebar_extra, $sidebar_widgets, $toolbar_menu, $theme_list, $named_theme_list, $default_theme, $default_style, $plugin_blocks, $namespace_string, $style_list, $theme_loaded;
+  
+  /**
+   * Set to true if the site is disabled and thus a message needs to be shown. This should ONLY be changed by common.php.
+   * @var bool
+   * @access private
+   */
+  
+  var $site_disabled = false;
+  
   function __construct()
   {
     global $db, $session, $paths, $template, $plugins; // Common objects
@@ -756,6 +765,13 @@
       echo '<b>Your administrative session has timed out.</b> <a href="' . $login_link . '">Log in again</a>';
       echo '</div>';
     }
+    if ( $this->site_disabled && $session->user_level >= USER_LEVEL_ADMIN && ( $paths->page != $paths->nslist['Special'] . 'Administration' ) )
+    {
+      $admin_link = makeUrlNS('Special', 'Administration', 'module=' . $paths->nslist['Admin'] . 'GeneralConfig', true);
+      echo '<div class="usermessage"><b>The site is currently disabled and thus is only accessible to administrators.</b><br />
+            You can re-enable the site through the <a href="' . $admin_link . '">administration panel</a>.
+            </div>';
+    }
   }
   function footer($simple = false)
   {