Slight hack to force maintanence tasks to be ignored if base.php
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 14 Feb 2009 18:03:35 +0000 (13:03 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 14 Feb 2009 18:03:35 +0000 (13:03 -0500)
is being loaded from a kronolith block.  This fixes the dimp portal
page not loading if a kronolith block is present.

Maintenance needs to be refactored to be more of a central service
and not a per-app function.

kronolith/lib/Block/month.php
kronolith/lib/Block/monthlist.php
kronolith/lib/Block/prevmonthlist.php
kronolith/lib/Block/summary.php
kronolith/lib/base.php

index e280f8f..3c3ac24 100644 (file)
@@ -62,6 +62,9 @@ class Horde_Block_Kronolith_month extends Horde_Block {
     function _content()
     {
         global $prefs;
+
+        // @TODO Remove this hack when maintenance is refactored.
+        $from_block = true;
         require_once dirname(__FILE__) . '/../base.php';
         require_once KRONOLITH_BASE . '/lib/Day.php';
 
index f87c758..f625b6d 100644 (file)
@@ -58,6 +58,8 @@ class Horde_Block_Kronolith_monthlist extends Horde_Block {
      */
     function _content()
     {
+        // @TODO Remove this hack when maintenance is refactored.
+        $from_block = true;
         require_once dirname(__FILE__) . '/../base.php';
         require_once KRONOLITH_BASE . '/lib/Day.php';
 
index 4e86767..b78ec89 100644 (file)
@@ -54,11 +54,15 @@ class Horde_Block_Kronolith_prevmonthlist extends Horde_Block {
      */
     function _content()
     {
+        // @TODO Remove this hack when maintenance is refactored.
+        $from_block = true;
         require_once dirname(__FILE__) . '/../base.php';
         require_once KRONOLITH_BASE . '/lib/Day.php';
 
         global $registry, $prefs;
 
+        $GLOBALS['from_block'] = true;
+
         Horde::addScriptFile('tooltip.js', 'horde', true);
 
         $startDate = new Horde_Date(array('year' => date('Y'), 'month' => date('n') - $this->_params['months'], 'mday' => date('j')));
index 46e277a..c6602d3 100644 (file)
@@ -17,6 +17,7 @@ class Horde_Block_Kronolith_summary extends Horde_Block {
     function _params()
     {
         @define('KRONOLITH_BASE', dirname(__FILE__) . '/../..');
+
         require_once KRONOLITH_BASE . '/lib/base.php';
 
         $params = array('calendar' => array('name' => _("Calendar"),
@@ -58,6 +59,9 @@ class Horde_Block_Kronolith_summary extends Horde_Block {
     function _content()
     {
         global $registry, $prefs;
+
+        // @TODO Remove this hack when maintenance is refactored.
+        $from_block = true;
         require_once dirname(__FILE__) . '/../base.php';
         require_once KRONOLITH_BASE . '/lib/Day.php';
 
index a180188..0d30d21 100644 (file)
@@ -82,13 +82,15 @@ $GLOBALS['kronolith_shares'] = &Horde_Share::singleton($registry->getApp());
 
 Kronolith::initialize();
 
+// TODO - Maintenance operations need to be refactored to a more global
+//        operation and then wen can get rid of these hackish checks
 /* Do maintenance operations - need to check for a number of conditions to be
  * sure that we aren't here due to alarm notifications (which would occur after
  * headers are sent), we aren't on any of the portal pages, and that we haven't
  * already performed maintenance.
  */
 require_once 'Horde/Maintenance.php';
-if (Kronolith::loginTasksFlag() &&
+if (empty($from_block) && Kronolith::loginTasksFlag() &&
     !strstr($_SERVER['PHP_SELF'], 'maintenance.php') &&
     !headers_sent() && !defined('AUTH_HANDLER') &&
     $GLOBALS['prefs']->getValue('do_maintenance')) {