Git rid of AUTH_HANDLER declarations.
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 22 Jul 2009 06:32:20 +0000 (00:32 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 22 Jul 2009 06:32:20 +0000 (00:32 -0600)
When needed, replace with clearer/better $app_authentication variables.
While making the changes, clean up various Horde 4 conversion items.

55 files changed:
babel/lib/base.php
chora/lib/base.php
crumb/lib/base.php
fima/lib/base.php
flexdemo/alt.php
flexdemo/index.php
folks/account/tabs.php
folks/lib/base.php
folks/rss/activity.php
folks/rss/friends.php
folks/rss/know.php
folks/rss/online.php
folks/scripts/activity.php
folks/scripts/import_letter.php
folks/scripts/mail-filter.php
folks/scripts/mail.php
folks/scripts/popularity.php
framework/Image/tests/im.php
ingo/lib/base.php
ingo/scripts/ingo-postfix-policyd
ingo/scripts/upgrades/convert_datatree_shares_to_sql.php
ingo/scripts/upgrades/convert_prefs_to_sql.php
jeta/lib/base.php
kastalia/download.php
kastalia/lib/base.php
koward/script/Koward/koward.php
kronolith/ajax.php
kronolith/attend.php
kronolith/fb.php
kronolith/feed/index.php
kronolith/lib/base.php
kronolith/lib/tests/toicalendar.phpt
kronolith/scripts/agenda.php
kronolith/scripts/import_icals.php
kronolith/scripts/import_squirrelmail_calendar.php
kronolith/scripts/upgrades/convert_datatree_shares_to_sql.php
kronolith/scripts/upgrades/convert_to_utc.php
news/lib/base.php
news/rss/comments.php
news/rss/index.php
news/rss/news.php
news/trackback.php
skoli/lib/base.php
skoli/themes/categoryCSS.php
timeobjects/lib/base.php
turba/lib/base.php
turba/scripts/import_squirrelmail_file_abook.php
turba/scripts/import_squirrelmail_sql_abook.php
turba/scripts/import_vcards.php
turba/scripts/upgrades/2.1_to_2.2_sql_schema.php
turba/scripts/upgrades/2005-09-23_flat_comments.php
turba/scripts/upgrades/2007-06-17_delete_old_vbooks.php
turba/scripts/upgrades/2007-06-17_flatten_shares.php
turba/scripts/upgrades/convert_datatree_shares_to_sql.php
turba/scripts/upgrades/public_to_horde_share.php

index 2d2e176..bff2c7e 100644 (file)
@@ -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);
 }
index fbf01f8..751e7bc 100644 (file)
@@ -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);
 }
index 61ec4b0..f1647da 100644 (file)
@@ -2,15 +2,12 @@
 /**
  * Crumb base application file.
  *
- * $Horde$
- *
  * Copyright 2008-2009 The Horde Project <http://www.horde.org>
  *
  * 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 <ben@alkaloid.net>
- *
  */
 
 // 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);
 }
index f288bd3..8dbe7a0 100644 (file)
@@ -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();
 
index 5503a1b..c7f9e86 100644 (file)
@@ -1,9 +1,7 @@
 <?php
 
-define('AUTH_HANDLER', true);
-define('HORDE_BASE', dirname(__FILE__) . '/..');
-require_once HORDE_BASE . '/lib/base.php';
-require_once 'Horde/Autoloader.php';
+$horde_authentication = 'none';
+require_once dirname(__FILE__) . '/../lib/base.php';
 
 $v = new Horde_View(array('templatePath' => dirname(__FILE__) . '/garland'));
 new Horde_View_Helper_Block($v);
index cabdd36..44985b6 100644 (file)
@@ -1,9 +1,7 @@
 <?php
 
-define('AUTH_HANDLER', true);
-define('HORDE_BASE', dirname(__FILE__) . '/..');
-require_once HORDE_BASE . '/lib/base.php';
-require_once 'Horde/Autoloader.php';
+$horde_authentication = 'none';
+require_once dirname(__FILE__) . '/../lib/base.php';
 
 $v = new Horde_View(array('templatePath' => dirname(__FILE__) . '/garland'));
 new Horde_View_Helper_Block($v);
index 8b6fece..7c2f67c 100644 (file)
@@ -10,9 +10,8 @@
  * @author Duck <duck@obala.net>
  */
 
-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']);
 
index b4897ed..0fd1cd1 100644 (file)
@@ -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);
 }
index 0482825..045ad35 100644 (file)
@@ -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';
index 3e9caa8..9efb607 100644 (file)
@@ -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';
index f79a259..859c877 100644 (file)
@@ -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';
index 1216137..88cfabc 100644 (file)
@@ -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';
index 160f644..1a38f62 100644 (file)
@@ -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.
index 145a699..275aa17 100644 (file)
@@ -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
+}
index e4020fc..144a88d 100644 (file)
@@ -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();
index 74eba1b..9267ca7 100644 (file)
  * @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='));
 
