* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith');
if (!Horde_Util::getFormData('cancel')) {
$targetcalendar = Horde_Util::getFormData('targetcalendar');
return $result;
}
-// 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())) {
- $kronolith_session_control = 'readonly';
+ $session_control = 'readonly';
}
-$kronolith_session_timeout = 'json';
-require_once KRONOLITH_BASE . '/lib/base.php';
+try {
+ Horde_Registry::appInit('kronolith', 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) &&
+ ($action != 'LogOut')) {
+ $notification = Horde_Notification::singleton();
+ $k_notify = $notification->attach('status', array(), 'Kronolith_Notification_Listener_Status');
+ $notification->push(str_replace('&', '&', Horde_Auth::getLogoutUrl(array('reason' => Horde_Auth::REASON_SESSION))), 'kronolith.timeout', array('content.raw'));
+ Horde::sendHTTPResponse(Horde::prepareResponse(null, $k_notify), 'json');
+ exit;
+ }
+
+ Horde_Auth::authenticateFailure('kronolith', $e);
+}
// Process common request variables.
$cacheid = Horde_Util::getPost('cacheid');
* @package Kronolith
*/
-$kronolith_authentication = 'none';
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith', array('authentication' => 'none'));
$cal = Horde_Util::getFormData('c');
$id = Horde_Util::getFormData('e');
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith');
// Get the current attendees array from the session cache.
$attendees = (isset($_SESSION['kronolith']['attendees']) &&
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-@define('KRONOLITH_BASE', dirname(dirname(__FILE__)));
-require_once KRONOLITH_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('kronolith');
+
require_once KRONOLITH_BASE . '/lib/Forms/CreateCalendar.php';
// Exit if this isn't an authenticated user or if the user can't
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('kronolith');
+
require_once KRONOLITH_BASE . '/lib/Forms/DeleteCalendar.php';
// Exit if this isn't an authenticated user.
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('kronolith');
+
require_once KRONOLITH_BASE . '/lib/Forms/EditCalendar.php';
// Exit if this isn't an authenticated user.
return $url;
}
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('kronolith');
// Exit if this isn't an authenticated user.
if (!Horde_Auth::getAuth()) {
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('kronolith');
// Exit if this isn't an authenticated user.
if (!Horde_Auth::getAuth()) {
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('kronolith');
+
require_once KRONOLITH_BASE . '/lib/Forms/EditRemoteCalendar.php';
// Exit if this isn't an authenticated user or if the user can't
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('kronolith');
+
require_once KRONOLITH_BASE . '/lib/Forms/SubscribeRemoteCalendar.php';
// Exit if this isn't an authenticated user or if the user can't
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('kronolith');
+
require_once KRONOLITH_BASE . '/lib/Forms/UnsubscribeRemoteCalendar.php';
// Exit if this isn't an authenticated user or if the user can't
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith');
if (!Horde_Auth::getAuth()) {
Horde_Util::closeWindowJS();
return Horde_Data::IMPORT_FILE;
}
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith');
if (!$conf['menu']['import_export']) {
require KRONOLITH_BASE . '/index.php';
* @package Kronolith
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith');
$view = Kronolith::getView('Day');
$title = $view->getTime($prefs->getValue('date_format'));
* @package Kronolith
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith');
if (Kronolith_Resource::isResourceCalendar($c = Horde_Util::getFormData('calendar'))) {
$driver = 'Resource';
return true;
}
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith');
$kronolith_driver = Kronolith::getDriver();
* @package Kronolith
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith');
$viewName = Horde_Util::getFormData('view', 'Event');
$view = Kronolith::getView($viewName);
* @package Kronolith
*/
-$kronolith_authentication = 'none';
-$kronolith_session_control = 'none';
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith', array('authentication' => 'none', 'session_control' => 'none'));
// We want to always generate UTF-8 iCalendar data.
Horde_Nls::setCharset('UTF-8');
exit;
}
-$kronolith_authentication = 'none';
-$kronolith_session_control = 'readonly';
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('kronolith', array('authentication' => 'none', 'session_control' => 'readonly'));
$calendar = Horde_Util::getFormData('c');
$share = $kronolith_shares->getShare($calendar);
* not receive such a file, see also http://www.fsf.org/copyleft/gpl.html.
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith');
/* Load traditional interface? */
if (!$prefs->getValue('dynamic_view') || !$browser->hasFeature('xmlhttpreq') ||
*/
public function handle($args, $post)
{
- require_once dirname(__FILE__) . '/../../base.php';
global $ansel_storage;
$request = $args['action'];
*/
public function browse($path = '', $properties = array())
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
global $registry;
// Default properties.
*/
public function put($path, $content, $content_type)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
-
if (substr($path, 0, 9) == 'kronolith') {
$path = substr($path, 9);
}
*/
public function path_delete($path)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
-
if (substr($path, 0, 9) == 'kronolith') {
$path = substr($path, 9);
}
*/
public function listCalendars($owneronly = false, $permission = null)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
if (is_null($permission)) {
$permission = Horde_Perms::SHOW;
}
*/
public function listUids($calendar = null, $startstamp = 0, $endstamp = 0)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
-
if (empty($calendar)) {
$calendar = Kronolith::getDefaultCalendar();
}
*/
public function listBy($action, $timestamp, $calendar = null)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
-
if (empty($calendar)) {
$calendar = Kronolith::getDefaultCalendar();
}
*/
public function getActionTimestamp($uid, $action, $calendar = null)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
-
if (empty($calendar)) {
$calendar = Kronolith::getDefaultCalendar();
}
*/
public function import($content, $contentType, $calendar = null)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
-
if (!isset($calendar)) {
$calendar = Kronolith::getDefaultCalendar(Horde_Perms::EDIT);
}
*/
public function quickAdd($text, $calendar = null)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
global $kronolith_shares;
if (!isset($calendar)) {
*/
public function export($uid, $contentType)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
global $kronolith_shares;
$event = Kronolith::getDriver()->getByUID($uid);
*/
public function exportCalendar($calendar, $contentType)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
global $kronolith_shares;
if (!array_key_exists($calendar,
return true;
}
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
-
$kronolith_driver = Kronolith::getDriver();
$events = $kronolith_driver->getByUID($uid, null, true);
if (is_a($events, 'PEAR_Error')) {
*/
public function replace($uid, $content, $contentType)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
-
$event = Kronolith::getDriver()->getByUID($uid);
if (is_a($event, 'PEAR_Error')) {
return $event;
public function getFreeBusy($startstamp = null, $endstamp = null,
$calendar = null)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
-
if (is_null($calendar)) {
$calendar = Kronolith::getDefaultCalendar();
}
*/
public function eventFromUID($uid)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
-
$event = Kronolith::getDriver()->getByUID($uid);
if (is_a($event, 'PEAR_Error')) {
return $event;
*/
public function updateAttendee($response, $sender = null)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
-
$uid = $response->getAttribute('UID');
if (is_a($uid, 'PEAR_Error')) {
return $uid;
$calendars = null, $showRecurrence = true,
$alarmsOnly = false)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
-
if (!isset($calendars)) {
$calendars = array($GLOBALS['prefs']->getValue('default_share'));
} elseif (!is_array($calendars)) {
*/
public function listAlarms($time, $user = null)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
require_once 'Horde/Group.php';
$current_user = Horde_Auth::getAuth();
*/
public function lock($calendar, $event = null)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
-
if (!array_key_exists($calendar,
Kronolith::listCalendars(false, Horde_Perms::EDIT))) {
return PEAR::raiseError(_("Permission Denied"));
*/
public function unlock($calendar, $lockid)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
-
if (!array_key_exists($calendar,
Kronolith::listCalendars(false, Horde_Perms::EDIT))) {
return PEAR::raiseError(_("Permission Denied"));
*/
public function checkLocks($calendar, $event = null)
{
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
-
if (!array_key_exists($calendar,
Kronolith::listCalendars(false, Horde_Perms::READ))) {
return PEAR::raiseError(_("Permission Denied"));
/**
* Kronolith 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 (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
* @package Kronolith
*/
+
+/* Determine the base directories. */
+if (!defined('KRONOLITH_BASE')) {
+ define('KRONOLITH_BASE', dirname(__FILE__) . '/..');
+}
+
+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(KRONOLITH_BASE . '/config/horde.local.php')) {
+ include KRONOLITH_BASE . '/config/horde.local.php';
+ } else {
+ define('HORDE_BASE', KRONOLITH_BASE . '/..');
+ }
+}
+
+/* Load the Horde Framework core (needed to autoload
+ * Horde_Registry_Application::). */
+require_once HORDE_BASE . '/lib/core.php';
+
class Kronolith_Application extends Horde_Registry_Application
{
+ /**
+ * The application's version.
+ *
+ * @var string
+ */
public $version = 'H4 (3.0-git)';
/**
+ * Initialization function.
+ *
+ * Global variables defined:
+ * $kronolith_notify - A Horde_Notification_Listener object
+ * $kronolith_shares - TODO
+ * $notification - Notification object
+ *
+ * Global constants defined:
+ * KRONOLITH_TEMPLATES - (string) Location of template files.
+ *
+ * When calling Horde_Registry::appInit(), the following parameters are
+ * also supported:
+ * <pre>
+ * 'user' - (string) Set authentication to this user.
+ * </pre>
+ */
+ protected function _init()
+ {
+ if (isset($this->initParams['user'])) {
+ Horde_Auth::setAuth($this->initParams['user'], array());
+ }
+
+ if (!defined('KRONOLITH_TEMPLATES')) {
+ define('KRONOLITH_TEMPLATES', $GLOBALS['registry']->get('templates'));
+ }
+
+ /* For now, autoloading the Content_* classes depend on there being a
+ * registry entry for the 'content' application that contains at least
+ * the fileroot entry. */
+ Horde_Autoloader::addClassPattern('/^Content_/', $GLOBALS['registry']->get('fileroot', 'content') . '/lib/');
+ if (!class_exists('Content_Tagger')) {
+ throw new Horde_Exception('The Content_Tagger class could not be found. Make sure the registry entry for the Content system is present.');
+ }
+
+ /* Notification system. */
+ $GLOBALS['notification'] = Horde_Notification::singleton();
+ $GLOBALS['kronolith_notify'] = $GLOBALS['notification']->attach('status', null, 'Kronolith_Notification_Listener_Status');
+
+ /* Set the timezone variable, if available. */
+ Horde_Nls::setTimeZone();
+
+ /* Create a share instance. */
+ $GLOBALS['kronolith_shares'] = Horde_Share::singleton($GLOBALS['registry']->getApp());
+
+ Kronolith::initialize();
+ }
+
+ /**
* Returns a list of available permissions.
*
* @return array An array describing all available permissions.
return PEAR::raiseError(_("You are not allowed to remove user data."));
}
- $no_maint = true;
- require_once dirname(__FILE__) . '/base.php';
-
/* Remove all events owned by the user in all calendars. */
$result = Kronolith::getDriver()->removeUserData($user);
function _params()
{
- require_once dirname(__FILE__) . '/../base.php';
-
$params = array('calendar' => array('name' => _("Calendar"),
'type' => 'enum',
'default' => '__all'));
*/
function _title()
{
- require_once dirname(__FILE__) . '/../base.php';
-
$title = _("All Calendars");
$url = Horde::url($GLOBALS['registry']->getInitialPage(), true);
if (isset($this->_params['calendar']) &&
{
global $prefs;
- // @TODO Remove this hack when maintenance is refactored.
- $no_maint = true;
- require_once dirname(__FILE__) . '/../base.php';
-
if (isset($this->_params['calendar']) && $this->_params['calendar'] != '__all') {
if (empty($this->_share)) {
$this->_share = $GLOBALS['kronolith_shares']->getShare($this->_params['calendar']);
function _params()
{
- require_once dirname(__FILE__) . '/../base.php';
-
$params = array('calendar' => array('name' => _("Calendar"),
'type' => 'enum',
'default' => '__all'),
*/
function _content()
{
- // @TODO Remove this hack when maintenance is refactored.
- $no_maint = true;
- require_once dirname(__FILE__) . '/../base.php';
-
global $registry, $prefs;
Horde::addScriptFile('tooltips.js', 'horde');
function _params()
{
- require_once dirname(__FILE__) . '/../base.php';
-
$params = array('calendar' => array('name' => _("Calendar"),
'type' => 'enum',
'default' => '__all'),
*/
function _content()
{
- // @TODO Remove this hack when maintenance is refactored.
- $no_maint = true;
- require_once dirname(__FILE__) . '/../base.php';
-
global $registry, $prefs;
$GLOBALS['from_block'] = true;
function _params()
{
- @define('KRONOLITH_BASE', dirname(__FILE__) . '/../..');
-
- require_once KRONOLITH_BASE . '/lib/base.php';
-
$params = array('calendar' => array('name' => _("Calendar"),
'type' => 'enum',
'default' => '__all'),
*/
function _content()
{
- require_once dirname(__FILE__) . '/../base.php';
-
Horde::addScriptFile('tooltips.js', 'horde');
$now = new Horde_Date($_SERVER['REQUEST_TIME']);
function _buildTree(&$tree, $indent = 0, $parent = null)
{
- require_once dirname(__FILE__) . '/../base.php';
-
$horde_alarm = null;
if (!empty($GLOBALS['conf']['alarms']['driver'])) {
$horde_alarm = Horde_Alarm::factory();
*
* @package Kronolith
*/
-
-// NOTE: Still need this here in addition to base.php to avoid having to fully
-// initialize kronolith for each autocomplete ajax request.
-Horde_Autoloader::addClassPattern('/^Content_/', $GLOBALS['registry']->get('fileroot', 'content') . '/lib/');
class Kronolith_Tagger
{
/**
+++ /dev/null
-<?php
-/**
- * Script to determine the correct *_BASE values.
- *
- * Copyright 2009-2010 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 Kronolith
- */
-
-if (!defined('KRONOLITH_BASE')) {
- define('KRONOLITH_BASE', dirname(__FILE__) . '/..');
-}
-
-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(KRONOLITH_BASE . '/config/horde.local.php')) {
- include KRONOLITH_BASE . '/config/horde.local.php';
- } else {
- define('HORDE_BASE', KRONOLITH_BASE . '/..');
- }
-}
+++ /dev/null
-<?php
-/**
- * Kronolith base inclusion file.
- *
- * This file brings in all of the dependencies that every Kronolith
- * script will need, and sets up objects that all scripts use.
- *
- * 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
- * $no_compress - Controls whether the page should be compressed
- * </pre>
- *
- * @package Kronolith
- */
-
-// 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('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);
-
-try {
- $registry->pushApp('kronolith', array('check_perms' => (Horde_Util::nonInputVar('kronolith_authentication') != 'none'), 'logintasks' => true));
-} catch (Horde_Exception $e) {
- Horde_Auth::authenticateFailure('kronolith', $e);
-}
-$conf = &$GLOBALS['conf'];
-define('KRONOLITH_TEMPLATES', $registry->get('templates'));
-
-/* For now, autoloading the Content_* classes depend on there being a registry
- * entry for the 'content' application that contains at least the fileroot
- * entry. */
-Horde_Autoloader::addClassPattern('/^Content_/', $GLOBALS['registry']->get('fileroot', 'content') . '/lib/');
-if (!class_exists('Content_Tagger')) {
- throw new Horde_Exception('The Content_Tagger class could not be found. Make sure the registry entry for the Content system is present.');
-}
-
-/* Notification system. */
-$GLOBALS['notification'] = Horde_Notification::singleton();
-$GLOBALS['kronolith_notify'] = $GLOBALS['notification']->attach('status', null, 'Kronolith_Notification_Listener_Status');
-
-/* Start compression. */
-if (!Horde_Util::nonInputVar('no_compress')) {
- Horde::compressOutput();
-}
-
-/* Set the timezone variable, if available. */
-Horde_Nls::setTimeZone();
-
-/* Create a share instance. */
-$GLOBALS['kronolith_shares'] = Horde_Share::singleton($registry->getApp());
-
-Kronolith::initialize();
--FILE--
<?php
-require 'Horde/Cli.php';
+require dirname(__FILE__) . '/../Application.php';
Horde_Cli::init();
-$kronolith_authentication = 'none';
-require dirname(__FILE__) . '/../base.php';
-require 'Horde/iCalendar.php';
+Horde_Registry::appInit('kronolith', array('authentication' => 'none'));
$driver = new Kronolith_Driver();
$object = new Kronolith_Event_Sql($driver);
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith');
$view = Kronolith::getView('Month');
$title = $view->date->strftime('%B %Y');
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith');
/* Check permissions. */
$url = Horde::applicationUrl($prefs->getValue('defaultview') . '.php', true)
* @author Jan Schneider <jan@horde.org>
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith');
+
require_once 'Horde/Group.php';
$shares = Horde_Share::singleton('kronolith');
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-@define('KRONOLITH_BASE', dirname(dirname(__FILE__)));
-require_once KRONOLITH_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('kronolith');
+
require_once KRONOLITH_BASE . '/lib/Forms/CreateResource.php';
// Exit if this isn't an authenticated, administrative user
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('kronolith');
+
require_once KRONOLITH_BASE . '/lib/Forms/DeleteResource.php';
// Exit if this isn't an authenticated administrative user.
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('kronolith');
+
require_once KRONOLITH_BASE . '/lib/Forms/EditResource.php';
// Exit if this isn't an authenticated administrative user.
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('kronolith');
+
require_once KRONOLITH_BASE . '/lib/Forms/CreateResourceGroup.php';
// Exit if this isn't an authenticated, administrative user
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('kronolith');
+
require_once KRONOLITH_BASE . '/lib/Forms/DeleteResourceGroup.php';
// Exit if this isn't an authenticated administrative user.
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('kronolith');
+
require_once KRONOLITH_BASE . '/lib/Forms/EditResourceGroup.php';
// Exit if this isn't an authenticated administrative user.
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*/
-require_once dirname(__FILE__) . '/../../lib/base.php';
+
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('kronolith');
$title = _("Resource Groups");
return $url;
}
?>
-</div>
\ No newline at end of file
+</div>
* See the enclosed file COPYING for license information (GPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*/
-require_once dirname(__FILE__) . '/../lib/base.php';
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('kronolith');
$title = _("Edit resources");
return $url;
}
?>
-</div>
\ No newline at end of file
+</div>
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-$kronolith_authentication = 'none';
-require_once dirname(__FILE__) . '/../lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith', array('authentication' => 'none'));
// Make sure no one runs this from the web.
if (!Horde_Cli::runningFromCLI()) {
*/
// Do CLI checks and environment setup first.
-require_once dirname(__FILE__) . '/../../lib/core.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
// Makre sure no one runs this from the web.
if (!Horde_Cli::runningFromCli()) {
$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());
-}
-
-// 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 dirname(__FILE__) . '/../lib/base.php';
+Horde_Registry::appInit('kronolith', array('authentication' => 'none', 'user' => $conf['auth']['admins'] ? $conf['auth']['admins'][0] : array()));
// Connect to database.
$db = DB::connect($dsn);
*/
/* Set up the CLI environment. */
-require_once dirname(__FILE__) . '/../../lib/base.load.php';
-require_once HORDE_BASE . '/lib/core.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
if (!Horde_Cli::runningFromCLI()) {
exit("Must be run from the command line\n");
}
$cli->init();
/* Load required libraries. */
-$kronolith_authentication = 'none';
-require_once KRONOLITH_BASE . '/../../lib/base.php';
+Horde_Registry::appInit('kronolith', array('authentication' => 'none'));
/* Prepare DB stuff. */
PEAR::staticPushErrorHandling(PEAR_ERROR_DIE);
* @author Meilof Veeningen <meilof@gmail.com>
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith');
/* Get search parameters. */
$search_mode = Horde_Util::getFormData('search_mode', 'basic');
* @author Chuck Hagenbuch <chuck@horde.org>
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith');
$view = Kronolith::getView(Horde_Util::getFormData('view'));
if ($view) {
* @package Kronolith
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith');
$view = Kronolith::getView('Week');
$title = sprintf(_("Week %d"), $view->week);
* @package Kronolith
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith');
$view = Kronolith::getView('WorkWeek');
$title = sprintf(_("Week %d"), $view->week);
* @package Kronolith
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('kronolith');
$view = Kronolith::getView('Year');
$title = $view->year;