/** * Returns an array with all the child nodes * * @return DAV\INode[] */ public function getChildren() { $apps = $this->_collections; foreach ($this->_registry->listApps() as $app) { if ($this->_registry->hasMethod('browse', $app)) { $apps[] = new Horde_Dav_Collection($app, array(), $this->_registry, $this->_mimedb); } } return $apps; }
/** * Returns the name of the application providing the 'contacts' interface. * * @return string An application name. * @throws Sabre\DAV\Exception if no contacts application is installed. */ protected function _contacts() { $contacts = $this->_registry->hasInterface('contacts'); if (!$contacts) { throw new DAV\Exception('No contacts application installed'); } return $contacts; }
/** * Deletes an existing calendar object. * * @param mixed $calendarId * @param string $objectUri * @return void */ public function deleteCalendarObject($calendarId, $objectUri) { try { return $this->_registry->callAppMethod($this->_interface($calendarId), 'davDeleteObject', array('args' => array($calendarId, $objectUri))); } catch (Horde_Exception $e) { throw new DAV\Exception($e->getMessage(), $e->getCode(), $e); } }
/** * Locks a uri * * @param string $uri * @param Locks\LockInfo $lockInfo * @return bool */ public function lock($uri, Locks\LockInfo $lockInfo) { list($app) = explode('/', $uri); $type = $lockInfo->scope == Locks\LockInfo::EXCLUSIVE ? Horde_Lock::TYPE_EXCLUSIVE : Horde_Lock::TYPE_SHARED; try { $lockId = $this->_lock->setLock($this->_registry->getAuth(), $app, $uri, $lockInfo->timeout ?: Horde_Lock::PERMANENT, $type); $lockInfo->token = $lockId; } catch (Horde_Lock_Exception $e) { throw new DAV\Exception($e->getMessage(), $e->getCode(), $e); } }
/** * 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); }
/** * Finds out if the user has the specified rights to the given object, * specific to a certain application. * * @param string $permission The permission to check. * @param array $opts Additional options: * <pre> * 'app' - (string) The app to check. * DEFAULT: The current pushed app. * 'opts' - (array) Additional options to pass to the app function. * DEFAULT: None * </pre> * * @return mixed The specified permissions. */ public function hasAppPermission($permission, $opts = array()) { $app = isset($opts['app']) ? $opts['app'] : $this->_registry->getApp(); if ($this->_perms->exists($app . ':' . $permission)) { $perms = $this->_perms->getPermissions($app . ':' . $permission, $this->_registry->getAuth()); if ($perms === false) { return false; } $args = array($permission, $perms, isset($opts['opts']) ? $opts['opts'] : array()); try { return $this->_registry->callAppMethod($app, 'hasPermission', array('args' => $args)); } catch (Horde_Exception $e) { } } return true; }
/** * Returns the data * * This method may either return a string or a readable stream resource * * @return mixed */ public function get() { list($base) = explode('/', $this->_path); try { $items = $this->_registry->callByPackage($base, 'browse', array($this->_path)); } catch (Horde_Exception_NotFound $e) { throw new DAV\Exception\NotFound($this->_path . ' not found'); } catch (Horde_Exception $e) { throw new DAV\Exception($e); } if (!$items) { throw new DAV\Exception\NotFound($this->_path . ' not found'); } $item = reset($items); $this->_size = strlen($item); return $item; }
/** * Returns an unsorted file list of the specified directory. * * @param string $path The path of the directory. * @param string|array $filter Regular expression(s) to filter * file/directory name on. * @param boolean $dotfiles Show dotfiles? * @param boolean $dironly Show only directories? * * @return array File list. * @throws Horde_Vfs_Exception */ protected function _listFolder($path, $filter = null, $dotfiles = true, $dironly = false) { $list = array(); if ($path == '/') { try { $apps = $this->_registry->listApps(null, false, Horde_Perms::READ); } catch (Horde_Exception $e) { throw new Horde_Vfs_Exception($e->getMessage()); } foreach ($apps as $app) { if ($this->_registry->hasMethod('browse', $app)) { $file = array('name' => $app, 'date' => time(), 'type' => '**dir', 'size' => -1); $list[] = $file; } } return $list; } if (substr($path, 0, 1) == '/') { $path = substr($path, 1); } $pieces = explode('/', $path); try { $items = $this->_registry->callByPackage($pieces[0], 'browse', array('path' => $path, 'properties' => array('name', 'browseable', 'contenttype', 'contentlength', 'modified'))); } catch (Horde_Exception $e) { throw new Horde_Vfs_Exception($e->getMessage()); } if (!is_array(reset($items))) { /* We return an object's content. */ throw new Horde_Vfs_Exception('Unknown error'); } foreach ($items as $sub_path => $i) { if ($dironly && !$i['browseable']) { continue; } $name = basename($sub_path); if ($this->_filterMatch($filter, $name)) { continue; } $type = class_exists('Horde_Mime_Magic') ? Horde_Mime_Magic::mimeToExt(empty($i['contenttype']) ? 'application/octet-stream' : $i['contenttype']) : '**none'; $file = array('name' => $name, 'date' => empty($i['modified']) ? 0 : $i['modified'], 'type' => $i['browseable'] ? '**dir' : $type, 'size' => empty($i['contentlength']) ? 0 : $i['contentlength']); $list[] = $file; } return $list; }
/** * Creates a new file in the directory * * @param string $name Name of the file * @param resource|string $data Initial payload * @return null|string */ public function createFile($name, $data = null) { list($app) = explode('/', $this->_path); if (is_resource($data)) { $content = new Horde_Stream_Existing(array('stream' => $data)); $type = Horde_Mime_Magic::analyzeData($content->getString(0, 100), $this->_mimedb); } else { $content = $data; $type = Horde_Mime_Magic::analyzeData($content, $this->_mimedb); } if (!$type) { $type = Horde_Mime_Magic::filenameToMime($name); } try { $this->_registry->callByPackage($app, 'put', array($this->_path . '/' . $name, $content, $type)); } catch (Horde_Exception $e) { throw new DAV\Exception($e->getMessage(), $e->getCode(), $e); } }
* - 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 /** * 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; }