From a768948f095763e415c4339c92dc79ce77937eff Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 22 Jul 2009 00:32:20 -0600 Subject: [PATCH] Git rid of AUTH_HANDLER declarations. When needed, replace with clearer/better $app_authentication variables. While making the changes, clean up various Horde 4 conversion items. --- babel/lib/base.php | 2 +- chora/lib/base.php | 2 +- crumb/lib/base.php | 5 +--- fima/lib/base.php | 5 +--- flexdemo/alt.php | 6 ++-- flexdemo/index.php | 6 ++-- folks/account/tabs.php | 5 ++-- folks/lib/base.php | 3 +- folks/rss/activity.php | 4 +-- folks/rss/friends.php | 4 +-- folks/rss/know.php | 4 +-- folks/rss/online.php | 4 +-- folks/scripts/activity.php | 2 +- folks/scripts/import_letter.php | 4 +-- folks/scripts/mail-filter.php | 10 ++----- folks/scripts/mail.php | 12 +++----- folks/scripts/popularity.php | 4 +-- framework/Image/tests/im.php | 2 +- ingo/lib/base.php | 11 ++++++- ingo/scripts/ingo-postfix-policyd | 8 ++--- .../upgrades/convert_datatree_shares_to_sql.php | 8 ++--- ingo/scripts/upgrades/convert_prefs_to_sql.php | 10 +++---- jeta/lib/base.php | 2 +- kastalia/download.php | 2 +- kastalia/lib/base.php | 2 +- koward/script/Koward/koward.php | 4 +-- kronolith/ajax.php | 4 +-- kronolith/attend.php | 2 +- kronolith/fb.php | 4 +-- kronolith/feed/index.php | 4 +-- kronolith/lib/base.php | 35 ++++++++++++++-------- kronolith/lib/tests/toicalendar.phpt | 2 +- kronolith/scripts/agenda.php | 2 +- kronolith/scripts/import_icals.php | 2 +- kronolith/scripts/import_squirrelmail_calendar.php | 13 ++++---- .../upgrades/convert_datatree_shares_to_sql.php | 2 -- kronolith/scripts/upgrades/convert_to_utc.php | 5 ++-- news/lib/base.php | 3 +- news/rss/comments.php | 5 ++-- news/rss/index.php | 5 ++-- news/rss/news.php | 5 ++-- news/trackback.php | 2 +- skoli/lib/base.php | 15 +++------- skoli/themes/categoryCSS.php | 6 ++-- timeobjects/lib/base.php | 2 +- turba/lib/base.php | 10 ++++++- turba/scripts/import_squirrelmail_file_abook.php | 8 ++--- turba/scripts/import_squirrelmail_sql_abook.php | 12 ++++---- turba/scripts/import_vcards.php | 6 ++-- turba/scripts/upgrades/2.1_to_2.2_sql_schema.php | 11 ++----- .../scripts/upgrades/2005-09-23_flat_comments.php | 6 ++-- .../upgrades/2007-06-17_delete_old_vbooks.php | 6 ++-- .../scripts/upgrades/2007-06-17_flatten_shares.php | 6 ++-- .../upgrades/convert_datatree_shares_to_sql.php | 7 ++--- turba/scripts/upgrades/public_to_horde_share.php | 7 ++--- 55 files changed, 144 insertions(+), 184 deletions(-) diff --git a/babel/lib/base.php b/babel/lib/base.php index 2d2e176d6..bff2c7e32 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', !defined('AUTH_HANDLER')); + $registry->pushApp('babel', true); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('babel', $e); } diff --git a/chora/lib/base.php b/chora/lib/base.php index fbf01f89c..751e7bc7c 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', !defined('AUTH_HANDLER')); + $registry->pushApp('chora', true); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('chora', $e); } diff --git a/crumb/lib/base.php b/crumb/lib/base.php index 61ec4b03d..f1647da47 100644 --- a/crumb/lib/base.php +++ b/crumb/lib/base.php @@ -2,15 +2,12 @@ /** * Crumb base application file. * - * $Horde$ - * * Copyright 2008-2009 The Horde Project * * This file brings in all of the dependencies that every Crumb script will * need, and sets up objects that all scripts use. * * @author Ben Klang - * */ // Check for a prior definition of HORDE_BASE (perhaps by an auto_prepend_file @@ -25,7 +22,7 @@ require_once HORDE_BASE . '/lib/core.php'; // Registry. $registry = Horde_Registry::singleton(); try { - $registry->pushApp('crumb', !defined('AUTH_HANDLER')); + $registry->pushApp('crumb', true); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('crumb', $e); } diff --git a/fima/lib/base.php b/fima/lib/base.php index f288bd3b0..8dbe7a07f 100644 --- a/fima/lib/base.php +++ b/fima/lib/base.php @@ -28,7 +28,7 @@ if ($session_control == 'none') { } try { - $registry->pushApp('fima', !defined('AUTH_HANDLER')); + $registry->pushApp('fima', true); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('fima', $e); } @@ -47,9 +47,6 @@ $notification->attach('status'); // Fima base library require_once FIMA_BASE . '/lib/Driver.php'; -// Horde libraries. -require_once 'Horde/History.php'; - // Start output compression. Horde::compressOutput(); diff --git a/flexdemo/alt.php b/flexdemo/alt.php index 5503a1b12..c7f9e86ae 100644 --- a/flexdemo/alt.php +++ b/flexdemo/alt.php @@ -1,9 +1,7 @@ dirname(__FILE__) . '/garland')); new Horde_View_Helper_Block($v); diff --git a/flexdemo/index.php b/flexdemo/index.php index cabdd3663..44985b606 100644 --- a/flexdemo/index.php +++ b/flexdemo/index.php @@ -1,9 +1,7 @@ dirname(__FILE__) . '/garland')); new Horde_View_Helper_Block($v); diff --git a/folks/account/tabs.php b/folks/account/tabs.php index 8b6fece51..7c2f67c17 100644 --- a/folks/account/tabs.php +++ b/folks/account/tabs.php @@ -10,9 +10,8 @@ * @author Duck */ -define('AUTH_HANDLER', true); -define('FOLKS_BASE', dirname(__FILE__) . '/..'); -require_once FOLKS_BASE . '/lib/base.php'; +$folks_authentication = 'none'; +require_once dirname(__FILE__) . '/../lib/base.php'; $auth = Horde_Auth::singleton($conf['auth']['driver']); diff --git a/folks/lib/base.php b/folks/lib/base.php index b4897ed8a..0fd1cd179 100644 --- a/folks/lib/base.php +++ b/folks/lib/base.php @@ -19,8 +19,9 @@ require_once HORDE_BASE . '/lib/core.php'; // Registry. $registry = Horde_Registry::singleton(); +$authentication = Horde_Util::nonInputVar('folks_authentication'); try { - $registry->pushApp('folks', !defined('AUTH_HANDLER')); + $registry->pushApp('folks', ($authentication != 'none')); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('folks', $e); } diff --git a/folks/rss/activity.php b/folks/rss/activity.php index 0482825be..045ad3564 100644 --- a/folks/rss/activity.php +++ b/folks/rss/activity.php @@ -11,7 +11,7 @@ * @package Folks */ -define('AUTH_HANDLER', true); +$folks_authentication = 'none'; require_once dirname(__FILE__) . '/../lib/base.php'; $auth = Horde_Auth::singleton($conf['auth']['driver']); @@ -54,4 +54,4 @@ $title = _("Friends activities"); $link = Folks::getUrlFor('list', 'online', true); $rss_link = Horde::applicationUrl('rss/friends.php', true); -require FOLKS_TEMPLATES . '/feed/activities.php'; \ No newline at end of file +require FOLKS_TEMPLATES . '/feed/activities.php'; diff --git a/folks/rss/friends.php b/folks/rss/friends.php index 3e9caa8e4..9efb607ec 100644 --- a/folks/rss/friends.php +++ b/folks/rss/friends.php @@ -11,7 +11,7 @@ * @package Folks */ -define('AUTH_HANDLER', true); +$folks_authentication = 'none'; require_once dirname(__FILE__) . '/../lib/base.php'; $auth = Horde_Auth::singleton($conf['auth']['driver']); @@ -49,4 +49,4 @@ $title = _("Online friends"); $link = Folks::getUrlFor('list', 'online', true); $rss_link = Horde::applicationUrl('rss/friends.php', true); -require FOLKS_TEMPLATES . '/feed/feed.php'; \ No newline at end of file +require FOLKS_TEMPLATES . '/feed/feed.php'; diff --git a/folks/rss/know.php b/folks/rss/know.php index f79a259f4..859c8777d 100644 --- a/folks/rss/know.php +++ b/folks/rss/know.php @@ -11,7 +11,7 @@ * @package Folks */ -define('AUTH_HANDLER', true); +$folks_authentication = 'none'; require_once dirname(__FILE__) . '/../lib/base.php'; $auth = Horde_Auth::singleton($conf['auth']['driver']); @@ -62,4 +62,4 @@ $title = _("People you might know"); $link = Folks::getUrlFor('list', 'online', true); $rss_link = Horde::applicationUrl('rss/friends.php', true); -require FOLKS_TEMPLATES . '/feed/feed.php'; \ No newline at end of file +require FOLKS_TEMPLATES . '/feed/feed.php'; diff --git a/folks/rss/online.php b/folks/rss/online.php index 121613750..88cfabc8e 100644 --- a/folks/rss/online.php +++ b/folks/rss/online.php @@ -11,7 +11,7 @@ * @package Folks */ -define('AUTH_HANDLER', true); +$folks_authentication = 'none'; require_once dirname(__FILE__) . '/../lib/base.php'; $users = $folks_driver->getOnlineUsers(); @@ -25,4 +25,4 @@ $title = _("Online users"); $link = Folks::getUrlFor('list', 'online', true); $rss_link = Horde::applicationUrl('rss/online.php', true); -require FOLKS_TEMPLATES . '/feed/feed.php'; \ No newline at end of file +require FOLKS_TEMPLATES . '/feed/feed.php'; diff --git a/folks/scripts/activity.php b/folks/scripts/activity.php index 160f6444b..1a38f62bf 100644 --- a/folks/scripts/activity.php +++ b/folks/scripts/activity.php @@ -15,7 +15,7 @@ exit; -define('AUTH_HANDLER', true); +$folks_authentication = 'none'; require_once dirname(__FILE__) . '/../lib/base.php'; // Make sure no one runs this from the web. diff --git a/folks/scripts/import_letter.php b/folks/scripts/import_letter.php index 145a69903..275aa171e 100644 --- a/folks/scripts/import_letter.php +++ b/folks/scripts/import_letter.php @@ -15,7 +15,7 @@ exit; -define('AUTH_HANDLER', true); +$folks_authentication = 'none'; require_once dirname(__FILE__) . '/../lib/base.php'; $db = DB::connect($conf['sql']); @@ -68,4 +68,4 @@ function _array_clean(&$item, $key) $item = strtolower($item); $item = str_replace('"', '', $item); $item = str_replace("'", '', $item); -} \ No newline at end of file +} diff --git a/folks/scripts/mail-filter.php b/folks/scripts/mail-filter.php index e4020fc95..144a88d1e 100644 --- a/folks/scripts/mail-filter.php +++ b/folks/scripts/mail-filter.php @@ -37,12 +37,8 @@ Options: EOU; } -define('AUTH_HANDLER', true); -define('HORDE_BASE', dirname(__FILE__) . '/../..'); - // Do CLI checks and environment setup first. -require_once HORDE_BASE . '/lib/core.php'; -require_once 'Horde/Cli.php'; +require_once dirname(__FILE__) . '/../../lib/core.php'; // Make sure no one runs this from the web. if (!Horde_Cli::runningFromCLI()) { @@ -52,10 +48,10 @@ if (!Horde_Cli::runningFromCLI()) { // Load the CLI environment - make sure there's no time limit, init some // variables, etc. Horde_Cli::init(); -$cli = &Horde_Cli::singleton(); +$cli = Horde_Cli::singleton(); +$horde_authentication = 'none'; require_once dirname(__FILE__) . '/../lib/base.php'; -require_once 'Console/Getopt.php'; // Read command-line parameters. $info = array(); diff --git a/folks/scripts/mail.php b/folks/scripts/mail.php index 74eba1b39..9267ca70e 100644 --- a/folks/scripts/mail.php +++ b/folks/scripts/mail.php @@ -13,10 +13,6 @@ * @package Folks */ -$no_compress = true; -define('AUTH_HANDLER', true); -define('FOLKS_BASE', dirname(__FILE__) . '/..'); - // Do CLI checks and environment setup first. require_once 'Horde/Cli.php'; @@ -27,15 +23,15 @@ if (!Horde_Cli::runningFromCLI()) { // Load the CLI environment. Horde_Cli::init(); -$cli = &Horde_Cli::singleton(); +$cli = Horde_Cli::singleton(); // Load Folks. -require_once FOLKS_BASE . '/lib/base.php'; +$folks_authentication = 'none'; +$no_compress = true; +require_once dirname(__FILE__) . '/../lib/base.php'; require_once FOLKS_BASE . '/lib/version.php'; -require_once 'Horde/MIME/Mail.php'; // We accept the user name on the command-line. -require_once 'Console/Getopt.php'; $ret = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), 'h:u:p:dt:f:c:', array('help', 'username=', 'password=', 'time=', 'from=', 'count=')); diff --git a/folks/scripts/popularity.php b/folks/scripts/popularity.php index 67a3a168a..0e9c4df1b 100644 --- a/folks/scripts/popularity.php +++ b/folks/scripts/popularity.php @@ -15,7 +15,7 @@ exit; -define('AUTH_HANDLER', true); +$folks_authentication = 'none'; require_once dirname(__FILE__) . '/../lib/base.php'; // Make sure no one runs this from the web. @@ -25,7 +25,7 @@ if (!Horde_Cli::runningFromCLI()) { // Load the CLI environment. Horde_Cli::init(); -$cli = &Horde_Cli::singleton(); +$cli = Horde_Cli::singleton(); $db = DB::connect($conf['sql']); if ($db instanceof PEAR_Error) { diff --git a/framework/Image/tests/im.php b/framework/Image/tests/im.php index d3a3130d6..1cf395fcc 100644 --- a/framework/Image/tests/im.php +++ b/framework/Image/tests/im.php @@ -8,7 +8,7 @@ * @package Horde_Image */ define('HORDE_BASE', '/var/www/html/horde'); -define('AUTH_HANDLER', true); +$horde_authentication = 'none'; require_once HORDE_BASE . '/lib/base.php'; $GLOBALS['conf']['sql']['adapter'] = $GLOBALS['conf']['sql']['phptype'] == 'mysqli' ? 'mysqli' : 'pdo_' . $GLOBALS['conf']['sql']['phptype']; $db = Horde_Db_Adapter::factory($GLOBALS['conf']['sql']); diff --git a/ingo/lib/base.php b/ingo/lib/base.php index 791bc27c2..8332ebc7e 100644 --- a/ingo/lib/base.php +++ b/ingo/lib/base.php @@ -1,9 +1,17 @@ + * $ingo_authentication - The type of authentication to use: + * 'none' - Do not authenticate + * [DEFAULT] - Authenticate; on failed auth redirect to login screen + * + * * Global variables defined: * $ingo_shared - TODO * $ingo_storage - The Ingo_Storage:: object to use for storing rules. @@ -20,8 +28,9 @@ require_once HORDE_BASE . '/lib/core.php'; // Registry. $registry = Horde_Registry::singleton(); +$authentication = Horde_Util::nonInputVar('ingo_authentication'); try { - $registry->pushApp('ingo', !defined('AUTH_HANDLER')); + $registry->pushApp('ingo', ($authentication != 'none')); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('ingo', $e); } diff --git a/ingo/scripts/ingo-postfix-policyd b/ingo/scripts/ingo-postfix-policyd index efae71a1d..b70c76b75 100755 --- a/ingo/scripts/ingo-postfix-policyd +++ b/ingo/scripts/ingo-postfix-policyd @@ -60,11 +60,8 @@ * sender is blacklisted. */ -@define('AUTH_HANDLER', true); - // Do CLI checks and environment setup first. -@define('HORDE_BASE', dirname(dirname(dirname(__FILE__)))); -require_once HORDE_BASE . '/lib/core.php'; +require_once dirname(__FILE__) . '/../../lib/core.php'; // Make sure no one runs this from the web. if (!Horde_Cli::runningFromCLI()) { @@ -76,7 +73,8 @@ if (!Horde_Cli::runningFromCLI()) { Horde_Cli::init(); // Include needed libraries. -require_once dirname(dirname(__FILE__)) . '/lib/base.php'; +$ingo_authentication = 'none'; +require_once dirname(__FILE__) . '/../lib/base.php'; // Initialize authentication manager. $auth = Horde_Auth::singleton($conf['auth']['driver']); diff --git a/ingo/scripts/upgrades/convert_datatree_shares_to_sql.php b/ingo/scripts/upgrades/convert_datatree_shares_to_sql.php index 89816eb67..1f082ffe9 100755 --- a/ingo/scripts/upgrades/convert_datatree_shares_to_sql.php +++ b/ingo/scripts/upgrades/convert_datatree_shares_to_sql.php @@ -6,20 +6,16 @@ * upgrade script before executing this script. */ -@define('AUTH_HANDLER', true); -@define('HORDE_BASE', dirname(__FILE__) . '/../../..'); - /* Set up the CLI environment */ -require_once HORDE_BASE . '/lib/core.php'; +require_once dirname(__FILE__) . '/../../../lib/core.php'; if (!Horde_Cli::runningFromCli()) { exit("Must be run from the command line\n"); } -$cli = &Horde_Cli::singleton(); +$cli = Horde_Cli::singleton(); $cli->init(); /* Grab what we need to steal the DB config */ require_once HORDE_BASE . '/config/conf.php'; -require_once 'MDB2.php'; $config = $GLOBALS['conf']['sql']; unset($config['charset']); diff --git a/ingo/scripts/upgrades/convert_prefs_to_sql.php b/ingo/scripts/upgrades/convert_prefs_to_sql.php index b762c6189..6dcc0c7fe 100755 --- a/ingo/scripts/upgrades/convert_prefs_to_sql.php +++ b/ingo/scripts/upgrades/convert_prefs_to_sql.php @@ -18,11 +18,8 @@ * @author Jan Schneider */ -@define('AUTH_HANDLER', true); - /* Do CLI checks and environment setup first. */ -@define('HORDE_BASE', dirname(__FILE__) . '/../../..'); -require_once HORDE_BASE . '/lib/core.php'; +require_once dirname(__FILE__) . '/../../../lib/core.php'; /* Make sure no one runs this from the web. */ if (!Horde_Cli::runningFromCLI()) { @@ -32,10 +29,11 @@ if (!Horde_Cli::runningFromCLI()) { /* Load the CLI environment - make sure there's no time limit, init some * variables, etc. */ Horde_Cli::init(); -$cli = &Horde_Cli::singleton(); +$cli = Horde_Cli::singleton(); /* Initialize the needed libraries. */ -require_once dirname(dirname(dirname(__FILE__))) . '/lib/base.php'; +$ingo_authentication = 'none'; +require_once dirname(__FILE__) . '/../../lib/base.php'; /* Initialize storage backends. */ if ($conf['storage']['driver'] != 'sql') { diff --git a/jeta/lib/base.php b/jeta/lib/base.php index b4f48aba2..9a6dfa670 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', !defined('AUTH_HANDLER')); + $registry->pushApp('jeta', true); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('jeta', $e); } diff --git a/kastalia/download.php b/kastalia/download.php index 67cc36917..df41b9a8f 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', !defined('AUTH_HANDLER')); + $registry->pushApp('kastalia', true); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('kastalia', $e); } diff --git a/kastalia/lib/base.php b/kastalia/lib/base.php index 666fc9e2b..0f9d5a668 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', !defined('AUTH_HANDLER')); + $registry->pushApp('kastalia', true); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('kastalia', $e); } diff --git a/koward/script/Koward/koward.php b/koward/script/Koward/koward.php index 8df9d86fe..61ce3e2d2 100644 --- a/koward/script/Koward/koward.php +++ b/koward/script/Koward/koward.php @@ -1,8 +1,5 @@ #!@php_bin@ init(); * really satisfying. We need it to know the location of the * configuration though. */ +$koward_authentication = 'none'; require_once $opts->base . '/koward/config/base.php'; /** diff --git a/kronolith/ajax.php b/kronolith/ajax.php index f7a9d4f65..e489423f7 100644 --- a/kronolith/ajax.php +++ b/kronolith/ajax.php @@ -85,10 +85,10 @@ if (empty($action)) { // The following actions do not need write access to the session and // should be opened read-only for performance reasons. if (in_array($action, array())) { - $session_control = 'readonly'; + $kronolith_session_control = 'readonly'; } -$session_timeout = 'json'; +$kronolith_session_timeout = 'json'; require_once KRONOLITH_BASE . '/lib/base.php'; // Process common request variables. diff --git a/kronolith/attend.php b/kronolith/attend.php index 9ba9b3424..ee392eff5 100644 --- a/kronolith/attend.php +++ b/kronolith/attend.php @@ -9,7 +9,7 @@ * @package Kronolith */ -@define('AUTH_HANDLER', true); +$kronolith_authentication = 'none'; require_once dirname(__FILE__) . '/lib/base.php'; $cal = Horde_Util::getFormData('c'); diff --git a/kronolith/fb.php b/kronolith/fb.php index 6e51be4d6..1bebfd214 100644 --- a/kronolith/fb.php +++ b/kronolith/fb.php @@ -9,8 +9,8 @@ * @package Kronolith */ -@define('AUTH_HANDLER', true); -$session_control = 'none'; +$kronolith_authentication = 'none'; +$kronolith_session_control = 'none'; require_once dirname(__FILE__) . '/lib/base.php'; // We want to always generate UTF-8 iCalendar data. diff --git a/kronolith/feed/index.php b/kronolith/feed/index.php index df69a4aa1..d76941f33 100644 --- a/kronolith/feed/index.php +++ b/kronolith/feed/index.php @@ -21,8 +21,8 @@ function _no_access($status, $reason, $body) exit; } -$session_control = 'readonly'; -@define('AUTH_HANDLER', true); +$kronolith_authentication = 'none'; +$kronolith_session_control = 'readonly'; require_once dirname(__FILE__) . '/../lib/base.php'; require_once KRONOLITH_BASE . '/lib/version.php'; require_once 'Horde/Identity.php'; diff --git a/kronolith/lib/base.php b/kronolith/lib/base.php index 65e5750ca..57aa8897d 100644 --- a/kronolith/lib/base.php +++ b/kronolith/lib/base.php @@ -5,9 +5,16 @@ * This file brings in all of the dependencies that every Kronolith * script will need, and sets up objects that all scripts use. * - * The following variables, defined in the script that calls this one, are - * used: - * - $session_control - Sets special session control limitations + * The following global variables are used: + *
+ * $kronolith_authentication - The type of authentication to use:
+ *   'none'  - Do not authenticate
+ *   [DEFAULT] - Authenticate; on failure redirect to login screen
+ * $kronolith_session_control - Sets special session control limitations:
+ *   'none' - Do not start a session
+ *   'readonly' - Start session readonly
+ *   [DEFAULT] - Start read-write session
+ * 
* * @package Kronolith */ @@ -19,17 +26,21 @@ require_once dirname(__FILE__) . '/base.load.php'; require_once HORDE_BASE . '/lib/core.php'; /* Registry. */ -$session_control = Horde_Util::nonInputVar('session_control'); -if ($session_control == 'none') { - $registry = Horde_Registry::singleton(Horde_Registry::SESSION_NONE); -} elseif ($session_control == 'readonly') { - $registry = Horde_Registry::singleton(Horde_Registry::SESSION_READONLY); -} else { - $registry = Horde_Registry::singleton(); +$s_ctrl = 0; +switch (Horde_Util::nonInputVar('kronolith_session_control')) { +case 'none': + $s_ctrl = Horde_Registry::SESSION_NONE; + break; + +case 'readonly': + $s_ctrl = Horde_Registry::SESSION_READONLY; + break; } +$registry = Horde_Registry::singleton($s_ctrl); +$authentication = Horde_Util::nonInputVar('kronolith_authentication'); try { - $registry->pushApp('kronolith', !defined('AUTH_HANDLER')); + $registry->pushApp('kronolith', ($authentication != 'none')); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('kronolith', $e); } @@ -40,7 +51,7 @@ define('KRONOLITH_TEMPLATES', $registry->get('templates')); $notification = Horde_Notification::singleton(); $GLOBALS['kronolith_notify'] = $notification->attach('status', null, 'Kronolith_Notification_Listener_Status'); -/* Start compression, if requested. */ +/* Start compression. */ Horde::compressOutput(); /* Set the timezone variable, if available. */ diff --git a/kronolith/lib/tests/toicalendar.phpt b/kronolith/lib/tests/toicalendar.phpt index a5a5b6a83..a31080377 100644 --- a/kronolith/lib/tests/toicalendar.phpt +++ b/kronolith/lib/tests/toicalendar.phpt @@ -5,7 +5,7 @@ Kronolith_Event::toiCalendar() test. require 'Horde/Cli.php'; Horde_Cli::init(); -define('AUTH_HANDLER', true); +$kronolith_authentication = 'none'; require dirname(__FILE__) . '/../base.php'; require 'Horde/iCalendar.php'; diff --git a/kronolith/scripts/agenda.php b/kronolith/scripts/agenda.php index 7b587883a..7b8238ca8 100755 --- a/kronolith/scripts/agenda.php +++ b/kronolith/scripts/agenda.php @@ -9,7 +9,7 @@ * @author Chuck Hagenbuch */ -define('AUTH_HANDLER', true); +$kronolith_authentication = 'none'; require_once dirname(__FILE__) . '/../lib/base.php'; require_once 'Horde/Identity.php'; diff --git a/kronolith/scripts/import_icals.php b/kronolith/scripts/import_icals.php index 2641aca3d..9103f4fb9 100755 --- a/kronolith/scripts/import_icals.php +++ b/kronolith/scripts/import_icals.php @@ -13,7 +13,7 @@ * @author Jan Schneider */ -@define('AUTH_HANDLER', true); +$kronolith_authentication = 'none'; @define('HORDE_BASE', dirname(__FILE__) . '/../..'); // Do CLI checks and environment setup first. diff --git a/kronolith/scripts/import_squirrelmail_calendar.php b/kronolith/scripts/import_squirrelmail_calendar.php index e647fb1f8..256b041e1 100755 --- a/kronolith/scripts/import_squirrelmail_calendar.php +++ b/kronolith/scripts/import_squirrelmail_calendar.php @@ -14,12 +14,8 @@ * @author Jan Schneider */ -@define('AUTH_HANDLER', true); -@define('HORDE_BASE', dirname(__FILE__) . '/../..'); -@define('KRONOLITH_BASE', dirname(__FILE__) . '/..'); - // Do CLI checks and environment setup first. -require_once HORDE_BASE . '/lib/core.php'; +require_once dirname(__FILE__) . '/../../lib/core.php'; // Makre sure no one runs this from the web. if (!Horde_Cli::runningFromCli()) { @@ -28,7 +24,7 @@ if (!Horde_Cli::runningFromCli()) { // Load the CLI environment - make sure there's no time limit, init some // variables, etc. -$cli = &Horde_Cli::singleton(); +$cli = Horde_Cli::singleton(); $cli->init(); // Read command line parameters. @@ -41,6 +37,7 @@ $dsn = $argv[1]; $default_tz = date_default_timezone_get(); // Make sure we load Horde base to get the auth config +$horde_authentication = 'none'; require_once HORDE_BASE . '/lib/base.php'; if ($conf['auth']['admins']) { Horde_Auth::setAuth($conf['auth']['admins'][0], array()); @@ -49,10 +46,10 @@ if ($conf['auth']['admins']) { // Now that we are authenticated, we can load Kronolith's base. Otherwise, the // share code breaks, causing a new, completely empty share to be created with // no owner. -require_once KRONOLITH_BASE . '/lib/base.php'; +require_once dirname(__FILE__) . '/../lib/base.php'; // Connect to database. -$db = &DB::connect($dsn); +$db = DB::connect($dsn); if (is_a($db, 'PEAR_Error')) { $cli->fatal($db->toString()); } diff --git a/kronolith/scripts/upgrades/convert_datatree_shares_to_sql.php b/kronolith/scripts/upgrades/convert_datatree_shares_to_sql.php index bdd845ce8..efd5c43e6 100755 --- a/kronolith/scripts/upgrades/convert_datatree_shares_to_sql.php +++ b/kronolith/scripts/upgrades/convert_datatree_shares_to_sql.php @@ -6,8 +6,6 @@ * 2.1_to_2.2.sql upgrade script for your RDBMS before executing this script. */ -@define('AUTH_HANDLER', true); - /* Set up the CLI environment */ require_once dirname(__FILE__) . '/../../lib/base.load.php'; require_once HORDE_BASE . '/lib/core.php'; diff --git a/kronolith/scripts/upgrades/convert_to_utc.php b/kronolith/scripts/upgrades/convert_to_utc.php index 696023b08..52d3a5390 100755 --- a/kronolith/scripts/upgrades/convert_to_utc.php +++ b/kronolith/scripts/upgrades/convert_to_utc.php @@ -4,18 +4,17 @@ * This script converts all dates from the user's timezone to UTC. */ -@define('AUTH_HANDLER', true); - /* Set up the CLI environment. */ require_once dirname(__FILE__) . '/../../lib/base.load.php'; require_once HORDE_BASE . '/lib/core.php'; if (!Horde_Cli::runningFromCLI()) { exit("Must be run from the command line\n"); } -$cli = &Horde_Cli::singleton(); +$cli = Horde_Cli::singleton(); $cli->init(); /* Load required libraries. */ +$kronolith_authentication = 'none'; require_once KRONOLITH_BASE . '/../../lib/base.php'; require_once 'Horde/Prefs.php'; diff --git a/news/lib/base.php b/news/lib/base.php index eef0caef2..51c640ad2 100644 --- a/news/lib/base.php +++ b/news/lib/base.php @@ -24,8 +24,9 @@ require_once HORDE_BASE . '/lib/core.php'; // Registry. $registry = Horde_Registry::singleton(); +$authentication = Horde_Util::nonInputVar('news_authentication'); try { - $registry->pushApp('news', !defined('AUTH_HANDLER')); + $registry->pushApp('news', ($authentication != 'none')); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('news', $e); } diff --git a/news/rss/comments.php b/news/rss/comments.php index 47c1da14f..21a96cb10 100644 --- a/news/rss/comments.php +++ b/news/rss/comments.php @@ -10,9 +10,8 @@ * @author Duck */ -define('AUTH_HANDLER', true); -define('NEWS_BASE', dirname(__FILE__) . '/../'); -require_once NEWS_BASE . '/lib/base.php'; +$news_authentication = 'none'; +require_once dirname(__FILE__) . '/../lib/base.php'; $cache_key = 'news_rss_comments'; $rss = $cache->get($cache_key, $conf['cache']['default_lifetime']); diff --git a/news/rss/index.php b/news/rss/index.php index a775ddbb2..a083e58fc 100644 --- a/news/rss/index.php +++ b/news/rss/index.php @@ -10,9 +10,8 @@ * @author Duck */ -define('AUTH_HANDLER', true); -define('NEWS_BASE', dirname(__FILE__) . '/../'); -require_once NEWS_BASE . '/lib/base.php'; +$news_authentication = 'none'; +require_once dirname(__FILE__) . '/../lib/base.php'; // Show a specific user? $cache_key = 'news_rss_index'; diff --git a/news/rss/news.php b/news/rss/news.php index 5b98cb340..561907bbe 100755 --- a/news/rss/news.php +++ b/news/rss/news.php @@ -11,9 +11,8 @@ * @author McLion */ -define('AUTH_HANDLER', true); -define('NEWS_BASE', dirname(__FILE__) . '/../'); -require_once NEWS_BASE . '/lib/base.php'; +$news_authentication = 'none'; +require_once dirname(__FILE__) . '/../lib/base.php'; $cache_key = 'news_rss_news'; $rss = $cache->get($cache_key, $conf['cache']['default_lifetime']); diff --git a/news/trackback.php b/news/trackback.php index bc5f55fc0..9989fc42d 100644 --- a/news/trackback.php +++ b/news/trackback.php @@ -11,7 +11,7 @@ * @package News */ -define('AUTH_HANDLER', true); +$news_authentication = 'none'; require_once dirname(__FILE__) . '/lib/base.php'; if ($browser->isRobot()) { diff --git a/skoli/lib/base.php b/skoli/lib/base.php index fc2a74487..2be1d354e 100644 --- a/skoli/lib/base.php +++ b/skoli/lib/base.php @@ -19,33 +19,26 @@ require_once HORDE_BASE . '/lib/core.php'; // Registry. $registry = Horde_Registry::singleton(); +$authentication = Horde_Util::nonInputVar('skoli_authentication'); try { - $registry->pushApp('skoli', !defined('AUTH_HANDLER')); + $registry->pushApp('skoli', ($authentication != 'none')); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('skoli', $e); } $conf = &$GLOBALS['conf']; @define('SKOLI_TEMPLATES', $registry->get('templates')); -// Horde framework libraries. -require_once 'Horde/History.php'; - // Notification system. -$notification = &Horde_Notification::singleton(); +$notification = Horde_Notification::singleton(); $notification->attach('status'); // Define the base file path of Skoli. @define('SKOLI_BASE', dirname(__FILE__) . '/..'); -// Skoli base library -require_once SKOLI_BASE . '/lib/Skoli.php'; -require_once SKOLI_BASE . '/lib/Driver.php'; - // Start output compression. Horde::compressOutput(); // Create a share instance. -require_once 'Horde/Share.php'; -$GLOBALS['skoli_shares'] = &Horde_Share::singleton($registry->getApp()); +$GLOBALS['skoli_shares'] = Horde_Share::singleton($registry->getApp()); Skoli::initialize(); diff --git a/skoli/themes/categoryCSS.php b/skoli/themes/categoryCSS.php index fb45e11ed..ffd13cb56 100644 --- a/skoli/themes/categoryCSS.php +++ b/skoli/themes/categoryCSS.php @@ -10,10 +10,8 @@ * @author Chuck Hagenbuch */ -@define('AUTH_HANDLER', true); -@define('SKOLI_BASE', dirname(__FILE__) . '/..'); -require_once SKOLI_BASE . '/lib/base.php'; -require_once 'Horde/Image.php'; +$skoli_authentication = 'none'; +require_once dirname(__FILE__) . '/../lib/base.php'; require_once 'Horde/Prefs/CategoryManager.php'; header('Content-Type: text/css'); diff --git a/timeobjects/lib/base.php b/timeobjects/lib/base.php index aa96b6a72..6aef9330f 100644 --- a/timeobjects/lib/base.php +++ b/timeobjects/lib/base.php @@ -31,7 +31,7 @@ if ($session_control == 'none') { } try { - $registry->pushApp('timeobjects', !defined('AUTH_HANDLER')); + $registry->pushApp('timeobjects', true); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('timeobjects', $e); } diff --git a/turba/lib/base.php b/turba/lib/base.php index 1d991e0a1..fcecb7845 100644 --- a/turba/lib/base.php +++ b/turba/lib/base.php @@ -4,6 +4,13 @@ * * This file brings in all of the dependencies that every Turba script will * need, and sets up objects that all scripts use. + * + * The following global variables are used: + *
+ * $ingo_authentication - The type of authentication to use:
+ *   'none'  - Do not authenticate
+ *   [DEFAULT] - Authenticate; on failed auth redirect to login screen
+ * 
*/ // Determine BASE directories. @@ -14,8 +21,9 @@ require_once HORDE_BASE . '/lib/core.php'; // Registry. $registry = Horde_Registry::singleton(); +$authentication = Horde::nonInputVar('turba_authentication'); try { - $registry->pushApp('turba', !defined('AUTH_HANDLER')); + $registry->pushApp('turba', ($authentication != 'none')); } catch (Horde_Exception $e) { Horde_Auth::authenticationFailureRedirect('turba', $e); } diff --git a/turba/scripts/import_squirrelmail_file_abook.php b/turba/scripts/import_squirrelmail_file_abook.php index 859b3d22b..8c2e0d307 100755 --- a/turba/scripts/import_squirrelmail_file_abook.php +++ b/turba/scripts/import_squirrelmail_file_abook.php @@ -16,11 +16,8 @@ * @author Ben Chavet */ -@define('AUTH_HANDLER', true); -@define('HORDE_BASE', dirname(__FILE__) . '/../..'); -@define('TURBA_BASE', dirname(__FILE__) . '/..'); - // Do CLI checks and environment setup first. +require_once dirname(__FILE__) . '/../lib/base.load.php'; require_once HORDE_BASE . '/lib/core.php'; // Makre sure no one runs this from the web. @@ -30,7 +27,7 @@ if (!Horde_Cli::runningFromCli()) { // Load the CLI environment - make sure there's no time limit, init some // variables, etc. -$cli = &Horde_Cli::singleton(); +$cli = Horde_Cli::singleton(); $cli->init(); // Read command line parameters. @@ -42,6 +39,7 @@ if ($argc != 2) { $data = $argv[1]; // Make sure we load Horde base to get the auth config +$horde_authentication = 'none'; require_once HORDE_BASE . '/lib/base.php'; if ($conf['auth']['admins']) { Horde_Auth::setAuth($conf['auth']['admins'][0], array()); diff --git a/turba/scripts/import_squirrelmail_sql_abook.php b/turba/scripts/import_squirrelmail_sql_abook.php index 4ceeafbd6..e660441a6 100755 --- a/turba/scripts/import_squirrelmail_sql_abook.php +++ b/turba/scripts/import_squirrelmail_sql_abook.php @@ -15,11 +15,8 @@ * @author Jan Schneider */ -@define('AUTH_HANDLER', true); -@define('HORDE_BASE', dirname(__FILE__) . '/../..'); -@define('TURBA_BASE', dirname(__FILE__) . '/..'); - // Do CLI checks and environment setup first. +require_once dirname(__FILE__) . '/../lib/base.load.php'; require_once HORDE_BASE . '/lib/core.php'; // Makre sure no one runs this from the web. @@ -29,7 +26,7 @@ if (!Horde_Cli::runningFromCli()) { // Load the CLI environment - make sure there's no time limit, init some // variables, etc. -$cli = &Horde_Cli::singleton(); +$cli = Horde_Cli::singleton(); $cli->init(); // Read command line parameters. @@ -41,6 +38,7 @@ if ($argc != 2) { $dsn = $argv[1]; // Make sure we load Horde base to get the auth config +$horde_authentication = 'none'; require_once HORDE_BASE . '/lib/base.php'; if ($conf['auth']['admins']) { Horde_Auth::setAuth($conf['auth']['admins'][0], array()); @@ -54,7 +52,7 @@ require_once TURBA_BASE . '/lib/Object/Group.php'; require_once 'Horde/Mime/Address.php'; // Connect to database. -$db = &DB::connect($dsn); +$db = DB::connect($dsn); if (is_a($db, 'PEAR_Error')) { $cli->fatal($db->toString()); } @@ -64,7 +62,7 @@ $handle = $db->query('SELECT owner, nickname, firstname, lastname, email, label if (is_a($handle, 'PEAR_Error')) { $cli->fatal($handle->toString()); } -$turba_shares = &Horde_Share::singleton('turba'); +$turba_shares = Horde_Share::singleton('turba'); $user = null; $count = 0; while ($row = $handle->fetchRow(DB_FETCHMODE_ASSOC)) { diff --git a/turba/scripts/import_vcards.php b/turba/scripts/import_vcards.php index 4f414ff40..09bd9314c 100755 --- a/turba/scripts/import_vcards.php +++ b/turba/scripts/import_vcards.php @@ -13,10 +13,8 @@ * @author Jan Schneider */ -@define('AUTH_HANDLER', true); -@define('HORDE_BASE', dirname(__FILE__) . '/../..'); - // Do CLI checks and environment setup first. +require_once dirname(__FILE__) . '/../lib/base.local.php'; require_once HORDE_BASE . '/lib/core.php'; // Make sure no one runs this from the web. @@ -26,7 +24,7 @@ if (!Horde_Cli::runningFromCLI()) { // Load the CLI environment - make sure there's no time limit, init some // variables, etc. -$cli = &Horde_Cli::singleton(); +$cli = Horde_Cli::singleton(); $cli->init(); // Read command line parameters. diff --git a/turba/scripts/upgrades/2.1_to_2.2_sql_schema.php b/turba/scripts/upgrades/2.1_to_2.2_sql_schema.php index a09300935..0246b746d 100755 --- a/turba/scripts/upgrades/2.1_to_2.2_sql_schema.php +++ b/turba/scripts/upgrades/2.1_to_2.2_sql_schema.php @@ -32,22 +32,18 @@ $do_work = true; $do_email = true; /* YOU SHOULD NOT HAVE TO TOUCH ANYTHING BELOW THIS LINE */ -@define('AUTH_HANDLER', true); -@define('HORDE_BASE', dirname(__FILE__) . '/../../..'); - /* Set up the CLI environment */ +require_once dirname(__FILE__) . '/../lib/base.load.php'; require_once HORDE_BASE . '/lib/core.php'; if (!Horde_Cli::runningFromCli()) { exit("Must be run from the command line\n"); } -$cli = &Horde_Cli::singleton(); +$cli = Horde_Cli::singleton(); $cli->init(); /* Grab what we need to steal the DB config */ require_once HORDE_BASE . '/config/conf.php'; require_once 'Horde/Form.php'; -require 'Horde/NLS/carsigns.php'; -require_once 'DB.php'; $config = $GLOBALS['conf']['sql']; $config['username'] = $db_user; @@ -290,9 +286,6 @@ function getBareEmail($address) return $address; } - require_once 'Mail/RFC822.php'; - require_once 'Horde/Mime/Address.php'; - static $rfc822; if (is_null($rfc822)) { $rfc822 = new Mail_RFC822(); diff --git a/turba/scripts/upgrades/2005-09-23_flat_comments.php b/turba/scripts/upgrades/2005-09-23_flat_comments.php index 097299124..250c10c4f 100755 --- a/turba/scripts/upgrades/2005-09-23_flat_comments.php +++ b/turba/scripts/upgrades/2005-09-23_flat_comments.php @@ -9,10 +9,8 @@ * @author Jan Schneider */ -@define('AUTH_HANDLER', true); -@define('HORDE_BASE', dirname(__FILE__) . '/../../..'); - // Do CLI checks and environment setup first. +require_once dirname(__FILE__) . '/../lib/base.load.php'; require_once HORDE_BASE . '/lib/core.php'; // Make sure no one runs this from the web. @@ -24,7 +22,7 @@ if (!Horde_Cli::runningFromCLI()) { // variables, etc. Horde_Cli::init(); -@define('TURBA_BASE', dirname(__FILE__) . '/../..'); +$turba_authentication = 'none'; require_once TURBA_BASE . '/lib/base.php'; // Instantiate DataTree. diff --git a/turba/scripts/upgrades/2007-06-17_delete_old_vbooks.php b/turba/scripts/upgrades/2007-06-17_delete_old_vbooks.php index 04251ffea..81bb82392 100755 --- a/turba/scripts/upgrades/2007-06-17_delete_old_vbooks.php +++ b/turba/scripts/upgrades/2007-06-17_delete_old_vbooks.php @@ -5,11 +5,8 @@ * confuse the new Turba code. */ -@define('AUTH_HANDLER', true); -@define('TURBA_BASE', dirname(__FILE__) . '/../..'); -@define('HORDE_BASE', TURBA_BASE . '/..'); - // Do CLI checks and environment setup first. +require_once dirname(__FILE__) . '/../lib/base.load.php'; require_once HORDE_BASE . '/lib/core.php'; // Make sure no one runs this from the web. @@ -21,6 +18,7 @@ if (!Horde_Cli::runningFromCLI()) { // some variables, etc. Horde_Cli::init(); +$turba_authentication = 'none'; require_once TURBA_BASE . '/lib/base.php'; // Re-load source config. diff --git a/turba/scripts/upgrades/2007-06-17_flatten_shares.php b/turba/scripts/upgrades/2007-06-17_flatten_shares.php index 5aa47edc6..22be23ad4 100755 --- a/turba/scripts/upgrades/2007-06-17_flatten_shares.php +++ b/turba/scripts/upgrades/2007-06-17_flatten_shares.php @@ -5,11 +5,8 @@ * requirements of the future Share API. */ -@define('AUTH_HANDLER', true); -@define('TURBA_BASE', dirname(__FILE__) . '/../..'); -@define('HORDE_BASE', TURBA_BASE . '/..'); - // Do CLI checks and environment setup first. +require_once dirname(__FILE__) . '/../lib/base.load.php'; require_once HORDE_BASE . '/lib/core.php'; // Make sure no one runs this from the web. @@ -21,6 +18,7 @@ if (!Horde_Cli::runningFromCLI()) { // some variables, etc. Horde_Cli::init(); +$turba_authentication = 'none'; require_once TURBA_BASE . '/lib/base.php'; // Re-load source config. diff --git a/turba/scripts/upgrades/convert_datatree_shares_to_sql.php b/turba/scripts/upgrades/convert_datatree_shares_to_sql.php index 2ff26b3ac..4393a7e8c 100755 --- a/turba/scripts/upgrades/convert_datatree_shares_to_sql.php +++ b/turba/scripts/upgrades/convert_datatree_shares_to_sql.php @@ -7,20 +7,17 @@ * executing this script. */ -@define('AUTH_HANDLER', true); -@define('HORDE_BASE', dirname(__FILE__) . '/../../..'); - /* Set up the CLI environment */ +require_once dirname(__FILE__) . '/../lib/base.load.php'; require_once HORDE_BASE . '/lib/core.php'; if (!Horde_Cli::runningFromCli()) { exit("Must be run from the command line\n"); } -$cli = &Horde_Cli::singleton(); +$cli = Horde_Cli::singleton(); $cli->init(); /* Grab what we need to steal the DB config */ require_once HORDE_BASE . '/config/conf.php'; -require_once 'MDB2.php'; $config = $GLOBALS['conf']['sql']; unset($config['charset']); diff --git a/turba/scripts/upgrades/public_to_horde_share.php b/turba/scripts/upgrades/public_to_horde_share.php index 09ee02cc3..e3cb54825 100755 --- a/turba/scripts/upgrades/public_to_horde_share.php +++ b/turba/scripts/upgrades/public_to_horde_share.php @@ -19,9 +19,7 @@ */ // Load Horde and Turba enviroments -@define('AUTH_HANDLER', true); -@define('HORDE_BASE', dirname(__FILE__) . '/../../..'); -@define('TURBA_BASE', dirname(__FILE__) . '/../..'); +require_once dirname(__FILE__) . '/../lib/base.load.php'; require_once HORDE_BASE . '/lib/core.php'; // Set up the CLI enviroment. @@ -29,9 +27,10 @@ if (!Horde_Cli::runningFromCLI()) { exit("Must be run from the command line\n"); } Horde_Cli::init(); -$CLI = &Horde_Cli::singleton(); +$CLI = Horde_Cli::singleton(); // Make sure we load Horde base to get the auth config +$horde_authentication = 'none'; require_once HORDE_BASE . '/lib/base.php'; if ($conf['auth']['admins']) { Horde_Auth::setAuth($conf['auth']['admins'][0], array()); -- 2.11.0