Author: Chuck Hagenbuch (chuck@horde.org)
Author: Jon Parise (jon@horde.org)
Author: Anil Madhavapeddy (anil@recoil.org)
Author: Michael Slusarz (slusarz@horde.org)
Inheritance: implements Horde_Shutdown_Task
コード例 #1
0
ファイル: RootCollection.php プロジェクト: horde/horde
 /**
  * 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;
 }
コード例 #2
0
ファイル: Backend.php プロジェクト: kossamums/horde
 /**
  * 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;
 }
コード例 #3
0
ファイル: Backend.php プロジェクト: jubinpatel/horde
 /**
  * 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);
     }
 }
コード例 #4
0
ファイル: Locks.php プロジェクト: raz0rsdge/horde
 /**
  * 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);
     }
 }
コード例 #5
0
ファイル: Bundle.php プロジェクト: raz0rsdge/horde
 /**
  * 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);
 }
コード例 #6
0
ファイル: Perms.php プロジェクト: horde/horde
 /**
  * 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;
 }
コード例 #7
0
ファイル: File.php プロジェクト: raz0rsdge/horde
 /**
  * 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;
 }
コード例 #8
0
ファイル: Horde.php プロジェクト: raz0rsdge/horde
 /**
  * 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;
 }
コード例 #9
0
ファイル: Collection.php プロジェクト: jubinpatel/horde
 /**
  * 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);
     }
 }
コード例 #10
0
ファイル: basic.php プロジェクト: horde/horde
 *   - 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);
コード例 #11
0
ファイル: cache.php プロジェクト: jubinpatel/horde
    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':
コード例 #12
0
ファイル: create.php プロジェクト: jubinpatel/horde
<?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);
コード例 #13
0
ファイル: index.php プロジェクト: jubinpatel/horde
<?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';
}
コード例 #14
0
ファイル: edit.php プロジェクト: raz0rsdge/horde
<?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();
コード例 #15
0
ファイル: viewgraph.php プロジェクト: raz0rsdge/horde
<?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 {
コード例 #16
0
ファイル: index.php プロジェクト: DSNS-LAB/Dmail
<?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']);
}
コード例 #17
0
ファイル: index.php プロジェクト: jubinpatel/horde
<?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']);
コード例 #18
0
ファイル: index.php プロジェクト: raz0rsdge/horde
<?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>';
コード例 #19
0
ファイル: hashtable.php プロジェクト: horde/horde
/**
 * 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';
コード例 #20
0
ファイル: list.php プロジェクト: jubinpatel/horde
/**
 * 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'));
コード例 #21
0
ファイル: save.php プロジェクト: DSNS-LAB/Dmail
<?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);
コード例 #22
0
ファイル: messages.php プロジェクト: horde/horde
<?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>
コード例 #23
0
ファイル: history.php プロジェクト: raz0rsdge/horde
<?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.
コード例 #24
0
ファイル: accounts.php プロジェクト: psagi/cloudbank
<?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';
コード例 #25
0
ファイル: config.php プロジェクト: horde/horde
<?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"));
}
コード例 #26
0
ファイル: forums.php プロジェクト: raz0rsdge/horde
<?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');
コード例 #27
0
ファイル: sort.php プロジェクト: jubinpatel/horde
<?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();
コード例 #28
0
ファイル: index.php プロジェクト: horde/horde
<?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)
{
コード例 #29
0
ファイル: delete.php プロジェクト: horde/horde
<?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))) {
コード例 #30
0
ファイル: rpc.php プロジェクト: jubinpatel/horde
        $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;
        }