Solves chicken-and-egg problem - need a way to init Horde environment
from application without an active Horde_Registry object.
Page compression will be started (if configured).
Global variables defined:
- $browser: Horde_Browser object - $cli: Horde_Cli object (if 'cli' is true) - $conf: Configuration array - $injector: Horde_Injector object - $language: Language - $notification: Horde_Notification object - $page_output: Horde_PageOutput object - $prefs: Horde_Prefs object - $registry: Horde_Registry object - $session: Horde_Session object
public static appInit ( string $app, array $args = [] ) : Horde_Registry_Application | ||
$app | string | The application to initialize. |
$args | array | Optional arguments:
- admin: (boolean) Require authenticated user to be an admin? DEFAULT: false - authentication: (string) The type of authentication to use: - none: Do not authenticate - fallback: Attempt to authenticate; if failure, then don't auth (@since 2.11.0). - [DEFAULT]: Authenticate; on no auth redirect to login screen - cli: (boolean) Initialize a CLI interface. Setting this to true implicitly sets 'authentication' to 'none' and 'admin' and 'nocompress' to true. DEFAULT: false - nocompress: (boolean) If set, the page will not be compressed. DEFAULT: false - nologintasks: (boolean) If set, don't perform logintasks (never performed if authentication is 'none'). DEFAULT: false - nonotificationinit: (boolean) If set, don't initialize the application handlers for the notification system (@since 2.12.0). - permission: (array) The permission required by the user to access the page. The first element (REQUIRED) is the permission name. The second element (OPTION; defaults to SHOW) is the permission level. - session_cache_limiter: (string) Use this value for the session cache limiter. DEFAULT: Uses the value in the config. - session_control: (string) 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 - test: (boolean) Is this the test script? If so, we relax several sanity checks and don't load things from the cache. DEFAULT: false - timezone: (boolean) Set the time zone? DEFAULT: false - user_admin: (boolean) Set authentication to an admin user? DEFAULT: false |
return | Horde_Registry_Application | The application object. |
/** * Constructor. * * @param array $params A hash containing connection parameters. * @throws Horde_Vfs_Exception */ public function __construct($params = array()) { parent::__construct($params); if (!isset($this->_params['horde_base'])) { throw new Horde_Vfs_Exception('Required "horde_base" not specified in VFS configuration.'); } require_once $this->_params['horde_base'] . '/lib/Application.php'; Horde_Registry::appInit('horde'); // Create the Registry object. $this->_registry = $GLOBALS['registry']; }
/** * Creates and loads a basic conf.php configuration file. */ public function init() { // Check if conf.php is writeable. if (file_exists(HORDE_BASE . '/config/conf.php') && !is_writable(HORDE_BASE . '/config/conf.php') || !is_writable(HORDE_BASE . '/config')) { $this->_cli->message(Horde_Util::realPath(HORDE_BASE . '/config/conf.php') . ' is not writable.', 'cli.error'); } // We need a valid conf.php to instantiate the registry. if (!file_exists(HORDE_BASE . '/config/conf.php')) { copy(HORDE_BASE . '/config/conf.php.dist', HORDE_BASE . '/config/conf.php'); } // Initialization $umask = umask(); Horde_Registry::appInit('horde', array('nocompress' => true, 'authentication' => 'none')); $this->_config = new Horde_Config(); umask($umask); }
* - page: (string) The current page view. * * Copyright 2013-2016 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.horde.org/licenses/gpl. * * @author Michael Slusarz <*****@*****.**> * @category Horde * @copyright 2013-2016 Horde LLC * @license http://www.horde.org/licenses/gpl GPL * @package IMP */ require_once __DIR__ . '/lib/Application.php'; $vars = Horde_Variables::getDefaultVariables(); Horde_Registry::appInit('imp', array('session_control' => $vars->page == 'compose' ? 'netscape' : null, 'timezone' => in_array($vars->page, array('compose', 'mailbox', 'message')))); $class = 'IMP_Basic_' . Horde_String::ucfirst($vars->page); switch ($class) { case 'IMP_Basic_Compose': IMP_Dynamic_Compose::url()->add($_GET)->redirect(); default: if (!class_exists($class)) { throw new IMP_Exception('Page not found: ' . $vars->page); } break; } try { $ob = new $class($vars); } catch (Exception $e) { if ($registry->getView() == $registry::VIEW_BASIC) { $notification->push($e);
exit; } $path = explode('/', ltrim($path, '/')); $type = array_shift($path); $args = array(); foreach ($path as $pair) { list($name, $val) = explode('=', $pair); $args[$name] = $val; } if (empty($args['nocache'])) { $session_cache_limiter = 'public'; session_cache_expire($expire_time); } else { $session_cache_limiter = 'nocache'; } Horde_Registry::appInit('horde', array('authentication' => 'none', 'session_cache_limiter' => $session_cache_limiter, 'session_control' => 'readonly')); switch ($type) { case 'app': if (empty($args['app'])) { exit; } try { $result = $registry->callAppMethod($args['app'], 'cacheOutput', array('args' => array($args))); $data = $result['data']; $type = $result['type']; } catch (Horde_Exception $e) { exit; } break; case 'css': case 'js':
<?php /** * Copyright 2001-2002 Robert E. Coyle <*****@*****.**> * Copyright 2001-2014 Horde LLC (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you * did not receive this file, see http://www.horde.org/licenses/bsdl.php. */ require_once __DIR__ . '/../lib/Application.php'; Horde_Registry::appInit('whups'); $empty = ''; $beendone = 0; $wereerrors = 0; $vars = Horde_Variables::getDefaultVariables($empty); $formname = $vars->get('formname'); Whups::addTopbarSearch(); $form1 = new Whups_Form_Ticket_CreateStepOne($vars); $form2 = new Whups_Form_Ticket_CreateStepTwo($vars); $form3 = new Whups_Form_Ticket_CreateStepThree($vars); $form4 = new Whups_Form_Ticket_CreateStepFour($vars); $r = new Horde_Form_Renderer(array('varrenderer_driver' => array('whups', 'whups'))); $valid4 = $form4->validate($vars) && $formname == 'whups_form_ticket_createstepfour'; $valid3 = $form3->validate($vars, true); $valid2 = $form2->validate($vars, !$form1->isSubmitted()); $valid1 = $form1->validate($vars, true); $doAssignForm = $GLOBALS['registry']->getAuth() && $whups_driver->isCategory('assigned', $vars->get('state')); if ($valid1 && $valid2 && $valid3 && (!$doAssignForm || $valid4)) { $form1->getInfo($vars, $info); $form2->getInfo($vars, $info); $form3->getInfo($vars, $info);
<?php /* * Copyright 2002-2014 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.horde.org/licenses/gpl. * * @author Chris Bowlby <*****@*****.**> * @author Jan Schneider <*****@*****.**> */ require_once __DIR__ . '/lib/Application.php'; Horde_Registry::appInit('sam'); if ($conf['enable']['rules']) { require SAM_BASE . '/spam.php'; } else { require SAM_BASE . '/blacklist.php'; }
<?php /** * Copyright 2003-2015 Horde LLC (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you * did not receive this file, see http://cvs.horde.org/co.php/jonah/LICENSE. * * @author Chuck Hagenbuch <*****@*****.**> * @author Marko Djukic <*****@*****.**> * @author Michael J. Rubinsky <*****@*****.**> * @package Jonah */ require_once __DIR__ . '/../lib/Application.php'; Horde_Registry::appInit('jonah'); $params = array('vars' => Horde_Variables::getDefaultVariables(), 'registry' => &$registry, 'notification' => &$notification); $view = new Jonah_View_ChannelEdit($params); $view->run();
<?php /** * Copyright 2008-2015 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.horde.org/licenses/gpl. * * @author Ben Klang <*****@*****.**> */ require_once __DIR__ . '/lib/Application.php'; $operator = Horde_Registry::appInit('operator'); require_once OPERATOR_BASE . '/lib/Form/SearchCDR.php'; $cache = $GLOBALS['cache']; $renderer = new Horde_Form_Renderer(); $vars = Horde_Variables::getDefaultVariables(); $form = new GraphCDRForm(_("Graph CDR Data"), $vars); if ($form->isSubmitted() && $form->validate($vars, true)) { $accountcode = $vars->get('accountcode'); $dcontext = $vars->get('dcontext'); if (empty($dcontext)) { $dcontext = '%'; } try { $start = new Horde_Date($vars->get('startdate')); $end = new Horde_Date($vars->get('enddate')); if ($end->month - $start->month == 0 && $end->year - $start->year == 0) { // FIXME: This should not cause an error but is due to a bug in // Image_Graph. $notification->push(_("You must select a range that includes more than one month to view these graphs."), 'horde.warning'); } else {
<?php /** * Base redirection page for IMP. * * Copyright 1999-2015 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.horde.org/licenses/gpl. * * @author Chuck Hagenbuch <*****@*****.**> * @category Horde * @copyright 1999-2015 Horde LLC * @license http://www.horde.org/licenses/gpl GPL * @package IMP */ // Will redirect to login page if not authenticated. require_once __DIR__ . '/lib/Application.php'; Horde_Registry::appInit('imp'); IMP::getInitialPage()->url->redirect();
<?php /** * The Hylax script to show a fax view. * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.horde.org/licenses/gpl. */ require_once __DIR__ . '/lib/Application.php'; $hylax = Horde_Registry::appInit('hylax'); $fax_id = Horde_Util::getFormData('fax_id'); $url = Horde_Util::getFormData('url', 'folder.php'); $print = Hylax::printFax($fax_id); if (is_a($print, 'PEAR_Error')) { $notification->push(sprintf(_("Could not print fax ID \"%s\". %s"), $fax_id, $print->getMessage()), 'horde.error'); } else { $notification->push(sprintf(_("Printed fax ID \"%s\"."), $fax_id), 'horde.success'); } /* Redirect back. */ Horde::url($url, true)->redirect();
<?php /** * * Copyright 2002-2016 Horde LLC (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you * did not receive this file, see http://www.horde.org/licenses/bsdl.php. * * @author Mike Cochrane <*****@*****.**> */ require_once __DIR__ . '/lib/Application.php'; Horde_Registry::appInit('trean'); $vars = Horde_Variables::getDefaultVariables(); $bookmarks = null; if (strlen($vars->searchfield)) { // Get the bookmarks. try { $bookmarks = $trean_gateway->searchBookmarks($vars->searchfield); } catch (Trean_Exception $e) { $notification->push($e); } } if ($GLOBALS['conf']['content_index']['enabled']) { $topbar = $GLOBALS['injector']->getInstance('Horde_View_Topbar'); $topbar->search = true; $topbar->searchAction = Horde::url('search.php'); } Trean::addFeedLink(); $page_output->header(array('title' => _("Search"))); $notification->notify(array('listeners' => 'status'));
<?php /** * Copyright 2005-2015 Horde LLC (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you * did not receive this file, see http://www.horde.org/licenses/bsdl.php. * * @author Chuck Hagenbuch <*****@*****.**> * @author Jan Schneider <*****@*****.**> */ require_once __DIR__ . '/lib/Application.php'; $hermes = Horde_Registry::appInit('hermes'); $vars = Horde_Variables::getDefaultVariables(); $form = new Horde_Form($vars, _("Stop Watch")); $form->addVariable(_("Stop watch description"), 'description', 'text', true); if ($form->validate($vars)) { Hermes::newTimer($vars->get('description')); echo Horde::wrapInlineScript(array('var t = ' . Horde_Serialize::serialize(sprintf(_("The stop watch \"%s\" has been started and will appear in the menu at the next refresh."), $vars->get('description')), Horde_Serialize::JSON) . ';', 'alert(t);', 'window.close();')); exit; } $page_output->topbar = $page_output->sidebar = false; $page_output->header(array('title' => _("Stop Watch"))); $form->renderActive(new Horde_Form_Renderer(), $vars, Horde::url('start.php'), 'post'); $page_output->footer();
<?php /** * Copyright 2003-2016 Horde LLC (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you * did not receive this file, see http://cvs.horde.org/co.php/jonah/LICENSE. * * @author Chuck Hagenbuch <*****@*****.**> * @author Marko Djukic <*****@*****.**> * @author Michael J. Rubinsky <*****@*****.**> * @package Jonah */ require_once __DIR__ . '/../lib/Application.php'; Horde_Registry::appInit('jonah', array('permission' => array('jonah:news', Horde_Perms::EDIT))); $params = array('notification' => $notification, 'prefs' => $prefs, 'registry' => $registry); $view = new Jonah_View_ChannelList($params); $view->run();
/** * Horde redirection script. * * Copyright 1999-2016 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL-2). If you * did not receive this file, see http://www.horde.org/licenses/lgpl. * * @author Chuck Hagenbuch <*****@*****.**> * @category Horde * @license http://www.horde.org/licenses/lgpl LGPL-2 * @package Horde */ require_once __DIR__ . '/lib/Application.php'; Horde_Registry::appInit('horde', array('authentication' => 'none', 'nologintasks' => true)); $main_page = Horde_Util::nonInputVar('horde_login_url', Horde_Util::getFormData('url')); // Break up the requested URL in $main_page and run some sanity checks // on it to prevent phishing and XSS attacks. If any of the checks // fail, $main_page will be set to null. if (!empty($main_page)) { // Mute errors in case of unparseable URLs $req = @parse_url($main_page); // We assume that any valid redirect URL will be in the same // cookie domain. This helps prevent rogue off-site Horde installs // from mimicking the real server. if (isset($req['host'])) { $qcookiedom = preg_quote($conf['cookie']['domain']); if (!preg_match('/' . $qcookiedom . '$/', $req['host'])) { $main_page = null; }
/** * Copyright 2008-2014 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.horde.org/licenses/gpl. * * @author Jan Schneider <*****@*****.**> */ function _no_access($status, $reason, $body) { header('HTTP/1.0 ' . $status . ' ' . $reason); echo "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>{$status} {$reason}</title>\n</head><body>\n<h1>{$reason}</h1>\n<p>{$body}</p>\n</body></html>"; exit; } require_once __DIR__ . '/../lib/Application.php'; Horde_Registry::appInit('kronolith', array('authentication' => 'none', 'session_control' => 'readonly')); $calendar = Horde_Util::getFormData('c'); try { $share = $injector->getInstance('Kronolith_Shares')->getShare($calendar); } catch (Exception $e) { _no_access(404, 'Not Found', sprintf(_("The requested feed (%s) was not found on this server."), htmlspecialchars($calendar))); } if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) { if ($GLOBALS['registry']->getAuth()) { _no_access(403, 'Forbidden', sprintf(_("Permission denied for the requested feed (%s)."), htmlspecialchars($calendar))); } else { $auth = $injector->getInstance('Horde_Core_Factory_Auth')->create(); if (isset($_SERVER['PHP_AUTH_USER'])) { $user = $_SERVER['PHP_AUTH_USER']; $pass = $_SERVER['PHP_AUTH_PW']; } elseif (isset($_SERVER['Authorization'])) {
<?php /** * Copyright 2003-2015 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL-2). If you * did not receive this file, see http://www.horde.org/licenses/lgpl. * * @author Mike Cochrane <*****@*****.**> * @category Horde * @license http://www.horde.org/licenses/lgpl LGPL-2 * @package Horde */ require_once __DIR__ . '/../../lib/Application.php'; Horde_Registry::appInit('horde'); // Make sure we don't need the mobile view. if ($registry->getView() == Horde_Registry::VIEW_SMARTMOBILE) { $registry->getServiceLink('portal')->redirect(); exit; } // Get refresh interval. if (($r_time = $prefs->getValue('summary_refresh_time')) && !$browser->hasFeature('xmlhttpreq')) { $page_output->metaRefresh($r_time, Horde::url('services/portal/')); } // Render layout. $view = new Horde_Core_Block_Layout_View($injector->getInstance('Horde_Core_Factory_BlockCollection')->create()->getLayout(), Horde::url('services/portal/edit.php'), Horde::url('services/portal/index.php', true)); $layout_html = $view->toHtml(); $injector->getInstance('Horde_View_Topbar')->subinfo = htmlspecialchars($injector->getInstance('Horde_Core_Factory_Identity')->create()->getDefaultFromAddress(true)); foreach ($view->getStylesheets() as $val) { $page_output->addStylesheet($val['fs'], $val['uri']); }
<?php /** * Copyright 2003-2014 Horde LLC (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you did not * did not receive this file, see http://cvs.horde.org/co.php/vilma/LICENSE. * * @author Marko Djukic <*****@*****.**> */ require_once __DIR__ . '/../lib/Application.php'; $vilma = Horde_Registry::appInit('vilma'); /* Only admin should be using this. */ if (!Vilma::hasPermission()) { throw new Horde_Exception_AuthenticationFailure(); } // Having a current domain doesn't make sense on this page Vilma::setCurDomain(); try { $domains = $vilma->driver->getDomains(); } catch (Exception $e) { $notification->push($e, 'horde.error'); $domains = array(); } $editurl = Horde::url('domains/edit.php'); $deleteurl = Horde::url('domains/delete.php'); $userurl = Horde::url('users/index.php'); foreach ($domains as &$domain) { $domain['edit_url'] = $editurl->copy()->add('domain_id', $domain['domain_id']); $domain['del_url'] = $deleteurl->copy()->add('domain_id', $domain['domain_id']); $domain['view_url'] = $userurl->copy()->add('domain_id', $domain['domain_id']);
<?php /** * Copyright 1999-2015 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you * not receive such a file, see also http://www.horde.org/licenses/gpl. */ require_once __DIR__ . '/lib/Application.php'; Horde_Registry::appInit('kronolith', array('nodynamicinit' => true)); /* Determine View */ switch ($registry->getView()) { case Horde_Registry::VIEW_MINIMAL: case Horde_Registry::VIEW_SMARTMOBILE: include KRONOLITH_BASE . '/smartmobile.php'; exit; case Horde_Registry::VIEW_BASIC: case Horde_Registry::VIEW_DYNAMIC: if ($registry->getView() == Horde_Registry::VIEW_DYNAMIC && $prefs->getValue('dynamic_view')) { break; } include KRONOLITH_BASE . '/' . $prefs->getValue('defaultview') . '.php'; exit; } /* Load Ajax interface. */ $today = new Horde_Date($_SERVER['REQUEST_TIME']); $ampm = !$prefs->getValue('twentyFour'); $eventAlarmMethods = $eventAlarmParams = $taskAlarmMethods = $taskAlarmParams = ''; foreach ($injector->getInstance('Horde_Alarm')->handlers() as $method => $handler) { $eventAlarmMethods .= ' <input type="checkbox" name="event_alarms[]" id="kronolithEventAlarm' . $method . '" value="' . $method . '" /> <label for="kronolithEventAlarm' . $method . '">' . $handler->getDescription() . '</label>'; $taskAlarmMethods .= ' <input type="checkbox" name="task[alarm_methods][]" id="kronolithTaskAlarm' . $method . '" value="' . $method . '" /> <label for="kronolithTaskAlarm' . $method . '">' . $handler->getDescription() . '</label>';
/** * Hashtable management. * * Copyright 2014-2016 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL-2). If you * did not receive this file, see http://www.horde.org/licenses/lgpl. * * @author Michael Slusarz <*****@*****.**> * @category Horde * @copyright 2014-2016 Horde LLC * @license http://www.horde.org/licenses/lgpl LGPL-2 * @package Horde */ require_once __DIR__ . '/../lib/Application.php'; Horde_Registry::appInit('horde', array('permission' => array('horde:administration:hashtable'))); $ht = $injector->getInstance('Horde_HashTable'); $vars = $injector->getInstance('Horde_Variables'); if ($vars->clearht) { $ht->clear(); $notification->push(_("Hashtable data cleared"), 'cli.success'); } $view = new Horde_View(array('templatePath' => HORDE_TEMPLATES . '/admin')); $view->addHelper('Text'); $view->action = Horde::url('admin/hashtable.php'); $view->driver = get_class($ht); $view->locking = $ht->locking; $view->persistent = $ht->persistent; $test_key = '__horde_ht_admin_test'; $ht->delete($test_key); $view->rw = $ht->set($test_key, 'test') && $ht->get($test_key) === 'test';
/** * Example list script. * * Copyright 2007-2014 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.horde.org/licenses/gpl. * * @author Your Name <*****@*****.**> * @category Horde * @copyright 2007-2014 Horde LLC * @license http://www.horde.org/licenses/gpl GPL * @package Skeleton */ require_once __DIR__ . '/lib/Application.php'; Horde_Registry::appInit('skeleton'); /* Example of how to use Horde_View. If getting a Horde_View instance via * createInstance() from the injector, the template path already defaults to * the application's templates/ folder. */ $view = $injector->createInstance('Horde_View'); $view->header = _("Header"); $view->content = _("Some Content"); $view->list = array(array('One', 'Foo'), array('Two', 'Bar')); /* Load JavaScript for sortable table. */ $page_output->addScriptFile('tables.js', 'horde'); /* Here starts the actual page output. First we output the complete HTML * header, CSS files, the topbar menu, and the sidebar menu. */ $page_output->header(array('title' => _("List"))); /* Next we output any notification messages. This is not done automatically * because on some pages you might not want to have notifications. */ $notification->notify(array('listeners' => 'status'));
<?php /** * Copyright 2014-2015 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.horde.org/licenses/gpl. * * @author Jan Schneider <*****@*****.**> */ require_once __DIR__ . '/../lib/Application.php'; Horde_Registry::appInit('nag'); $request = $injector->getInstance('Horde_Controller_Request'); $controller = new Nag_SaveTask_Controller(); $controller->setInjector($injector); $response = $injector->createInstance('Horde_Controller_Response'); $controller->processRequest($request, $response); $responseWriter = $injector->getInstance('Horde_Controller_ResponseWriter'); $responseWriter->writeResponse($response);
<?php /** * Copyright 2007-2016 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.horde.org/licenses/gpl. * * @author Duck <*****@*****.**> */ require_once __DIR__ . '/../lib/Application.php'; Horde_Registry::appInit('agora', array('authentication' => 'none')); // Show a specific scope? list($forum_id, $message_id, $scope) = Agora::getAgoraId(); $cache_key = 'agora_rss_' . $scope . '_' . $forum_id . '_' . $message_id; /* Initialize the Cache object. */ $cache = $injector->getInstance('Horde_Cache'); $rss = $cache->get($cache_key, $conf['cache']['default_lifetime']); if (!$rss) { $messages = $injector->getInstance('Agora_Factory_Driver')->create($scope, $forum_id); $message = $messages->getMessage($message_id); if ($message instanceof PEAR_Error) { exit; } $threads_list = $messages->getThreads($message['message_thread'], true, 'message_timestamp', 1, 1, '', null, 0, 10); if ($threads_list instanceof PEAR_Error) { exit; } $rss = '<?xml version="1.0" encoding="UTF-8" ?> <rss version="2.0"> <channel>
<?php /** * Copyright 2000-2015 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.horde.org/licenses/gpl. * * @author Anil Madhavapeddy <*****@*****.**> * @package Chora */ require_once __DIR__ . '/lib/Application.php'; Horde_Registry::appInit('chora'); // TODO - This currently doesn't work. Chora::fatal('History display is currently broken', '500 Internal Server Error'); /* Exit if it's not supported. */ if (!$VC->hasFeature('branches')) { Chora::url('browsefile', $where)->redirect(); } $colset = array('#ccdeff', '#ecf', '#fec', '#efc', '#cfd', '#dcdba0'); $branch_colors = $colStack = array(); foreach ($branches as $brrev => $brcont) { if (!count($colStack)) { $colStack = $colset; } $branch_colors[$brrev] = array_shift($colset); } /** * This takes a row and a column, and recursively iterates through any * sub-revisions or branches from the value that was already in the * grid at the co-ordinates that it was called with.
<?php /** * $Id: accounts.php,v 1.5 2010/10/24 17:24:02 pety Exp $ * * Copyright 2007-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. * * @author Peter Sagi <*****@*****.**> */ require_once __DIR__ . '/lib/Application.php'; Horde_Registry::appInit('cloudbank'); require_once CLOUDBANK_BASE . '/lib/lib/CloudBankConsts.php'; $g_account_type = CloudBankConsts::LedgerAccountType_Account; require CLOUDBANK_BASE . '/accounts_or_categories.php';
<?php /** * Copyright 1999-2016 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL-2). If you * did not receive this file, see http://www.horde.org/licenses/lgpl. * * @author Chuck Hagenbuch <*****@*****.**> * @category Horde * @license http://www.horde.org/licenses/lgpl LGPL-2 * @package Horde */ require_once __DIR__ . '/../../lib/Application.php'; Horde_Registry::appInit('horde', array('permission' => array('horde:administration:configuration'))); if (!Horde_Util::extensionExists('domxml') && !Horde_Util::extensionExists('dom')) { throw new Horde_Exception('You need the domxml or dom PHP extension to use the configuration tool.'); } $vars = $injector->getInstance('Horde_Variables'); $app = $vars->app; $appname = $registry->get('name', $app); $title = sprintf(_("%s Configuration"), $appname); if (empty($app) || !in_array($app, $registry->listAllApps())) { $notification->push(_("Invalid application."), 'horde.error'); Horde::url('admin/config/index.php', true)->redirect(); } $form = new Horde_Config_Form($vars, $app); $form->setButtons(sprintf(_("Generate %s Configuration"), $appname)); if (file_exists($registry->get('fileroot', $app) . '/config/conf.bak.php')) { $form->appendButtons(_("Revert Configuration")); }
<?php /** * The Agora script to display a list of forums. * * Copyright 2003-2015 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.horde.org/licenses/gpl. * * @author Jan Schneider <*****@*****.**> * @author Marko Djukic <*****@*****.**> */ require_once __DIR__ . '/lib/Application.php'; Horde_Registry::appInit('agora'); /* Set up the forums object. */ $scope = Horde_Util::getGet('scope', 'agora'); $forums = $injector->getInstance('Agora_Factory_Driver')->create($scope); /* Set up actions */ if ($registry->isAdmin()) { $url = Horde::url('forums.php'); foreach ($registry->listApps(array('hidden', 'notoolbar', 'active')) as $app) { if ($registry->hasMethod('hasComments', $app) && $registry->callByPackage($app, 'hasComments') === true) { $app_name = $registry->get('name', $app); $actions[] = Horde::link($url->add('scope', $app), $app_name) . $app_name . '</a>'; } } } /* Get the sorting. */ $sort_by = Agora::getSortBy('forums'); $sort_dir = Agora::getSortDir('forums');
<?php /** * Copyright 2001-2014 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.horde.org/licenses/gpl. * * @author Chuck Hagenbuch <*****@*****.**> */ require_once __DIR__ . '/../lib/Application.php'; Horde_Registry::appInit('ansel'); /* If we aren't provided with a gallery, redirect to the gallery * list. */ $galleryId = Horde_Util::getFormData('gallery'); if (!isset($galleryId)) { Ansel::getUrlFor('view', array('view' => 'List'), true)->redirect(); exit; } try { $gallery = $injector->getInstance('Ansel_Storage')->getGallery($galleryId); } catch (Ansel_Excception $e) { $notification->push(_("There was an error accessing the gallery."), 'horde.error'); Ansel::getUrlFor('view', array('view' => 'List'), true)->redirect(); exit; } if (!$gallery->hasPermission($registry->getAuth(), Horde_Perms::EDIT)) { $notification->push(_("Access denied editing this gallery."), 'horde.error'); Ansel::getUrlFor('view', array('view' => 'List'), true)->redirect(); } $style = $gallery->getStyle();
<?php /** * Copyright 2002-2016 Horde LLC (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you * did not receive this file, see http://www.horde.org/licenses/bsdl.php. * * @author Chuck Hagenbuch <*****@*****.**> */ require_once __DIR__ . '/../lib/Application.php'; Horde_Registry::appInit('whups', array('permission' => array('whups:admin', Horde_Perms::EDIT))); Whups::addTopbarSearch(); // Set up the page config vars. $showExtraForm = null; // Setup vars with all relevant info. $vars = Horde_Variables::getDefaultVariables(); if (!$vars->exists('action')) { $vars->set('action', 'queue'); } // Admin actions. $adminurl = Horde::selfUrl(false, false); $tabs = new Horde_Core_Ui_Tabs('action', $vars); $tabs->addTab(_("_Edit Queues"), $adminurl, 'queue'); $tabs->addTab(_("Edit _Types"), $adminurl, 'type'); $tabs->addTab(_("Queue/Type Matri_x"), $adminurl, 'mtmatrix'); $tabs->addTab(_("Sen_d Reminders"), $adminurl, 'reminders'); $renderer = new Horde_Form_Renderer(); // start the page function _open($isopened = false) {
<?php /** * Copyright 2002-2016 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.horde.org/licenses/gpl. * * @author Chuck Hagenbuch <*****@*****.**> */ require_once __DIR__ . '/../../lib/Application.php'; Horde_Registry::appInit('kronolith'); // Exit if this isn't an authenticated administrative user. $default = Horde::url($prefs->getValue('defaultview') . '.php', true); if (!$registry->isAdmin()) { $default->redirect(); } $vars = Horde_Variables::getDefaultVariables(); try { $resource = Kronolith::getDriver('Resource')->getResource($vars->get('c')); if (!$resource->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::DELETE)) { $notification->push(_("You are not allowed to delete this resource group."), 'horde.error'); $default->redirect(); } } catch (Exception $e) { $notification->push($e); $default->redirect(); } $form = new Kronolith_Form_DeleteResourceGroup($vars, $resource); // Execute if the form is valid (must pass with POST variables only). if ($form->validate(new Horde_Variables($_POST))) {
$input = Horde_Rpc::getInput(); /* Check for SOAP namespace URI. */ $serverType = strpos($input, 'http://schemas.xmlsoap.org/soap/envelope/') !== false ? 'Soap' : 'Xmlrpc'; } elseif (strpos($_SERVER['CONTENT_TYPE'], 'application/json') !== false) { $serverType = 'Jsonrpc'; } else { header('HTTP/1.0 501 Not Implemented'); exit; } } elseif ($_SERVER['QUERY_STRING'] && $_SERVER['QUERY_STRING'] == 'phpgw') { $serverType = 'Phpgw'; } else { $serverType = 'Webdav'; } /* Initialize Horde environment. */ Horde_Registry::appInit('horde', array('authentication' => 'none', 'nocompress' => $nocompress, 'session_control' => $session_control, 'session_cache_limiter' => $cache_control, 'nonotificationinit' => $no_notification)); $request = $injector->getInstance('Horde_Controller_Request'); $params['logger'] = $injector->getInstance('Horde_Log_Logger'); /* Check to see if we want to exit if required credentials are not * present. */ if (($ra = Horde_Util::getGet('requestMissingAuthorization')) !== null) { $params['requestMissingAuthorization'] = $ra; } /* Driver specific tasks that require Horde environment. */ switch ($serverType) { case 'ActiveSync': // Check if AS is enabled. Note that we can't check the user perms for it // here since the user is not yet logged into horde at this point. if (empty($conf['activesync']['enabled'])) { exit; }