Using IMP as a test case.
Proposed usage:
Every application script directly require_once's Application.php
This inits HORDE_BASE and Autoloading.
To init app, call new ***_Application(array('init' => $foo))
where $foo is either true or an array of options to pass to init().
lib/base.local.php is now config/horde.local.php
* @package IMP
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
/* Redirect back to the options screen if ACL is not enabled. */
$prefs_url = Horde::getServiceLink('options', 'imp');
}
// Need to load Horde_Util:: to give us access to Horde_Util::getPathInfo().
-require_once dirname(__FILE__) . '/lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
$action = basename(Horde_Util::getPathInfo());
if (empty($action)) {
// This is the only case where we really don't return anything, since
// The following actions do not need write access to the session and
// should be opened read-only for performance reasons.
+$session_control = null;
if (in_array($action, array('chunkContent', 'Html2Text', 'Text2Html', 'GetReplyData', 'FetchmailDialog'))) {
- $imp_session_control = 'readonly';
+ $session_control = 'readonly';
}
-$imp_authentication = 'throw';
try {
- require_once IMP_BASE . '/lib/base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw', 'session_control' => $session_control)));
} catch (Horde_Exception $e) {
/* Handle session timeouts when they come from an AJAX request. */
if ($e->getCode() == Horde_Registry::AUTH_FAILURE) {
// We do not need to be authenticated to get the file. Most users won't send
// linked attachments just to other IMP users.
-$imp_authentication = 'none';
-$imp_session_control = 'none';
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => array('authentication' => 'none', 'session_control' => 'none')));
$self_url = Horde::selfUrl(false, true, true);
}
}
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
/* Determine if compose mode is disabled. */
$compose_disable = !IMP::canCompose();
}
}
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
/* The message text and headers. */
$msg = '';
}
-$imp_session_control = 'netscape';
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => array('session_control' => 'netscape')));
/* The message headers and text. */
$header = array();
* @package IMP
*/
-$imp_authentication = 'horde';
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => array('authentication' => 'horde')));
/* Get the lists of address books through the API. */
$source_list = $registry->call('contacts/sources');
* @package IMP
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
/* Initialize Fetchmail libraries. */
$fm_account = new IMP_Fetchmail_Account();
* @package IMP
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
require_once 'Horde/Prefs/UI.php';
extract(Horde::loadConfiguration('prefs.php', array('prefGroups', '_prefs'), 'imp'));
* @package IMP
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
/* Redirect back to the mailbox if folder use is not allowed. */
if (empty($conf['user']['allow_folders'])) {
* @package IMP
*/
-<<<<<<< Updated upstream
-/**
- * Utility function to return a url for the various images.
- */
-function _image($name, $alt)
-{
- static $cache = array();
-
- $val = $name['value'];
- if (!empty($cache[$val])) {
- return $cache[$val];
- }
-
- $cache[$val] = Horde::img($name['icon'], $name['alt'], null, $name['icondir']);
-
- return $cache[$val];
-}
-
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
+Horde::addScriptFile('folders.js', 'imp', true);
/* Redirect back to the mailbox if folder use is not allowed. */
if (!$conf['user']['allow_folders']) {
* @package IMP
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
$scripts = array(
array('ContextSensitive.js', 'imp', true),
*/
// Will redirect to login page if not authenticated.
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
// Load initial page as defined by view mode & preferences.
require IMP_Auth::getInitialPage();
*/
public function changeLanguage()
{
+ require_once dirname(__FILE__) . '/Application.php';
try {
- $GLOBALS['imp_authentication'] = 'throw';
- require_once dirname(__FILE__) . '/base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw')));
} catch (Horde_Exception $e) {
return;
}
*/
public function cacheOutput($params)
{
+ require_once dirname(__FILE__) . '/Application.php';
try {
- $GLOBALS['imp_authentication'] = 'throw';
- require_once dirname(__FILE__) . '/base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw')));
} catch (Horde_Exception $e) {
throw new Horde_Exception('No cache data available');
}
*/
public function prefsStatus()
{
- $GLOBALS['imp_authentication'] = 'none';
- require_once dirname(__FILE__) . '/base.php';
+ require_once dirname(__FILE__) . '/Application.php';
+ new IMP_Application(array('init' => array('authentication' => 'none')));
$notification = Horde_Notification::singleton();
$notification->detach('status');
*/
public function batchCompose($args = array(), $extra = array())
{
- $GLOBALS['imp_authentication'] = 'none';
- require_once dirname(__FILE__) . '/base.php';
+ require_once dirname(__FILE__) . '/Application.php';
+ new IMP_Application(array('init' => array('authentication' => 'none')));
$links = array();
foreach ($args as $i => $arg) {
*/
public function folderlist()
{
+ require_once dirname(__FILE__) . '/Application.php';
try {
- $GLOBALS['imp_authentication'] = 'throw';
- require_once dirname(__FILE__) . '/base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw')));
} catch (Horde_Exception $e) {
return false;
}
*/
public function createFolder($folder)
{
+ require_once dirname(__FILE__) . '/Application.php';
try {
- $GLOBALS['imp_authentication'] = 'throw';
- require_once dirname(__FILE__) . '/base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw')));
} catch (Horde_Exception $e) {
return false;
}
*/
public function deleteMessages($mailbox, $indices)
{
+ require_once dirname(__FILE__) . '/Application.php';
try {
- $GLOBALS['imp_authentication'] = 'throw';
- require_once dirname(__FILE__) . '/base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw')));
} catch (Horde_Exception $e) {
return false;
}
*/
public function copyMessages($mailbox, $indices, $target)
{
+ require_once dirname(__FILE__) . '/Application.php';
try {
- $GLOBALS['imp_authentication'] = 'throw';
- require_once dirname(__FILE__) . '/base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw')));
} catch (Horde_Exception $e) {
return false;
}
*/
public function moveMessages($mailbox, $indices, $target)
{
+ require_once dirname(__FILE__) . '/Application.php';
try {
- $GLOBALS['imp_authentication'] = 'throw';
- require_once dirname(__FILE__) . '/base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw')));
} catch (Horde_Exception $e) {
return false;
}
*/
public function flagMessages($mailbox, $indices, $flags, $set)
{
+ require_once dirname(__FILE__) . '/Application.php';
try {
- $GLOBALS['imp_authentication'] = 'throw';
- require_once dirname(__FILE__) . '/base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw')));
} catch (Horde_Exception $e) {
return false;
}
*/
public function msgEnvelope($mailbox, $indices)
{
+ require_once dirname(__FILE__) . '/Application.php';
try {
- $GLOBALS['imp_authentication'] = 'throw';
- require_once dirname(__FILE__) . '/base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw')));
} catch (Horde_Exception $e) {
return false;
}
*/
public function searchMailbox($mailbox, $query)
{
+ require_once dirname(__FILE__) . '/Application.php';
try {
- $GLOBALS['imp_authentication'] = 'throw';
- require_once dirname(__FILE__) . '/base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw')));
} catch (Horde_Exception $e) {
return false;
}
*/
public function mailboxCacheId($mailbox)
{
+ require_once dirname(__FILE__) . '/Application.php';
try {
- $GLOBALS['imp_authentication'] = 'throw';
- require_once dirname(__FILE__) . '/base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw')));
} catch (Horde_Exception $e) {
return false;
}
*/
public function server()
{
+ require_once dirname(__FILE__) . '/Application.php';
try {
- $GLOBALS['imp_authentication'] = 'throw';
- require_once dirname(__FILE__) . '/base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw')));
} catch (Horde_Exception $e) {
return null;
}
public function favouriteRecipients($limit,
$filter = array('new', 'forward', 'reply', 'redirect'))
{
- $GLOBALS['imp_authentication'] = 'none';
- require_once dirname(__FILE__) . '/base.php';
+ require_once dirname(__FILE__) . '/Application.php';
+ new IMP_Application(array('init' => array('authentication' => 'none')));
if ($GLOBALS['conf']['sentmail']['driver'] != 'none') {
$sentmail = IMP_Sentmail::factory();
<?php
+
+/* Determine the base directories. */
+$curr_dir = dirname(__FILE__);
+
+if (!defined('IMP_BASE')) {
+ define('IMP_BASE', $curr_dir . '/..');
+}
+
+if (!defined('HORDE_BASE')) {
+ /* If Horde does not live directly under the app directory, the HORDE_BASE
+ * constant should be defined in config/horde.local.php. */
+ if (file_exists(IMP_BASE . '/config/horde.local.php')) {
+ include IMP_BASE . '/config/horde.local.php';
+ } else {
+ define('HORDE_BASE', $curr_dir . '/../..');
+ }
+}
+
+/* Load the Horde Framework core (needed to autoload
+ * Horde_Registry_Application::). */
+require_once HORDE_BASE . '/lib/core.php';
+
/**
* IMP application API.
*
public $version = 'H4 (5.0-git)';
/**
+ * The auth type to use.
+ *
+ * @var string
+ */
+ static public $authType = null;
+
+ /**
+ * Disable compression of pages?
+ *
+ * @var boolean
+ */
+ static public $noCompress = false;
+
+ /**
* Constructor.
+ *
+ * @param array $args The following entries:
+ * <pre>
+ * 'init' - (boolean|array) If true, perform application init. If an
+ * array, perform application init and pass the array to init().
+ * </pre>
*/
- public function __construct()
+ public function __construct($args = array())
{
+ if (!empty($args['init'])) {
+ $this->init(is_array($args['init']) ? $args['init'] : array());
+ }
+
/* Only available if admin config is set for this server/login. */
+ $this->disabled = array('init');
if (empty($_SESSION['imp']['admin'])) {
- $this->disabled = array('authAddUser', 'authRemoveUser', 'authUserList');
+ $this->disabled = array_merge($this->disabled, array('authAddUser', 'authRemoveUser', 'authUserList'));
+ }
+ }
+
+ /**
+ * IMP base initialization.
+ *
+ * Global variables defined:
+ * $imp_imap - An IMP_Imap object
+ * $imp_mbox - Current mailbox information
+ * $imp_notify - A Horde_Notification_Listener object
+ * $imp_search - An IMP_Search object
+ *
+ * @param array $args Optional arguments:
+ * <pre>
+ * 'authentication' - (string) The type of authentication to use:
+ * 'horde' - Only use horde authentication
+ * 'none' - Do not authenticate
+ * 'throw' - Authenticate to IMAP/POP server; on no auth, throw a
+ * Horde_Exception
+ * [DEFAULT] - Authenticate to IMAP/POP server; on no auth redirect to
+ * login screen
+ * 'no_compress' - (boolean) Controls whether the page should be
+ * compressed.
+ * 'session_control' - (string) Sets special session control limitations:
+ * 'netscape' - TODO; start read/write session
+ * 'none' - Do not start a session
+ * 'readonly' - Start session readonly
+ * [DEFAULT] - Start read/write session
+ * </pre>
+ */
+ public function init($args = array())
+ {
+ $args = array_merge(array(
+ 'authentication' => null,
+ 'nocompress' => false,
+ 'session_control' => null
+ ), $args);
+
+ self::$authType = $args['authentication'];
+ self::$noCompress = $args['nocompress'];
+
+ // Registry.
+ $s_ctrl = 0;
+ switch ($args['session_control']) {
+ case 'netscape':
+ if ($GLOBALS['browser']->isBrowser('mozilla')) {
+ session_cache_limiter('private, must-revalidate');
+ }
+ break;
+
+ case 'none':
+ $s_ctrl = Horde_Registry::SESSION_NONE;
+ break;
+
+ case 'readonly':
+ $s_ctrl = Horde_Registry::SESSION_READONLY;
+ break;
}
+ $GLOBALS['registry'] = Horde_Registry::singleton($s_ctrl);
+
+ try {
+ $GLOBALS['registry']->pushApp('imp', array('check_perms' => ($args['authentication'] != 'none'), 'logintasks' => true));
+ } catch (Horde_Exception $e) {
+ if ($e->getCode() == Horde_Registry::AUTH_FAILURE) {
+ if (Horde_Util::getFormData('composeCache')) {
+ $imp_compose = IMP_Compose::singleton();
+ $imp_compose->sessionExpireDraft();
+ }
+
+ if ($args['authentication'] == 'throw') {
+ throw $e;
+ }
+ }
+
+ Horde_Auth::authenticateFailure('imp', $e);
+ }
+
+ // All other initialization occurs in IMP::initialize().
+ IMP::initialize();
}
/**
*/
public function authAuthenticate($userId, $credentials)
{
- $GLOBALS['imp_authentication'] = 'none';
- require_once dirname(__FILE__) . '/base.php';
+ $this->init(array('authentication' => 'none'));
$new_session = IMP_Auth::authenticate(array(
'password' => $credentials['password'],
*/
public function authTransparent()
{
- /* Transparent auth is a bit goofy - we most likely have reached this
- * code from the pushApp() call in base.php already. As such, some of
- * the IMP init has not yet been done, so we need to do the necessary
- * init here or else things will fail in IMP_Auth. */
- $GLOBALS['imp_authentication'] = 'none';
- require_once dirname(__FILE__) . '/base.php';
- IMP::initialize();
+ $this->init(array('authentication' => 'none'));
return IMP_Auth::transparent();
}
public function authAuthenticateCallback()
{
if (Horde_Auth::getAuth()) {
- require_once dirname(__FILE__) . '/base.php';
+ $this->init();
IMP_Auth::authenticateCallback();
}
}
static public $prefServer = null;
/**
- * The auth type to use.
- *
- * @var string
- */
- static public $authType = null;
-
- /**
* Authenticate to the mail server.
*
* @param array $credentials An array of login credentials. If empty,
static public function authenticate($credentials = array())
{
// Do 'horde' authentication.
- if (self::$authType == 'horde') {
+ if (IMP_Application::$authType == 'horde') {
if (Horde_Auth::getAuth()) {
return false;
}
function _content()
{
- $GLOBALS['imp_authentication'] = 'throw';
+ require_once dirname(__FILE__) . '/../Application.php';
try {
- require_once dirname(__FILE__) . '/../base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw')));
} catch (Horde_Exception $e) {
return;
}
function _content()
{
- $GLOBALS['imp_authentication'] = 'throw';
+ require_once dirname(__FILE__) . '/../Application.php';
try {
- require_once dirname(__FILE__) . '/../base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw')));
} catch (Horde_Exception $e) {
return;
}
{
global $notification, $prefs, $registry;
- $GLOBALS['imp_authentication'] = 'throw';
+ require_once dirname(__FILE__) . '/../Application.php';
try {
- require_once dirname(__FILE__) . '/../base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw')));
} catch (Horde_Exception $e) {
return;
}
function _buildTree(&$tree, $indent = 0, $parent = null)
{
- $GLOBALS['imp_authentication'] = 'throw';
+ require_once dirname(__FILE__) . '/../Application.php';
try {
- require_once dirname(__FILE__) . '/../base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw')));
} catch (Horde_Exception $e) {
return;
}
}
// Start compression.
- if (!Horde_Util::nonInputVar('imp_no_compress')) {
+ if (IMP_Application::$noCompress) {
Horde::compressOutput();
}
+++ /dev/null
-<?php
-/**
- * Script to determine the correct *_BASE values.
- *
- * Copyright 2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package IMP
- */
-
-$curr_dir = dirname(__FILE__);
-
-if (!defined('HORDE_BASE')) {
- /* Temporary fix - if horde does not live directly under the app
- * directory, the HORDE_BASE constant should be defined in
- * lib/base.local.php. */
- if (file_exists($curr_dir . '/base.local.php')) {
- include $curr_dir . '/base.local.php';
- } else {
- define('HORDE_BASE', $curr_dir . '/../..');
- }
-}
-
-if (!defined('IMP_BASE')) {
- define('IMP_BASE', $curr_dir . '/..');
-}
+++ /dev/null
-<?php
-/**
- * IMP base inclusion file. This file brings in all of the dependencies that
- * every IMP script will need, and sets up objects that all scripts use.
- *
- * The following global variables are used:
- * <pre>
- * $imp_authentication - The type of authentication to use:
- * 'horde' - Only use horde authentication
- * 'none' - Do not authenticate
- * 'throw' - Authenticate to IMAP/POP server; on no auth, throw a
- * Horde_Exception
- * [DEFAULT] - Authenticate to IMAP/POP server; on no auth redirect to login
- * screen
- * $imp_no_compress - Controls whether the page should be compressed
- * $imp_session_control - Sets special session control limitations:
- * 'netscape' - TODO; start read/write session
- * 'none' - Do not start a session
- * 'readonly' - Start session readonly
- * [DEFAULT] - Start read/write session
- * </pre>
- *
- * Global variables defined:
- * $imp_imap - An IMP_Imap object
- * $imp_mbox - Current mailbox information
- * $imp_notify - A Horde_Notification_Listener object
- * $imp_search - An IMP_Search object
- *
- * Copyright 1999-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @package IMP
- */
-
-// Determine BASE directories.
-require_once dirname(__FILE__) . '/base.load.php';
-
-// Load the Horde Framework core.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Registry.
-$s_ctrl = 0;
-switch (Horde_Util::nonInputVar('imp_session_control')) {
-case 'netscape':
- if ($browser->isBrowser('mozilla')) {
- session_cache_limiter('private, must-revalidate');
- }
- break;
-
-case 'none':
- $s_ctrl = Horde_Registry::SESSION_NONE;
- break;
-
-case 'readonly':
- $s_ctrl = Horde_Registry::SESSION_READONLY;
- break;
-}
-$registry = Horde_Registry::singleton($s_ctrl);
-
-// Determine imp authentication type.
-$authentication = Horde_Util::nonInputVar('imp_authentication');
-if ($authentication == 'horde') {
- // Autoloading for imp is not set until pushApp(), so need to add lib
- // path here explicitly.
- Horde_Autoloader::addClassPattern('/^IMP(?:$|_)/i', IMP_BASE . '/lib');
- IMP_Auth::$authType = 'horde';
-}
-
-try {
- $registry->pushApp('imp', array('check_perms' => ($authentication != 'none'), 'logintasks' => true));
-} catch (Horde_Exception $e) {
- if ($e->getCode() == Horde_Registry::AUTH_FAILURE) {
- if (Horde_Util::getFormData('composeCache')) {
- $imp_compose = IMP_Compose::singleton();
- $imp_compose->sessionExpireDraft();
- }
-
- if ($authentication == 'throw') {
- throw $e;
- }
- }
-
- Horde_Auth::authenticateFailure('imp', $e);
-}
-
-// All other initialization occurs in IMP::initialize().
-IMP::initialize();
* @package IMP
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
/* Determine if mailbox is readonly. */
$readonly = $imp_imap->isReadOnly($imp_mbox['mailbox']);
}
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
/* Call the mailbox redirection hook, if requested. */
try {
* @package IMP
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
$folder = Horde_Util::getFormData('folder');
$index = Horde_Util::getFormData('uid');
* @package IMP
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
/* Make sure we have a valid index. */
$imp_mailbox = IMP_Mailbox::singleton($imp_mbox['mailbox'], $imp_mbox['index']);
!$GLOBALS['prefs']->getValue('use_trash'));
}
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
/* We know we are going to be exclusively dealing with this mailbox, so
* select it on the IMAP server (saves some STATUS calls). Open R/W to clear
Horde_Util::closeWindowJS('opener.focus();opener.location.href="' . $href . '";');
}
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
$imp_pgp = Horde_Crypt::singleton(array('IMP', 'Pgp'));
$secure_check = Horde::isConnectionSecure();
* @package IMP
*/
-$imp_authentication = 'throw';
+require_once dirname(__FILE__) . '/lib/Application.php';
try {
- require_once dirname(__FILE__) . '/lib/base.php';
+ new IMP_Application(array('init' => array('authentication' => 'throw')));
} catch (Horde_Exception $e) {
//!$auth->authenticate($_SERVER['PHP_AUTH_USER'], array('password' => isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : null)))) {
header('WWW-Authenticate: Basic realm="IMP RSS Interface"');
* @package IMP
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
$id = Horde_Util::getFormData('id');
$index = Horde_Util::getFormData('index');
* @package IMP
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
/* Load mailbox page if searching is not allowed. */
if ($_SESSION['imp']['protocol'] == 'pop') {
}
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
$imp_smime = Horde_Crypt::singleton(array('IMP', 'Smime'));
$secure_check = Horde::isConnectionSecure();
* @package IMP
*/
-$imp_authentication = 'horde';
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => array('authentication' => 'horde')));
require_once 'Horde/Prefs/UI.php';
$compose_url = Horde::getServiceLink('options', 'imp');
/* Include Horde's core.php file. */
-require_once dirname(__FILE__) . '/lib/base.load.php';
-include_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
/* We should have loaded the Horde_String class, from the Horde_Util
* package, in core.php. If Horde_String:: isn't defined, then we're not
* @package IMP
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new IMP_Application(array('init' => true));
/* What mode are we in?
* DEFAULT/'thread' - Thread mode
return $len;
}
-require_once dirname(__FILE__) . '/lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
/* Don't compress if we are already sending in compressed format. */
$actionID = Horde_Util::getFormData('actionID');
-if (($actionID == 'download_all') || Horde_Util::getFormData('zip')) {
- $imp_no_compress = true;
-}
-
-$imp_session_control = 'readonly';
-require_once dirname(__FILE__) . '/lib/base.php';
+new IMP_Application(array('init' => array(
+ 'session_control' => 'readonly',
+ 'nocompress' => (($actionID == 'download_all') || Horde_Util::getFormData('zip'))
+)));
$ctype = Horde_Util::getFormData('ctype');
$id = Horde_Util::getFormData('id');