* @author Jan Schneider <jan@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
-
-if (!Horde_Auth::isAdmin()) {
- Horde::authenticationFailureRedirect();
-}
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('admin' => true));
$horde_alarm = Horde_Alarm::factory();
$methods = array();
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
-
-if (!Horde_Auth::isAdmin()) {
- throw new Horde_Exception('Forbidden.');
-}
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('admin' => true));
$title = _("Command Shell");
require HORDE_TEMPLATES . '/common-header.inc';
}
}
-require_once dirname(__FILE__) . '/../lib/base.php';
-require_once 'Horde/DataTree.php';
-
-if (!Horde_Auth::isAdmin()) {
- Horde::authenticationFailureRedirect();
-}
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('admin' => true));
+require_once 'Horde/DataTree.php';
$tree = Horde_Tree::factory('datatree', 'Html');
$tree->setOption('alternate', true);
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
-require_once 'Horde/Group.php';
-
-if (!Horde_Auth::isAdmin()) {
- Horde::authenticationFailureRedirect();
-}
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('admin' => true));
+require_once 'Horde/Group.php';
$groups = Group::singleton();
$auth = Horde_Auth::singleton($conf['auth']['driver']);
* @author Jan Schneider <jan@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
-
-if (!Horde_Auth::isAdmin()) {
- Horde::authenticationFailureRedirect();
-}
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application(array('admin' => true));
/* Set up the form variables. */
$vars = Horde_Variables::getDefaultVariables();
* @author Jan Schneider <jan@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
-
-if (!Horde_Auth::isAdmin()) {
- Horde::authenticationFailureRedirect();
-}
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application(array('admin' => true));
/* Set up the form variables. */
$vars = Horde_Variables::getDefaultVariables();
* @author Jan Schneider <jan@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
-
-if (!Horde_Auth::isAdmin()) {
- Horde::authenticationFailureRedirect();
-}
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application(array('admin' => true));
/* Set up the form variables. */
$vars = &Horde_Variables::getDefaultVariables();
* @author Jan Schneider <jan@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
-
-if (!Horde_Auth::isAdmin()) {
- Horde::authenticationFailureRedirect();
-}
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application(array('admin' => true));
$perm_id = Horde_Util::getFormData('perm_id');
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
-
-if (!Horde_Auth::isAdmin()) {
- Horde::authenticationFailureRedirect();
-}
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('admin' => true));
$title = _("PHP Shell");
Horde::addScriptFile('stripe.js', 'horde');
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
-
-if (!Horde_Auth::isAdmin()) {
- Horde::authenticationFailureRedirect();
-}
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('admin' => true));
$type = !empty($conf['sessionhandler']['type']) ? $conf['sessionhandler']['type'] : 'none';
if ($type == 'external') {
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
-require_once 'Horde/Config.php';
-
-if (!Horde_Auth::isAdmin()) {
- throw new Horde_Exception('Forbidden.');
-}
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application(array('admin' => true));
if (!Horde_Util::extensionExists('domxml') &&
!Horde_Util::extensionExists('dom')) {
}
$vars = Horde_Variables::getDefaultVariables();
+
+require_once 'Horde/Config.php';
$form = new ConfigForm($vars, $app);
$form->setButtons(sprintf(_("Generate %s Configuration"), $appname));
if (file_exists($registry->get('fileroot', $app) . '/config/conf.bak.php')) {
* did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
-
-if (!Horde_Auth::isAdmin()) {
- throw new Horde_Exception('Forbidden.');
-}
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application(array('admin' => true));
/* Set up the diff renderer. */
$render_type = Horde_Util::getFormData('render', 'inline');
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
-
-if (!Horde_Auth::isAdmin()) {
- throw new Horde_Exception('Forbidden.');
-}
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application(array('admin' => true));
/**
* Does an FTP upload to save the configuration.
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
-
-if (!Horde_Auth::isAdmin()) {
- throw new Horde_Exception('Forbidden.');
-}
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application(array('admin' => true));
/* Get form data. */
$setup = Horde_Util::getFormData('setup');
* @author Jan Schneider <jan@horde.org>
*/
-$horde_authentication = 'none';
require_once dirname(__FILE__) . '/../lib/base.php';
+new Horde_Application(array('authentication' => 'none'));
// Make sure signups are enabled before proceeding
$auth = Horde_Auth::singleton($conf['auth']['driver']);
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
-
-if (!Horde_Auth::isAdmin()) {
- throw new Horde_Exception('Forbidden.');
-}
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('admin' => true));
$title = _("SQL Shell");
Horde::addScriptFile('stripe.js', 'horde');
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('admin' => true));
-if (!Horde_Auth::isAdmin()) {
- throw new Horde_Exception('Forbidden.');
-}
$auth = Horde_Auth::singleton($conf['auth']['driver']);
if ($conf['signup']['allow'] && $conf['signup']['approve']) {
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-$horde_authentication = 'none';
-$horde_no_logintasks = true;
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new Horde_Application(array('authentication' => 'none', 'nologintasks' => true));
$main_page = Horde_Util::nonInputVar('horde_login_url', Horde_Util::getFormData('url'));
/**
* Horde application API.
*
+ * This file defines Horde's core API interface. Other core Horde libraries
+ * can interact with Horde through this API.
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
* @package Horde
*/
+
+/* Load the Horde Framework core (needed to autoload
+ * Horde_Registry_Application::). */
+require_once dirname(__FILE__) . '/core.php';
+
class Horde_Application extends Horde_Registry_Application
{
+ /**
+ * The application's version.
+ *
+ * @var string
+ */
public $version = '4.0-git';
/**
+ * Constructor.
+ *
+ * Global variables defined:
+ * $notification - Notification object
+ * $registry - Registry object
+ *
+ * Global constants defined:
+ * HORDE_TEMPLATES - (string) Location of template files.
+ *
+ * @param array $args Optional arguments:
+ * <pre>
+ * 'admin' - (boolean) Require authenticated user to be and admin?
+ * 'authentication' - (string) The type of authentication to use:
+ * 'none' - Do not authenticate
+ * 'throw' - Authenticate; on no auth, throw a Horde_Exception
+ * [DEFAULT] - Authenticate; on no auth redirect to login screen
+ * 'nocompress' - (boolean) Controls whether the page should be
+ * compressed.
+ * 'nologintasks' - (boolean) If set, don't perform logintasks (never
+ * performed if authentication is 'none').
+ * 'session_control' - (string) Sets special session control limitations:
+ * 'none' - Do not start a session
+ * 'readonly' - Start session readonly
+ * [DEFAULT] - Start read/write session
+ * </pre>
+ */
+ public function __construct($args = array())
+ {
+ $args = array_merge(array(
+ 'admin' => false,
+ 'authentication' => null,
+ 'nocompress' => false,
+ 'nologintasks' => false,
+ 'session_control' => null
+ ), $args);
+
+ // Registry.
+ $s_ctrl = 0;
+ switch ($args['session_control']) {
+ 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('horde', array('check_perms' => ($args['authentication'] != 'none'), 'logintasks' => !$args['nologintasks']));
+
+ if ($args['admin'] && !Horde_Auth::isAdmin()) {
+ throw new Horde_Exception('Not an admin');
+ }
+ } catch (Horde_Exception $e) {
+ if ($args['authentication'] == 'throw') {
+ throw $e;
+ }
+
+ Horde_Auth::authenticateFailure('horde', $e);
+ }
+
+ if (!defined('HORDE_TEMPLATES')) {
+ define('HORDE_TEMPLATES', $GLOBALS['registry']->get('templates'));
+ }
+
+ $GLOBALS['notification'] = Horde_Notification::singleton();
+ $GLOBALS['notification']->attach('status');
+
+ // Start compression.
+ if (!$args['nocompress']) {
+ Horde::compressOutput();
+ }
+ }
+
+ /**
* Returns a list of available permissions.
*/
public function perms()
+++ /dev/null
-<?php
-/**
- * Horde base inclusion file.
- *
- * This file brings in all of the dependencies that Horde framework-level
- * scripts will need, and sets up objects that all scripts use.
- *
- * The following global variables are used:
- * <pre>
- * $horde_authentication - The type of authentication to use:
- * 'ignore' - Authenticate; on no auth, ignore error
- * 'none' - Do not authenticate
- * [DEFAULT] - Authenticate; on no auth, redirect to login screen
- * $horde_no_compress - Controls whether the page should be compressed
- * $horde_no_logintasks - Don't perform logintasks (logintasks are never
- * performend if $horde_authentication == 'none')
- * $horde_session_control - Sets special session control limitations:
- * 'none' - Do not start a session
- * 'readonly' - Start session readonly
- * [DEFAULT] - Start read/write session
- * </pre>
- *
- * Copyright 1999-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- */
-
-// Load the Horde Framework core, and set up inclusion paths.
-require_once dirname(__FILE__) . '/core.php';
-
-// Registry.
-$s_ctrl = 0;
-switch (Horde_Util::nonInputVar('horde_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('horde_authentication');
-try {
- $registry->pushApp('horde', array('check_perms' => ($authentication != 'none'), 'logintasks' => (($authentication != 'none') && !Horde_Util::nonInputVar('horde_no_logintasks'))));
-} catch (Horde_Exception $e) {
- if (($e->getCode() == Horde_Registry::AUTH_FAILURE) &&
- ($authentication == 'ignore')) {
- /* Push app without doing checks. */
- $registry->pushApp('horde', array('check_perms' => false));
- } else {
- Horde_Auth::authenticateFailure('horde', $e);
- }
-}
-$conf = &$GLOBALS['conf'];
-@define('HORDE_TEMPLATES', $registry->get('templates'));
-
-// Notification System.
-$notification = Horde_Notification::singleton();
-$notification->attach('status');
-
-// Compress output
-if (!Horde_Util::nonInputVar('horde_no_compress')) {
- Horde::compressOutput();
-}
/* Try to login - if we are doing auth to an app, we need to auth to
* Horde first or else we will lose the session. Ignore any auth errors.
- * Transparent authentication is handled by the Horde_Registry::pushApp() call
- * in base.php. */
-$horde_authentication = 'ignore';
-$horde_no_logintasks = true;
-require_once dirname(__FILE__) . '/lib/base.php';
+ * Transparent authentication is handled by the Horde_Application::
+ * constructor. */
+require_once dirname(__FILE__) . '/lib/Application.php';
+try {
+ new Horde_Application(array('authentication' => 'throw', 'nologintasks' => true));
+} catch (Horde_Exception $e) {}
$app = Horde_Util::getFormData('app');
$is_auth = Horde_Auth::getAuth();
* no nested components?
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new Horde_Application();
// Set up our request and routing objects
$request = new Horde_Controller_Request_Http();
require_once dirname(__FILE__) . '/lib/core.php';
-$input = null;
+$input = $session_control = null;
+$nocompress = false;
$params = array();
/* Look at the Content-type of the request, if it is available, to try
if (strpos($_SERVER['CONTENT_TYPE'], 'application/vnd.syncml+xml') !== false) {
$serverType = 'Syncml';
/* Syncml does its own session handling. */
- $horde_session_control = 'none';
- $horde_no_compress = true;
+ $session_control = 'none';
+ $nocompress = true;
} elseif (strpos($_SERVER['CONTENT_TYPE'], 'application/vnd.syncml+wbxml') !== false) {
$serverType = 'Syncml_Wbxml';
/* Syncml does its own session handling. */
- $horde_session_control = 'none';
- $horde_no_compress = true;
+ $session_control = 'none';
+ $nocompress = true;
} elseif (strpos($_SERVER['CONTENT_TYPE'], 'text/xml') !== false) {
$input = Horde_Rpc::getInput();
/* Check for SOAP namespace URI. */
if ($serverType == 'Soap' &&
(!isset($_SERVER['REQUEST_METHOD']) ||
$_SERVER['REQUEST_METHOD'] != 'POST')) {
- $horde_session_control = 'none';
+ $session_control = 'none';
$params['requireAuthorization'] = false;
if (Horde_Util::getGet('wsdl') !== null) {
$input = 'wsdl';
}
/* Load base libraries. */
-$horde_authentication = 'none';
-require_once HORDE_BASE . '/lib/base.php';
+new Horde_Application(array('authentication' => 'none', 'nocompress' => $nocompress, 'session_control' => $session_control));
/* Load the RPC backend based on $serverType. */
$server = Horde_Rpc::factory($serverType, $params);
Horde_Cli::init();
// Include needed libraries.
-$horde_authentication = 'none';
-require_once HORDE_BASE . '/lib/base.php';
+new Horde_Application(array('authentication' => 'none'));
// Authenticate as administrator.
if (!count($conf['auth']['admins'])) {
* @author Jan Schneider <jan@horde.org>
*/
-$horde_authentication = 'none';
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('authentication' => 'none'));
$auth = Horde_Auth::singleton($conf['auth']['driver']);
* @author Joel Vandal <joel@scopserv.com>
*/
-$horde_authentication = 'none';
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('authentication' => 'none'));
$auth = Horde_Auth::singleton($conf['auth']['driver']);
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once '../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application();
$auth = Horde_Auth::singleton($conf['auth']['driver']);
$data = $argv[1];
// Make sure we load Horde base to get the auth config
-$horde_authentication = 'none';
-require_once HORDE_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('authentication' => 'none'));
+
require_once dirname(__FILE__) . '/import_squirrelmail_prefs.php';
// Get list of SquirrelMail pref files
$dsn = $argv[1];
// Make sure we load Horde base to get the auth config
-$horde_authentication = 'none';
-require_once HORDE_BASE . '/lib/base.php';
+new Horde_Application(array('authentication' => 'none'));
+
require_once dirname(__FILE__) . '/import_squirrelmail_prefs.php';
// Connect to database.
Horde_Cli::init();
$cli = Horde_Cli::singleton();
-$horde_authentication = 'none';
-require_once HORDE_BASE . '/lib/base.php';
-require_once 'Horde/DataTree.php';
+new Horde_Application(array('authentication' => 'none'));
+require_once 'Horde/DataTree.php';
$datatree = DataTree::factory('sql',
array_merge(
Horde::getDriverConfig('datatree', 'sql'),
// Do CLI checks and environment setup first.
require_once dirname(__FILE__) . '/../../lib/core.php';
-require_once 'Horde/Group.php';
// Make sure no one runs this from the web.
if (!Horde_Cli::runningFromCLI()) {
// some variables, etc.
Horde_Cli::init();
-$horde_authentication = 'none';
-require_once HORDE_BASE . '/lib/base.php';
+new Horde_Application(array('authentication' => 'none'));
+require_once 'Horde/Group.php';
$g = Group::factory();
$group_query = '
// some variables, etc.
Horde_Cli::init();
-$horde_authentication = 'none';
-require_once HORDE_BASE . '/lib/base.php';
+new Horde_Application(array('authentication' => 'none'));
$p = Perms::factory('datatree');
// some variables, etc.
Horde_Cli::init();
-$horde_authentication = 'none';
-require_once HORDE_BASE . '/lib/base.php';
+new Horde_Application(array('authentication' => 'none'));
+
$cli = Horde_Cli::singleton();
$cManager = new Horde_Prefs_CategoryManager();
$apps = $registry->listApps(array('hidden', 'notoolbar', 'active', 'admin'));
$cli->writeln($cli->yellow("Beginning migration. This may take a very long time to complete."));
$cli->writeln();
-$horde_authentication = 'none';
-require_once HORDE_BASE . '/lib/base.php';
-require_once 'Horde/DataTree.php';
+new Horde_Application(array('authentication' => 'none'));
+require_once 'Horde/DataTree.php';
$datatree = DataTree::factory('sql', array_merge(Horde::getDriverConfig('datatree', 'sql'),
array('group' => 'horde.history')));
-$db = &$datatree->_db;
+$db = $datatree->_db;
$cli->writeln('Fetching all history objects from the data tree.'); ob_flush();
$objects = $db->getAll("SELECT c.datatree_id, c.datatree_name, c.datatree_parents, c.datatree_order FROM horde_datatree c WHERE c.group_uid = 'horde.history' order by datatree_id",DB_FETCHMODE_ASSOC);
} else {
$session_cache_limiter = 'nocache';
}
-$horde_no_logintasks = true;
-$horde_session_control = 'readonly';
-require_once HORDE_BASE . '/lib/base.php';
+
+new Horde_Application(array('authentication' => 'none', 'session_control' => 'readonly'));
switch ($type) {
case 'app':
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-$horde_no_logintasks = true;
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('nologintasks' => true));
$cid = Horde_Util::getFormData('cid');
if (empty($cid)) {
* @author Jason Felice <jason.m.felice@gmail.com>
*/
-$horde_no_logintasks = true;
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('nologintasks' => true));
// Make sure auth backend allows passwords to be reset.
$auth = Horde_Auth::singleton($conf['auth']['driver']);
* @author Jan Schneider <jan@horde.org>
*/
-$horde_no_logintasks = true;
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('nologintasks' => true));
$identity = Horde_Prefs_Identity::singleton();
list($message, $type) = $identity->confirmIdentity(Horde_Util::getFormData('h'));
*
* @author Michael J. Rubinsky <mrubinsk@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application();
if (empty($GLOBALS['conf']['facebook']['enabled']) ||
empty($GLOBALS['conf']['facebook']['key']) ||
* @author Marko Djukic <marko@oblo.com>
*/
-$horde_authentication = 'none';
-$horde_session_control = 'none';
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('authentication' => 'none', 'session_control' => 'none'));
if (empty($_GET['url'])) {
exit;
* did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
*/
-$horde_authentication = 'none';
-require_once dirname(__FILE__) . '/../../lib/base.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application(array('authentication' => 'none'));
$rtl = isset(Horde_Nls::$config['rtl'][$language]);
$title = _("Help");
* @author Marko Djukic <marko@oblo.com>
*/
-$horde_no_logintasks = true;
-require_once dirname(__FILE__) . '/../../lib/base.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application(array('nologintasks' => true));
/* Get file info. The following parameters are available:
* 'f' - the filename.
}
}
-/* Determine if we can get away with a readonly session */
-if (empty($args['sessionWrite'])) {
- $horde_session_control = 'readonly';
-}
-$horde_no_logintasks = true;
-require_once dirname(__FILE__) . '/../lib/base.php';
+new Horde_Application(array('nologintasks' => true, 'session_control' => empty($args['sessionWrite']) ? 'readonly' : null));
+$impleargs = $impleName;
if (isset($args['impleApp'])) {
$registry = Horde_Registry::singleton();
$registry->pushApp($args['impleApp']);
- $imple = Horde_Ajax_Imple::factory(array($args['impleApp'], $impleName));
-} else {
- $imple = Horde_Ajax_Imple::factory($impleName);
+ $impleargs = array($args['impleApp'], $impleName);
}
+$imple = Horde_Ajax_Imple::factory($impleargs);
$result = $imple->handle($args, $post);
$ct = empty($_SERVER['Content-Type'])
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/core.php';
-
-$registry = Horde_Registry::singleton(Horde_Registry::SESSION_READONLY);
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('session_control' => 'readonly'));
// Figure out if we've been inlined, or called directly.
$send_headers = strstr($_SERVER['PHP_SELF'], 'javascript.php');
$script_file = $registry->get('templates', $app) . '/javascript/' . $file;
if (file_exists($script_file)) {
$registry->pushApp($app, array('check_perms' => false));
- $script = Horde_Util::bufferOutput('require', $script_file);
-
- if ($send_headers) {
- /* Compress the JS. We need this explicit call since we
- * don't include base.php in this file. */
- Horde::compressOutput();
-
- header('Cache-Control: no-cache');
- header('Content-Type: text/javascript');
- }
- echo $script;
+ header('Cache-Control: no-cache');
+ header('Content-Type: text/javascript');
+ require $script_file;
}
}
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-$horde_no_logintasks = true;
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('nologintasks' => true));
$title = _("Special Character Input");
require HORDE_TEMPLATES . '/common-header.inc';
* @author Marko Djukic <marko@oblo.com>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application();
/* Set the language. */
$_SESSION['horde_language'] = Horde_Nls::select();
* @author Michael Slusarz <slusarz@horde.org>
*/
-$horde_no_logintasks = true;
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('nologintasks' => true));
/* If no 'module' parameter passed in, die with an error. */
if (!($app = basename(Horde_Util::getFormData('app')))) {
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application();
$path = Horde_Util::getFormData('path');
* @author Michael J. Rubinksy <mrubinsk@horde.org>
*/
-$horde_no_logintasks = true;
-require_once dirname(__FILE__) . '/../../lib/base.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application(array('nologintaks' => true));
// If/when more apps support the searchTags api calls, we should probably
// find a better solution to putting the apps hardcoded like this.
* @author Jan Schneider <jan@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application();
// Instantiate the blocks objects.
$blocks = Horde_Block_Collection::singleton('portal');
* @author Mike Cochrane <mike@graftonhall.co.nz>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application();
// Get full name.
$identity = Horde_Prefs_Identity::singleton();
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
-
-if (!Horde_Auth::getAuth()) {
- header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('login.php', true), 'url', Horde::selfUrl(), false));
- exit;
-}
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application();
$identity = Horde_Prefs_Identity::singleton();
$fullname = $identity->getValue('fullname');
* @author Jan Schneider <jan@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application();
$rpc_servers = @unserialize($prefs->getValue('remote_summaries'));
if (!is_array($rpc_servers)) {
return $menu;
}
-$horde_authentication = 'none';
-require_once dirname(__FILE__) . '/../../lib/base.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application(array('authentication' => 'none'));
if (!Horde_Auth::getAuth() && !$conf['menu']['always']) {
Horde_Auth::authenticateFailure();
* @author Karsten Fourmont <karsten@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application();
$backend = SyncML_Backend::factory('Horde');
exit;
}
-$horde_authentication = 'none';
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('authentication' => 'none'));
if (!Horde::showService('problem')) {
_returnToPage();
* @author Marko Djukic <marko@oblo.com>
*/
-$horde_authentication = 'none';
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('authentication' => 'none'));
// Make sure auth backend allows passwords to be reset.
$auth = Horde_Auth::singleton($conf['auth']['driver']);
* @author Chuck Hagenbuch <chuck@horde.org>
*/
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+new Horde_Application();
+
+// Exit if the user shouldn't be able to change share permissions.
+if (!empty($conf['share']['no_sharing'])) {
+ throw new Horde_Exception('Permission denied.');
+}
+
$fieldsList = array(
'show' => 0,
'read' => 1,
'delete' => 3
);
-@define('HORDE_BASE', dirname(__FILE__) . '/../..');
-require_once dirname(__FILE__) . '/../../lib/base.php';
-require_once 'Horde/Group.php';
-
-// Exit if the user shouldn't be able to change share permissions.
-if (!empty($conf['share']['no_sharing'])) {
- exit('permission denied');
-}
-
$app = Horde_Util::getFormData('app');
$shares = Horde_Share::singleton($app);
$groups = Group::singleton();
* @author Jan Schneider <jan@horde.org>
*/
-$horde_no_logintasks = true;
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('nologintasks' => true));
$alarm = Horde_Alarm::factory();
$id = Horde_Util::getPost('alarm');
*
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application();
if (empty($GLOBALS['conf']['twitter']['enabled'])) {
$horde_url = Horde::url($registry->get('webroot', 'horde') . '/index.php');
* @author Ben Klang <ben@alkaloid.net>
*/
-$horde_no_logintasks = true;
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+new Horde_Application(array('nologintasks' => true));
$twitter = new Services_Twitter($_SESSION['horde']['twitterblock']['username'],
$_SESSION['horde']['twitterblock']['password']);
* @author Marko Djukic <marko@oblo.com>
*/
-$horde_authentication = 'none';
-require_once dirname(__FILE__) . '/lib/base.php';
-require_once 'Horde/Auth/Signup.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+new Horde_Application(array('authentication' => 'none'));
$auth = Horde_Auth::singleton($conf['auth']['driver']);
}
$vars = Horde_Variables::getDefaultVariables();
+require_once 'Horde/Auth/Signup.php';
$formsignup = new HordeSignupForm($vars);
if ($formsignup->validate()) {
$formsignup->getInfo($vars, $info);