index 67a3a16..0e9c4df 100644 (file)
@@ -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) {
index d3a3130..1cf395f 100644 (file)
@@ -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']);
index 791bc27..8332ebc 100644 (file)
@@ -1,9 +1,17 @@
 <?php
 /**
  * Ingo base inclusion file.
+ *
  * This file brings in all of the dependencies that every Ingo
  * script will need and sets up objects that all scripts use.
  *
+ * The following global variables are used:
+ * <pre>
+ * $ingo_authentication - The type of authentication to use:
+ *   'none'  - Do not authenticate
+ *   [DEFAULT] - Authenticate; on failed auth redirect to login screen
+ * </pre>
+ *
  * 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);
 }
index efae71a..b70c76b 100755 (executable)
  * 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']);
index 89816eb..1f082ff 100755 (executable)
@@ -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']);
index b762c61..6dcc0c7 100755 (executable)
  * @author Jan Schneider <jan@horde.org>
  */
 
-@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') {
index b4f48ab..9a6dfa6 100644 (file)
@@ -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);
 }
index 67cc369..df41b9a 100755 (executable)
@@ -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);
 }
index 666fc9e..0f9d5a6 100755 (executable)
@@ -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);
 }
index 8df9d86..61ce3e2 100644 (file)
@@ -1,8 +1,5 @@
 #!@php_bin@
 <?php
-
-define('AUTH_HANDLER', true);
-
 /**
  * The Autoloader allows us to omit "require/include" statements.
  */
@@ -43,6 +40,7 @@ $cli->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';
 
 /**
index f7a9d4f..e489423 100644 (file)
@@ -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.
index 9ba9b34..ee392ef 100644 (file)
@@ -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');
index 6e51be4..1bebfd2 100644 (file)
@@ -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.
index df69a4a..d76941f 100644 (file)
@@ -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';
index 65e5750..57aa889 100644 (file)
@@ -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:
+ * <pre>
+ * $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
+ * </pre>
  *
  * @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. */
index a5a5b6a..a310803 100644 (file)
@@ -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';
 
index 7b58788..7b8238c 100755 (executable)
@@ -9,7 +9,7 @@
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-define('AUTH_HANDLER', true);
+$kronolith_authentication = 'none';
 require_once dirname(__FILE__) . '/../lib/base.php';
 require_once 'Horde/Identity.php';
 
index 2641aca..9103f4f 100755 (executable)
@@ -13,7 +13,7 @@
  * @author Jan Schneider <jan@horde.org>
  */
 
-@define('AUTH_HANDLER', true);
+$kronolith_authentication = 'none';
 @define('HORDE_BASE', dirname(__FILE__) . '/../..');
 
 // Do CLI checks and environment setup first.
index e647fb1..256b041 100755 (executable)
  * @author Jan Schneider <jan@horde.org>
  */
 
-@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());
 }
index bdd845c..efd5c43 100755 (executable)
@@ -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';
index 696023b..52d3a53 100755 (executable)
@@ -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';
 
index eef0cae..51c640a 100644 (file)
@@ -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);
 }
index 47c1da1..21a96cb 100644 (file)
@@ -10,9 +10,8 @@
  * @author Duck <duck@obala.net>
  */
 
-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']);
index a775ddb..a083e58 100644 (file)
@@ -10,9 +10,8 @@
  * @author Duck <duck@obala.net>
  */
 
-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';
index 5b98cb3..561907b 100755 (executable)
@@ -11,9 +11,8 @@
  * @author McLion <mclion@obala.net>
  */
 
-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']);
index bc5f55f..9989fc4 100644 (file)
@@ -11,7 +11,7 @@
  * @package News
  */
 
-define('AUTH_HANDLER', true);
+$news_authentication = 'none';
 require_once dirname(__FILE__) . '/lib/base.php';
 
 if ($browser->isRobot()) {
index fc2a744..2be1d35 100644 (file)
@@ -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();
index fb45e11..ffd13cb 100644 (file)
  * @author Chuck Hagenbuch <chuck@horde.org>
  */
 
-@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');
index aa96b6a..6aef933 100644 (file)
@@ -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);
 }
index 1d991e0..fcecb78 100644 (file)
@@ -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:
+ * <pre>
+ * $ingo_authentication - The type of authentication to use:
+ *   'none'  - Do not authenticate
+ *   [DEFAULT] - Authenticate; on failed auth redirect to login screen
+ * </pre>
  */
 
 // 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);
 }
index 859b3d2..8c2e0d3 100755 (executable)
  * @author Ben Chavet <ben@horde.org>
  */
 
-@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());
index 4ceeafb..e660441 100755 (executable)
  * @author Jan Schneider <jan@horde.org>
  */
 
-@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)) {
index 4f414ff..09bd931 100755 (executable)
  * @author Jan Schneider <jan@horde.org>
  */
 
-@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.
index a093009..0246b74 100755 (executable)
@@ -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();
index 0972991..250c10c 100755 (executable)
@@ -9,10 +9,8 @@
  * @author Jan Schneider <jan@horde.org>
  */
 
-@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.
index 04251ff..81bb823 100755 (executable)
@@ -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.
index 5aa47ed..22be23a 100755 (executable)
@@ -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.
index 2ff26b3..4393a7e 100755 (executable)
@@ -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']);
index 09ee02c..e3cb548 100755 (executable)
@@ -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());