From: Michael M Slusarz Date: Wed, 22 Jul 2009 19:09:04 +0000 (-0600) Subject: Use new Horde_Registry::pushApp() API. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=aa4586bb2a9d2dc82b43a703b977bb49f764a786;p=horde.git Use new Horde_Registry::pushApp() API. --- diff --git a/babel/lib/base.php b/babel/lib/base.php index bff2c7e32..b47384f7c 100644 --- a/babel/lib/base.php +++ b/babel/lib/base.php @@ -30,7 +30,7 @@ $notification->attach('status'); $registry = Horde_Registry::singleton(); try { - $registry->pushApp('babel', true); + $registry->pushApp('babel', array('logintasks' => true)); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('babel', $e); } diff --git a/chora/lib/base.php b/chora/lib/base.php index 751e7bc7c..23b4c7e06 100644 --- a/chora/lib/base.php +++ b/chora/lib/base.php @@ -32,7 +32,7 @@ require_once HORDE_BASE . '/lib/core.php'; // Registry $registry = Horde_Registry::singleton(); try { - $registry->pushApp('chora', true); + $registry->pushApp('chora', array('logintasks' => true)); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('chora', $e); } diff --git a/crumb/lib/base.php b/crumb/lib/base.php index f1647da47..e0585eae0 100644 --- a/crumb/lib/base.php +++ b/crumb/lib/base.php @@ -22,7 +22,7 @@ require_once HORDE_BASE . '/lib/core.php'; // Registry. $registry = Horde_Registry::singleton(); try { - $registry->pushApp('crumb', true); + $registry->pushApp('crumb', array('logintasks' => true)); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('crumb', $e); } diff --git a/fima/lib/base.php b/fima/lib/base.php index 8dbe7a07f..a44a14216 100644 --- a/fima/lib/base.php +++ b/fima/lib/base.php @@ -28,7 +28,7 @@ if ($session_control == 'none') { } try { - $registry->pushApp('fima', true); + $registry->pushApp('fima', array('logintasks' => true)); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('fima', $e); } diff --git a/folks/lib/base.php b/folks/lib/base.php index 0fd1cd179..31ab5587d 100644 --- a/folks/lib/base.php +++ b/folks/lib/base.php @@ -19,9 +19,8 @@ require_once HORDE_BASE . '/lib/core.php'; // Registry. $registry = Horde_Registry::singleton(); -$authentication = Horde_Util::nonInputVar('folks_authentication'); try { - $registry->pushApp('folks', ($authentication != 'none')); + $registry->pushApp('folks', array('check_perms' => (Horde_Util::nonInputVar('folks_authentication') != 'none'), 'logintasks' => true)); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('folks', $e); } diff --git a/imp/lib/base.php b/imp/lib/base.php index 56adfa266..0fa599591 100644 --- a/imp/lib/base.php +++ b/imp/lib/base.php @@ -78,7 +78,7 @@ if ($authentication == 'horde') { } try { - $registry->pushApp('imp', ($authentication != 'none')); + $registry->pushApp('imp', array('check_perms' => ($authentication != 'none'), 'logintasks' => true)); } catch (Horde_Exception $e) { if ($e->getCode() == Horde_Registry::AUTH_FAILURE) { if ($authentication == 'throw') { diff --git a/ingo/lib/base.php b/ingo/lib/base.php index 8332ebc7e..c29eaf398 100644 --- a/ingo/lib/base.php +++ b/ingo/lib/base.php @@ -28,9 +28,8 @@ require_once HORDE_BASE . '/lib/core.php'; // Registry. $registry = Horde_Registry::singleton(); -$authentication = Horde_Util::nonInputVar('ingo_authentication'); try { - $registry->pushApp('ingo', ($authentication != 'none')); + $registry->pushApp('ingo', array('check_perms' => (Horde_Util::nonInputVar('ingo_authentication') != 'none'), 'logintasks' => true)); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('ingo', $e); } diff --git a/jeta/lib/base.php b/jeta/lib/base.php index 9a6dfa670..bafb2ad83 100644 --- a/jeta/lib/base.php +++ b/jeta/lib/base.php @@ -20,7 +20,7 @@ require_once HORDE_BASE . '/lib/core.php'; // Registry. $registry = Horde_Registry::singleton(); try { - $registry->pushApp('jeta', true); + $registry->pushApp('jeta', array('logintasks' => true)); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('jeta', $e); } diff --git a/kastalia/download.php b/kastalia/download.php index df41b9a8f..85cef169c 100755 --- a/kastalia/download.php +++ b/kastalia/download.php @@ -32,7 +32,7 @@ require_once HORDE_BASE . '/lib/core.php'; // Registry. $registry = Horde_Registry::singleton(); try { - $registry->pushApp('kastalia', true); + $registry->pushApp('kastalia', array('logintasks' => true)); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('kastalia', $e); } diff --git a/kastalia/lib/base.php b/kastalia/lib/base.php index 0f9d5a668..1317f199c 100755 --- a/kastalia/lib/base.php +++ b/kastalia/lib/base.php @@ -22,7 +22,7 @@ require_once HORDE_BASE . '/lib/core.php'; // Registry. $registry = Horde_Registry::singleton(); try { - $registry->pushApp('kastalia', true); + $registry->pushApp('kastalia', array('logintasks' => true)); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('kastalia', $e); } diff --git a/kronolith/lib/base.php b/kronolith/lib/base.php index 57aa8897d..5e40d5954 100644 --- a/kronolith/lib/base.php +++ b/kronolith/lib/base.php @@ -38,9 +38,8 @@ case 'readonly': } $registry = Horde_Registry::singleton($s_ctrl); -$authentication = Horde_Util::nonInputVar('kronolith_authentication'); try { - $registry->pushApp('kronolith', ($authentication != 'none')); + $registry->pushApp('kronolith', array('check_perms' => (Horde_Util::nonInputVar('kronolith_authentication') != 'none'), 'logintasks' => true)); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('kronolith', $e); } diff --git a/news/lib/base.php b/news/lib/base.php index 51c640ad2..7dd89b7eb 100644 --- a/news/lib/base.php +++ b/news/lib/base.php @@ -24,9 +24,8 @@ require_once HORDE_BASE . '/lib/core.php'; // Registry. $registry = Horde_Registry::singleton(); -$authentication = Horde_Util::nonInputVar('news_authentication'); try { - $registry->pushApp('news', ($authentication != 'none')); + $registry->pushApp('news', array('check_perms' => (Horde_Util::nonInputVar('news_authentication') != 'none'), 'logintasks' => true)); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('news', $e); } diff --git a/skoli/lib/base.php b/skoli/lib/base.php index 2be1d354e..7e9de938e 100644 --- a/skoli/lib/base.php +++ b/skoli/lib/base.php @@ -19,9 +19,8 @@ require_once HORDE_BASE . '/lib/core.php'; // Registry. $registry = Horde_Registry::singleton(); -$authentication = Horde_Util::nonInputVar('skoli_authentication'); try { - $registry->pushApp('skoli', ($authentication != 'none')); + $registry->pushApp('skoli', array('check_perms' => (Horde_Util::nonInputVar('skoli_authentication') != 'none'), 'logintasks' => true)); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('skoli', $e); } diff --git a/timeobjects/lib/base.php b/timeobjects/lib/base.php index 6aef9330f..4ecc30d2b 100644 --- a/timeobjects/lib/base.php +++ b/timeobjects/lib/base.php @@ -31,7 +31,7 @@ if ($session_control == 'none') { } try { - $registry->pushApp('timeobjects', true); + $registry->pushApp('timeobjects', array('logintasks' => true)); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('timeobjects', $e); } diff --git a/turba/lib/base.php b/turba/lib/base.php index b669082a1..33b61d388 100644 --- a/turba/lib/base.php +++ b/turba/lib/base.php @@ -21,9 +21,8 @@ require_once HORDE_BASE . '/lib/core.php'; // Registry. $registry = Horde_Registry::singleton(); -$authentication = Horde_Util::nonInputVar('turba_authentication'); try { - $registry->pushApp('turba', ($authentication != 'none')); + $registry->pushApp('turba', array('check_perms' => (Horde_Util::nonInputVar('turba_authentication') != 'none'), 'logintasks' => true)); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('turba', $e); } diff --git a/turba/lib/tests/ApiTest.php b/turba/lib/tests/ApiTest.php index e33cf2b22..144ff7e7f 100644 --- a/turba/lib/tests/ApiTest.php +++ b/turba/lib/tests/ApiTest.php @@ -23,7 +23,7 @@ class Turba_ApiTest extends Turba_TestBase { /* HACK: ensure we've included this so that it won't get included * again, then override the globals it provides. */ try { - $pushed = $registry->pushApp('turba', false); + $pushed = $registry->pushApp('turba', array('check_perms' => false)); } catch (Horde_Exception $e) { return; } diff --git a/turba/lib/tests/BrowsePageTest.php b/turba/lib/tests/BrowsePageTest.php index e6d5d965b..fa3ae377a 100644 --- a/turba/lib/tests/BrowsePageTest.php +++ b/turba/lib/tests/BrowsePageTest.php @@ -57,7 +57,7 @@ class Turba_BrowsePageTest extends Turba_TestBase { function getPage() { - $this->_pageParams['registry']->pushApp('turba', false); + $this->_pageParams['registry']->pushApp('turba', array('check_perms' => false)); $this->fakeAuth(); $page = new Turba_BrowsePage($this->_pageParams); $this->_output = Horde_Util::bufferOutput(array($page, 'run')); diff --git a/turba/lib/tests/KolabTestBase.php b/turba/lib/tests/KolabTestBase.php index 44d17aa41..74cd6430e 100644 --- a/turba/lib/tests/KolabTestBase.php +++ b/turba/lib/tests/KolabTestBase.php @@ -140,15 +140,10 @@ class Turba_KolabTestBase extends Horde_Kolab_Test_Storage $this->assertTrue($world['auth']->authenticate('wrobel@example.org', array('password' => 'none'))); - // TODO: Disable maintenance - $GLOBALS['registry']->pushApp('turba'); - - // Find the base file path of Turba. - if (!defined('TURBA_BASE')) { - define('TURBA_BASE', dirname(__FILE__) . '/../..'); - } + $GLOBALS['registry']->pushApp('turba', array('check_perms' => false)); // Turba base libraries. + require_once dirname(__FILE__) . '/../../lib/base.load.php'; require_once TURBA_BASE . '/lib/Turba.php'; require_once TURBA_BASE . '/lib/Driver.php'; require_once TURBA_BASE . '/lib/Object.php'; @@ -167,12 +162,12 @@ class Turba_KolabTestBase extends Horde_Kolab_Test_Storage $GLOBALS['cfgSources'] = Turba::getConfigFromShares($cfgSources); } - function provideServerName() { return 'localhost.localdomain'; } function provideHordeBase() { - return dirname(__FILE__) . '/../../../'; + require_once dirname(__FILE__) . '/../../lib/base.load.php'; + return HORDE_BASE; } } diff --git a/turba/lib/tests/ViewBrowseTest.php b/turba/lib/tests/ViewBrowseTest.php index 204e49fd3..596017dcd 100644 --- a/turba/lib/tests/ViewBrowseTest.php +++ b/turba/lib/tests/ViewBrowseTest.php @@ -58,7 +58,7 @@ class Turba_ViewBrowseTest extends Turba_TestBase { function getPage() { - $this->_pageParams['registry']->pushApp('turba', false); + $this->_pageParams['registry']->pushApp('turba', array('check_perms' => false)); $this->fakeAuth(); $page = new Turba_View_Browse($this->_pageParams); $this->_output = Horde_Util::bufferOutput(array($page, 'run'));