From: Michael J. Rubinsky Date: Sat, 14 Feb 2009 18:03:35 +0000 (-0500) Subject: Slight hack to force maintanence tasks to be ignored if base.php X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=bb0bb35cc56d7f906656a86b53a47876b9d40346;p=horde.git Slight hack to force maintanence tasks to be ignored if base.php 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. --- diff --git a/kronolith/lib/Block/month.php b/kronolith/lib/Block/month.php index e280f8fa8..3c3ac2478 100644 --- a/kronolith/lib/Block/month.php +++ b/kronolith/lib/Block/month.php @@ -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'; diff --git a/kronolith/lib/Block/monthlist.php b/kronolith/lib/Block/monthlist.php index f87c7583b..f625b6df3 100644 --- a/kronolith/lib/Block/monthlist.php +++ b/kronolith/lib/Block/monthlist.php @@ -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'; diff --git a/kronolith/lib/Block/prevmonthlist.php b/kronolith/lib/Block/prevmonthlist.php index 4e86767f6..b78ec8985 100644 --- a/kronolith/lib/Block/prevmonthlist.php +++ b/kronolith/lib/Block/prevmonthlist.php @@ -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'))); diff --git a/kronolith/lib/Block/summary.php b/kronolith/lib/Block/summary.php index 46e277a94..c6602d3c0 100644 --- a/kronolith/lib/Block/summary.php +++ b/kronolith/lib/Block/summary.php @@ -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'; diff --git a/kronolith/lib/base.php b/kronolith/lib/base.php index a1801881b..0d30d21a6 100644 --- a/kronolith/lib/base.php +++ b/kronolith/lib/base.php @@ -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')) {