/** * 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; } }
$index = Horde_Util::getFormData('index'); // Make sure we have a valid date set. $date = Horde_Util::getFormData('date'); if (!empty($date) && !is_numeric($date)) { $date = strtotime($date); } // Set default page title and date format. $title = _("Today's Comics"); $date_format = 'D, d M Y H:i:s T'; // Figure out how many days of history we keep. $daystokeep = 90; if (!empty($conf['backend']['daystokeep'])) { $daystokeep = $conf['backend']['daystokeep']; } // Get/guess the current action ID. $actionID = Horde_Util::getFormData('actionID', Horde_Util::nonInputVar('actionID')); if (is_null($actionID)) { if (empty($date) && empty($index)) { $actionID = 'main'; } elseif (empty($date) && !empty($index)) { $actionID = 'comic'; } elseif (!empty($date) && empty($index)) { $actionID = 'day'; } else { $actionID = 'image'; } } if (empty($date)) { $date = mktime(0, 0, 0); } // If we're not displaying a raw image, require the common
exit; } } // Should we redirect when we're done? $redirect = Horde_Util::getFormData('redirect'); $action = Horde_Util::getFormData('action'); // No more notifications after this point, so close the session so we // don't lock other pages - if redirecting, we are only fetching one comic // and would like a notification on success/failure. if (empty($redirect)) { session_write_close(); } // Proceed once we're sure we're authorized. // $mode is either set from the cli.backend.* scripts as an array of modes // or passed in as a single mode from the form variable. $mode = Horde_Util::nonInputVar('mode', Horde_Util::getFormData('mode', array('menu'))); if (!is_array($mode)) { $mode = array($mode); } $time = mktime(0, 0, 0); $t = getdate($time); if (!empty($conf['backend']['daystokeep'])) { $daystokeep = $conf['backend']['daystokeep']; $oldest = mktime(0, 0, 0, $t['mon'], $t['mday'] - $daystokeep, $t['year']); } else { $daystokeep = 90; $oldest = null; } $expired = mktime(0, 0, 0, $t['mon'], $t['mday'] - ($daystokeep + 1), $t['year']); if (in_array('sums', $mode)) { $klutz_driver->rebuildSums();
/** * Script to handle requests for html delivery of stories. * * Copyright 2004-2016 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/jonah/LICENSE. * * @author Jan Schneider <*****@*****.**> */ require_once __DIR__ . '/lib/Application.php'; $jonah = Horde_Registry::appInit('jonah', array('authentication' => 'none', 'session_control' => 'readonly')); $jonah = Horde_Registry::appInit('jonah'); $templates = Horde::loadConfiguration('templates.php', 'templates', 'jonah'); /* Get the id and format of the feed to display. */ $criteria = Horde_Util::nonInputVar('criteria'); if (empty($criteria['channel_format'])) { // Select the default channel format $criteria['channel_format'] = key($templates); } $options = array(); foreach ($templates as $key => $info) { $options[] = '<option value="' . $key . '"' . ($key == $criteria['channel_format'] ? ' selected="selected"' : '') . '>' . $info['name'] . '</option>'; } if (empty($criteria['channel_id']) && !empty($criteria['feed'])) { $criteria['channel_id'] = $GLOBALS['injector']->getInstance('Jonah_Driver')->getChannelId($criteria['feed']); } if (empty($criteria['channel_id'])) { $notification->push(_("No valid feed name or ID requested."), 'horde.error'); } else { $stories = $GLOBALS['injector']->getInstance('Jonah_Driver')->getStories($criteria);
/** * Folks base application file. * * * This file brings in all of the dependencies that every Folks script will * need, and sets up objects that all scripts use. */ // Check for a prior definition of HORDE_BASE (perhaps by an auto_prepend_file // definition for site customization). if (!defined('HORDE_BASE')) { define('HORDE_BASE', __DIR__ . '/../..'); } // Load the Horde Framework core, and set up inclusion paths and autoloading. require_once HORDE_BASE . '/lib/core.php'; // Registry. $registry = new Horde_Registry(); $registry->pushApp('folks', array('check_perms' => Horde_Util::nonInputVar('folks_authentication') != 'none')); $conf =& $GLOBALS['conf']; // Define the base file path of Folks. if (!defined('FOLKS_BASE')) { define('FOLKS_BASE', __DIR__ . '/..'); } $GLOBALS['folks_driver'] = Folks_Driver::factory(); // Cache $GLOBALS['cache'] = $injector->getInstance('Horde_Cache'); // Update user online status $GLOBALS['folks_driver']->updateOnlineStatus(); // Start output compression. if (!Horde_Util::nonInputVar('no_compress')) { }