Remove extra ws; fix some mode issues; autoloading.
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*/
-define('AGORA_BASE', dirname(__FILE__));
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
-
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora');
/* Make sure we have a forum id. */
list($forum_id, , $scope) = Agora::getAgoraId();
* @author Marko Djukic <marko@oblo.com>
*/
-define('AGORA_BASE', dirname(__FILE__));
-require_once AGORA_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora');
/* Set up the forums object. */
$scope = Horde_Util::getFormData('scope', 'agora');
* @author Marko Djukic <marko@oblo.com>
*/
-define('AGORA_BASE', dirname(__FILE__));
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Forms/Forum.php';
-
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora');
/* Set up the forums object. */
$forums = &Agora_Messages::singleton();
* @author Marko Djukic <marko@oblo.com>
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora');
/* Set up the forums object. */
$scope = Horde_Util::getGet('scope', 'agora');
return PEAR::raiseError(_("The VFS backend needs to be configured to enable attachment uploads."));
}
- require_once 'VFS.php';
return VFS::singleton($conf['vfs']['type'], Horde::getDriverConfig('vfs'));
}
*
* @param int $message_id Identifier of message to be distributed
*
- * @return mixed Boolean true on success; PEAR_Error on failure
+ * @throws Horde_Mime_Exception
*/
function distribute($message_id)
{
$forum = $storage->getForum($message['forum_id']);
if (empty($forum['forum_distribution_address'])) {
- return false;
+ return;
}
- require_once 'Mail.php';
- require_once 'Horde/MIME.php';
- require_once 'Horde/MIME/Headers.php';
- require_once 'Horde/MIME/Message.php';
-
- $msg_headers = new MIME_Headers();
+ $msg_headers = new Horde_Mime_Headers();
$msg_headers->addMessageIdHeader();
$msg_headers->addAgentHeader();
$msg_headers->addHeader('Date', date('r'));
$msg_headers->addHeader('From', $message['message_author']);
$msg_headers->addHeader('Subject', '[' . $forum['forum_name'] . '] ' . $message['message_subject']);
- $mime = new MIME_Message();
- $body = new MIME_Part('text/plain', $message['body'],
- Horde_Nls::getCharset());
- $mime->addPart($body);
- $msg_headers->addMIMEHeaders($mime);
- $result = $mime->send($forum['forum_distribution_address'], $msg_headers, $conf['mailer']['type'], $conf['mailer']['params']);
- if (is_a($result, 'PEAR_Error')) {
- Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
- }
+ $body = new Horde_Mime_Part();
+ $body->setType('text/plain');
+ $body->setCharset(Horde_Nls::getCharset());
+ $body->setContents($message['body']);
+
+ $body->send($forum['forum_distribution_address'], $msg_headers, $conf['mailer']['type'], $conf['mailer']['params']);
}
}
*/
public function listForums($forum_id = 0, $scope = null)
{
- require_once dirname(__FILE__) . '/base.php';
-
$forums = &Agora_Messages::singleton($scope);
return $forums->getForums($forum_id, true, 'forum_name', 0, isset($scope));
}
*/
public function getForumName($scope, $forum_id)
{
- require_once dirname(__FILE__) . '/base.php';
-
$forums = &Agora_Messages::singleton($scope);
$forum = $forums->getForum($forum_id);
if ($forum instanceof PEAR_Error) {
*/
public function saveForum($scope, $parent, $info)
{
- require_once dirname(__FILE__) . '/base.php';
-
$forums = &Agora_Messages::singleton($scope);
$forum_info = $this->prepareFormData($scope, $parent, $info);
if ($forum_info instanceof PEAR_Error) {
*/
public function deleteForum($scope, $forum_name)
{
- require_once dirname(__FILE__) . '/base.php';
-
$forums = &Agora_Messages::singleton($scope);
$id = $forums->getForumId($forum_name);
if ($id instanceof PEAR_Error) {
public function getThreads($forum_name, $sort_by = 'message_timestamp', $sort_dir = 0, $bodies = false,
$scope = 'agora', $base_url = null, $from = 0, $count = 0)
{
- require_once dirname(__FILE__) . '/base.php';
-
$forums = &Agora_Messages::singleton($scope);
if (empty($forum_name)) {
return $forums->getThreads(0, false, $sort_by, $sort_dir, true, '', $base_url, $from, $count);
public function getThreadsBatch($forum_names, $sort_by = 'message_timestamp', $sort_dir = 0, $bodies = false,
$scope = 'agora', $base_url = null, $from = 0, $count = 0)
{
- require_once dirname(__FILE__) . '/base.php';
-
$results = array();
$forums = &Agora_Messages::singleton($scope);
$results = array();
public function getThreadsByForumOwner($owner, $sort_by = 'message_timestamp', $sort_dir = 0, $bodies = false,
$scope = 'agora', $from = 0, $count = 0)
{
- require_once dirname(__FILE__) . '/base.php';
-
$forums = &Agora_Messages::singleton($scope);
return $forums->getThreadsByForumOwner($owner, 0, true, $sort_by, $sort_dir, true, $from, $count);
*/
public function numMessages($forum_name, $scope = 'agora', $thread_id = null)
{
- require_once dirname(__FILE__) . '/base.php';
-
$forums = &Agora_Messages::singleton($scope);
if (($forum_id = $forums->getForumId($forum_name)) instanceof PEAR_Error) {
*/
public function numMessagesBatch($forum_name, $scope = 'agora', $thread_id = null)
{
- require_once dirname(__FILE__) . '/base.php';
-
$forums = &Agora_Messages::singleton($scope);
if ($forums instanceof PEAR_Error) {
return $forums;
return '';
}
- require_once dirname(__FILE__) . '/base.php';
-
/* Check if the forum exists and fetch the ID, or create a new one. */
$forums = &Agora_Messages::singleton($scope);
if (($params['forum_id'] = $forums->getForumId($forum_name)) instanceof PEAR_Error) {
return '';
}
- require_once dirname(__FILE__) . '/base.php';
-
/* Create a separate notification queue. */
$queue = Horde_Notification::singleton('agoraPostMessage');
$queue->attach('status');
return '';
}
- require_once dirname(__FILE__) . '/base.php';
-
/* Create a separate notification queue. */
$queue = Horde_Notification::singleton('agoraRemoveMessage');
$queue->attach('status');
$base_url = null, $url = null, $variables = null,
$template_file = false)
{
- require_once dirname(__FILE__) . '/base.php';
-
if (is_null($base_url)) {
$base_url = Horde::selfUrl(true);
}
*/
public function prepareFormData($scope, $parent = false, $info = array(), $callback = null)
{
- require_once dirname(__FILE__) . '/base.php';
-
$forums = &Agora_Messages::singleton($scope);
if ($parent) {
{
global $notification, $prefs, $registry;
- require_once dirname(__FILE__) . '/base.php';
-
$api_call = true;
return require AGORA_BASE . '/moderate.php';
/**
* Agora external API interface.
*
- * This file defines Agora's external API interface. Other
- * applications can interact with Agora through this API.
+ * This file defines Horde's core API interface. Other core Horde libraries
+ * can interact with Agora through this API.
*
* Copyright 2003-2010 The Horde Project (http://www.horde.org/)
*
* @package Agora
*/
+/* Determine the base directories. */
+if (!defined('AGORA_BASE')) {
+ define('AGORA_BASE', dirname(__FILE__) . '/..');
+}
+
+if (!defined('HORDE_BASE')) {
+ /* If Horde does not live directly under the app directory, the HORDE_BASE
+ * constant should be defined in config/horde.local.php. */
+ if (file_exists(AGORA_BASE . '/config/horde.local.php')) {
+ include AGORA_BASE . '/config/horde.local.php';
+ } else {
+ define('HORDE_BASE', AGORA_BASE . '/..');
+ }
+}
+
+/* Load the Horde Framework core (needed to autoload
+ * Horde_Registry_Application::). */
+require_once HORDE_BASE . '/lib/core.php';
+
class Agora_Application extends Horde_Registry_Application
{
+ /**
+ * The application's version.
+ *
+ * @var string
+ */
public $version = 'H4 (1.0-git)';
/**
+ * TODO
+ */
+ static protected $_perms = array();
+
+ /**
* Returns a list of available permissions.
*
* @return array An array describing all available permissions.
*/
public function perms()
{
- static $perms = array();
- if (!empty($perms)) {
- return $perms;
+ if (!empty(self::$_perms)) {
+ return self::$_perms;
}
- require_once dirname(__FILE__) . '/base.php';
-
- $perms['tree']['agora']['admin'] = true;
- $perms['title']['agora:admin'] = _("Admin");
- $perms['title']['agora:forums'] = _("Forums");
+ self::$_perms['tree']['agora']['admin'] = true;
+ self::$_perms['title']['agora:admin'] = _("Admin");
+ self::$_perms['title']['agora:forums'] = _("Forums");
foreach ($GLOBALS['registry']->listApps() as $scope) {
- $perms['title']['agora:forums:' . $scope] = $GLOBALS['registry']->get('name', $scope);
- $perms['tree']['agora']['forums'][$scope] = false;
+ self::$_perms['title']['agora:forums:' . $scope] = $GLOBALS['registry']->get('name', $scope);
+ self::$_perms['tree']['agora']['forums'][$scope] = false;
$forums = &Agora_Messages::singleton($scope);
$forums_list = $forums->getBareForums();
}
foreach ($forums_list as $id => $title) {
- $perms['tree']['agora']['forums'][$scope][$id] = false;
- $perms['title']['agora:forums:' . $scope . ':' . $id] = $title;
+ self::$_perms['tree']['agora']['forums'][$scope][$id] = false;
+ self::$_perms['title']['agora:forums:' . $scope . ':' . $id] = $title;
}
}
- return $perms;
+ return self::$_perms;
}
/**
{
return Agora::getMenu();
}
+
}
{
global $registry;
- require_once dirname(__FILE__) . '/../base.php';
-
/* Set up the forums object. */
$forums = array(Agora_Messages::singleton());
if (Horde_Auth::isAdmin()) {
function _params()
{
- require_once dirname(__FILE__) . '/../base.php';
-
$forumOb = &Agora_Messages::singleton();
$forums_list = $forumOb->getForums(0, true, 'forum_name', 0, true);
return '';
}
- require_once dirname(__FILE__) . '/../base.php';
-
/* Set up the message object. */
list($forum_id, $message_id) = explode('.', $this->_params['thread_id']);
$messages = &Agora_Messages::singleton('agora', $forum_id);
*/
function _params()
{
- require_once dirname(__FILE__) . '/../base.php';
-
$forums = Agora_Messages::singleton();
/* Get the list of forums to display. */
*/
function _title()
{
- require_once dirname(__FILE__) . '/../base.php';
-
if (!isset($this->_params['forum_id'])) {
return _("Threads");
}
*/
function _content()
{
- require_once dirname(__FILE__) . '/../base.php';
-
if (!isset($this->_params['forum_id'])) {
return _("No forum selected");
}
return $files;
}
- global $mime_drivers, $mime_drivers_map;
- $result = Horde::loadConfiguration('mime_drivers.php', array('mime_drivers', 'mime_drivers_map'), 'horde');
- extract($result);
- require_once 'Horde/MIME/Part.php';
- require_once 'Horde/MIME/Viewer.php';
- require_once 'Horde/MIME/Magic.php';
- require_once 'Horde/MIME/Contents.php';
-
/* Make sure we have the tooltips javascript. */
Horde::addScriptFile('tooltips.js', 'horde', true);
$html = '<br />';
$view_url = Horde::applicationUrl('view.php');
foreach ($files as $file_id => $file) {
- $mime_icon = MIME_Viewer::getIcon($file['file_type']);
+ $mime_icon = Horde_Mime_Viewer::getIcon($file['file_type']);
$title = _("download") . ': ' . $file['file_name'];
$tooltip = $title . "\n" . sprintf(_("size: %s"), $this->formatSize($file['file_size'])) . "\n" . sprintf(_("type: %s"), $file['file_type']);
$url = Horde_Util::addParameter($view_url, array('forum_id' => $this->_forum_id,
*/
private function _connect()
{
- require_once 'MDB2.php';
-
$this->_params = Horde::getDriverConfig('storage', 'sql');
Horde::assertDriverConfig($this->_params, 'storage',
array('phptype', 'charset'));
+++ /dev/null
-<?php
-/**
- * The Agora base inclusion library.
- *
- * Copyright 2003-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-// 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', dirname(__FILE__) . '/../..');
-}
-
-// Load the Horde Framework core, and set up inclusion paths and autoloading.
-require_once HORDE_BASE . '/lib/core.php';
-
-/* Set up the registry. */
-$registry = Horde_Registry::singleton();
-try {
- $registry->pushApp('agora');
-} catch (Horde_Exception $e) {
- Horde_Auth::authenticateFailure('agora', $e);
-}
-$conf = &$GLOBALS['conf'];
-define('AGORA_TEMPLATES', $registry->get('templates'));
-
-// Notification system.
-$notification = Horde_Notification::singleton();
-$notification->attach('status');
-
-/* Agora base library. */
-if (!defined('AGORA_BASE')) {
- define('AGORA_BASE', dirname(__FILE__) . '/..');
-}
-
-require_once AGORA_BASE . '/lib/Agora.php';
-require_once AGORA_BASE . '/lib/Messages.php';
-require_once AGORA_BASE . '/lib/View.php';
-
-// Start compression.
-if (!Horde_Util::nonInputVar('no_compress')) {
- Horde::compressOutput();
-}
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*/
-define('AGORA_BASE', dirname(__FILE__) . '/..');
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora');
/* Set up the messages object. */
list($forum_id, $message_id, $scope) = Agora::getAgoraId();
}
/* Collect moderators emails, and send them the notify */
- require_once 'Horde/Identity.php';
$emails = array();
foreach ($forum['moderators'] as $moderator) {
- $identity = &Identity::singleton('none', $moderator);
+ $identity = Horde_Prefs_Identity::singleton('none', $moderator);
$address = $identity->getValue('from_addr');
if (!empty($address)) {
$emails[] = $address;
* @author Marko Djukic <marko@oblo.com>
*/
-define('AGORA_BASE', dirname(__FILE__) . '/..');
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora');
/* Set up the messages object. */
list($forum_id, $message_id, $scope) = Agora::getAgoraId();
* @author Marko Djukic <marko@oblo.com>
*/
-define('AGORA_BASE', dirname(__FILE__) . '/..');
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora');
list($forum_id, $message_id, $scope) = Agora::getAgoraId();
$message_parent_id = Horde_Util::getFormData('message_parent_id');
* @author Marko Djukic <marko@oblo.com>
*/
-define('AGORA_BASE', dirname(__FILE__) . '/..');
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
-require_once 'Horde/Identity.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora');
/* Set up the messages object. */
list($forum_id, $message_id, $scope) = Agora::getAgoraId();
if (!$view_bodies) {
/* Get the author's avatar. */
if ($conf['avatar']['allow_avatars']) {
- $identity = &Identity::singleton('none', $message['message_author']);
+ $identity = Horde_Prefs_Identity::singleton('none', $message['message_author']);
$avatar_path = $identity->getValue('avatar_path');
$message_author_avatar = Agora::validateAvatar($avatar_path) ? Agora::getAvatarUrl($avatar_path) : false;
$view->message_author_avatar = $message_author_avatar;
* @author Marko Djukic <marko@oblo.com>
*/
-define('AGORA_BASE', dirname(__FILE__) . '/..');
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora');
/* Set up the messages object. */
list($forum_id, $message_id, $scope) = Agora::getAgoraId();
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*/
-define('AGORA_BASE', dirname(__FILE__) . '/..');
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora');
/* Set up the messages object. */
list($forum_id, $message_id, $scope) = Agora::getAgoraId();
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*/
-define('AGORA_BASE', dirname(__FILE__) . '/..');
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora');
/* Set up the messages object. */
list($forum_id, $message_id, $scope) = Agora::getAgoraId();
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*/
-define('AGORA_BASE', dirname(__FILE__) . '/..');
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora');
/* Set up the messages object. */
list($forum_id, $message_id, $scope) = Agora::getAgoraId();
* did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
*/
-define('AGORA_BASE', dirname(__FILE__));
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora');
/* Set up the messages object. */
$scope = Horde_Util::getGet('scope', 'agora');
$title = _("Messages Awaiting Moderation");
$view->menu = Agora::getMenu('string');
Horde::addScriptFile('stripe.js', 'horde', true);
- require_once AGORA_TEMPLATES . '/common-header.inc';
+ require AGORA_TEMPLATES . '/common-header.inc';
echo $view->render('moderate.html.php');
- require_once $registry->get('templates', 'horde') . '/common-footer.inc';
+ require $registry->get('templates', 'horde') . '/common-footer.inc';
}
* @author Marko Djukic <marko@oblo.com>
*/
-define('AGORA_BASE', dirname(__FILE__));
-require_once AGORA_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora');
if (!Horde_Auth::isAdmin()) {
header('Location: ' . Horde::applicationUrl('forums.php'));
* @author Duck <duck@oabla.net>
*/
-require_once dirname(__FILE__) . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora');
/* Only authenticated users should be using this. */
if (!Horde_Auth::isAuthenticated()) {
* @author Duck <duck@obala.net>
*/
-define('AUTH_HANDLER', true);
-define('AGORA_BASE', dirname(__FILE__) . '/../');
-require_once AGORA_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none'));
// Show a specific scope?
$scope = Horde_Util::getGet('scope', 'agora');
$cache_key = 'agora_rss_' . $scope;
/* Initialize the Cache object. */
-$cache = &Horde_Cache::singleton($GLOBALS['conf']['cache']['driver'],
- Horde::getDriverConfig('cache', $GLOBALS['conf']['cache']['driver']));
+$cache = Horde_Cache::singleton($GLOBALS['conf']['cache']['driver'],
+ Horde::getDriverConfig('cache', $GLOBALS['conf']['cache']['driver']));
$rss = $cache->get($cache_key, $conf['cache']['default_lifetime']);
if (!$rss) {
* @author Duck <duck@obala.net>
*/
-define('AUTH_HANDLER', true);
-define('AGORA_BASE', dirname(__FILE__) . '/../');
-require_once AGORA_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none'));
// Show a specific scope?
list($forum_id, $message_id, $scope) = Agora::getAgoraId();
* @author Duck <duck@obala.net>
*/
-define('AUTH_HANDLER', true);
-define('AGORA_BASE', dirname(__FILE__) . '/../');
-require_once AGORA_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none'));
// Detect forum id
$scope = Horde_Util::getGet('scope', 'agora');
* TODO: Moderation, attachments, ID swaping
*/
-// No need for auth.
-define('AUTH_HANDLER', true);
-
-// Find the base file paths.
-define('AGORA_BASE', dirname(dirname(__FILE__)));
-define('HORDE_BASE', dirname(AGORA_BASE));
-
-// Do CLI checks and environment setup first.
-require_once HORDE_BASE . '/lib/core.php';
-require_once 'Horde/CLI.php';
-
-// Make sure no one runs this from the web.
-if (!Horde_Cli::runningFromCLI()) {
- exit("Must be run from the command line\n");
-}
-
-// Load the CLI environment.
-Horde_Cli::init();
-$cli = &Horde_Cli::singleton();
-
-require_once 'DB.php';
-require_once HORDE_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none', 'cli' => true));
+$cli = Horde_Cli::singleton();
/* Open Agora database. */
$db_agora = &DB::connect($conf['sql']);
}
// We accept the user name on the command-line.
-require_once 'Console/Getopt.php';
$ret = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), 'h:p:a:t:f:c:',
array('help', 'phorum_id=', 'agora_id=', 'phorum_table=', 'from=', 'count='));
* Script to migrate forums from datatree agora_forms table
*/
-// No need for auth.
-define('AUTH_HANDLER', true);
-
-// Find the base file paths.
-define('HORDE_BASE', dirname(__FILE__) . '/../../..');
-define('AGORA_BASE', dirname(__FILE__) . '/../..');
-
-// Do CLI checks and environment setup first.
-require_once HORDE_BASE . '/lib/core.php';
-require_once 'Horde/Cli.php';
-
-// Make sure no one runs this from the web.
-if (!Horde_Cli::runningFromCLI()) {
- exit("Must be run from the command line\n");
-}
-
-// Load the CLI environment - make sure there's no time limit, init
-// some variables, etc.
-Horde_Cli::init();
-
-require_once 'DB.php';
-require_once HORDE_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none', 'cli' => true));
/* Open the database. */
$db = DB::connect($conf['sql']);
* Script to migrate forums from datatree agora_forms table
*/
-// No need for auth.
-define('AUTH_HANDLER', true);
-
-// Find the base file paths.
-define('HORDE_BASE', dirname(__FILE__) . '/../../..');
-define('AGORA_BASE', dirname(__FILE__) . '/../..');
-
-// Do CLI checks and environment setup first.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Make sure no one runs this from the web.
-if (!Horde_Cli::runningFromCLI()) {
- exit("Must be run from the command line\n");
-}
-
-// Load the CLI environment - make sure there's no time limit, init
-// some variables, etc.
-Horde_Cli::init();
-
-require_once 'DB.php';
-require_once HORDE_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none', 'cli' => true));
/* Open the database. */
$db = &DB::connect($conf['sql']);
* TODO Get rid of moderation
*/
-// No need for auth.
-define('AUTH_HANDLER', true);
-
-// Find the base file paths.
-define('AGORA_BASE', dirname(dirname(dirname(__FILE__))));
-define('HORDE_BASE', dirname(AGORA_BASE));
-
-// Do CLI checks and environment setup first.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Make sure no one runs this from the web.
-if (!Horde_Cli::runningFromCLI()) {
- exit("Must be run from the command line\n");
-}
-
-// Load the CLI environment - make sure there's no time limit, init
-// some variables, etc.
-Horde_Cli::init();
-
-require_once 'DB.php';
-require_once HORDE_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none', 'cli' => true));
/* Open the database. */
$db = &DB::connect($conf['sql']);
* Upgrades last messages
*/
-// No need for auth.
-define('AUTH_HANDLER', true);
-
-// Find the base file paths.
-define('AGORA_BASE', dirname(dirname(dirname(__FILE__))));
-define('HORDE_BASE', dirname(AGORA_BASE));
-
-// Do CLI checks and environment setup first.
-require_once HORDE_BASE . '/lib/core.php';
-
-// Make sure no one runs this from the web.
-if (!Horde_Cli::runningFromCLI()) {
- exit("Must be run from the command line\n");
-}
-
-// Load the CLI environment.
-Horde_Cli::init();
-$cli = &Horde_Cli::singleton();
-
-require_once 'MDB2.php';
-require_once HORDE_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/../../lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none', 'cli' => true));
+$cli = Horde_Cli::singleton();
/* Open the database. */
$params = Horde::getDriverConfig('storage', 'sql');
* @author Jason Felice <jason.m.felice@gmail.com>
*/
-define('AGORA_BASE', dirname(__FILE__));
-require_once AGORA_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora');
+
require_once AGORA_BASE . '/lib/Forms/Search.php';
/* Set up the forums object. */
<h1 class="header"><?php echo _('Banned'); ?></h1>
<ul>
<?php foreach ($this->banned as $k1 => $v1): ?>
- <li><?php if (isset($v1)) { echo is_array($v1) ? $k1 : $v1; } elseif (isset($this->banned)) { echo $this->banned; } ?></li>
+ <li><?php if (isset($v1)) { echo is_array($v1) ? $k1 : $v1; } elseif (isset($this->banned)) { echo $this->banned; } ?></li>
<?php endforeach; ?>
</ul>
<br class="spacer">
<?php endif; ?>
-<?php echo $this->formbox; ?>
\ No newline at end of file
+<?php echo $this->formbox; ?>
<?php echo $this->notify; ?>
<h1 class="header">
- <?php if (!empty($this->actions)): ?>
- <span class="smallheader rightFloat">
- <?php $i1 = count($this->actions); foreach ($this->actions as $k1 => $v1): ?><?php if (isset($v1)) { echo is_array($v1) ? $k1 : $v1; } elseif (isset($this->actions)) { echo $this->actions; } ?><?php if (--$i1 != 0) { echo ' | '; }; endforeach; ?></span>
- <?php endif; ?>
- <?php echo _('Forums'); ?>
-</h1>
-<?php if (!empty($this->forums_list) || !empty($this->forums_list)): ?>
-<table class="linedRow" style="width:100%; border-collapse:collapse;">
- <tr class="item">
+ <?php if (!empty($this->actions)): ?>
+ <span class="smallheader rightFloat">
+ <?php $i1 = count($this->actions); foreach ($this->actions as $k1 => $v1): ?><?php if (isset($v1)) { echo is_array($v1) ? $k1 : $v1; } elseif (isset($this->actions)) { echo $this->actions; } ?><?php if (--$i1 != 0) { echo ' | '; }; endforeach; ?></span>
+ <?php endif; ?>
+ <?php echo _('Forums'); ?>
+</h1>
+<?php if (!empty($this->forums_list) || !empty($this->forums_list)): ?>
+<table class="linedRow" style="width:100%; border-collapse:collapse;">
+ <tr class="item">
<th style="width:75%"<?php echo $this->col_headers['forum_name_class']; ?>>
<?php echo $this->col_headers['forum_name']; ?>
</th>
<th style="width:5%; text-align:center"<?php echo $this->col_headers['message_count_class']; ?>>
<?php echo $this->col_headers['message_count']; ?>
- </th>
+ </th>
<th style="width:5%; text-align:center"<?php echo $this->col_headers['thread_count_class']; ?>>
<?php echo $this->col_headers['thread_count']; ?>
- </th>
+ </th>
<th style="width:20%"<?php echo $this->col_headers['message_timestamp_class']; ?>>
<?php echo $this->col_headers['message_timestamp']; ?>
</th>
</tr>
- <?php foreach ($this->forums_list as $k2 => $v2): ?>
+ <?php foreach ($this->forums_list as $k2 => $v2): ?>
<tr valign="top">
<td>
<strong><?php echo $v2['indent']; ?><?php if (!empty($v2['url'])): ?><a href="<?php echo $v2['url']; ?>"><?php endif; ?><?php echo $v2['forum_name']; ?><?php if (!empty($v2['url'])): ?></a><?php endif; ?></strong>
<p><?php echo $v2['forum_description']; ?></p>
<?php if (!empty($v2['actions'])): ?>
<?php echo _('Options'); ?>:
- <?php $i3 = count($v2['actions']); foreach ($v2['actions'] as $k3 => $v3): ?><?php if (isset($v3)) { echo is_array($v3) ? $k3 : $v3; } elseif (isset($v2['actions'])) { echo $v2['actions']; } ?><?php if (--$i3 != 0) { echo ', '; }; endforeach; ?>
- <?php endif; ?>
+ <?php $i3 = count($v2['actions']); foreach ($v2['actions'] as $k3 => $v3): ?><?php if (isset($v3)) { echo is_array($v3) ? $k3 : $v3; } elseif (isset($v2['actions'])) { echo $v2['actions']; } ?><?php if (--$i3 != 0) { echo ', '; }; endforeach; ?>
+ <?php endif; ?>
<?php if (!empty($v2['moderators'])): ?>
<br />
<?php echo _('Moderators'); ?>:
- <?php $i4 = count($v2['moderators']); foreach ($v2['moderators'] as $k4 => $v4): ?><?php if (isset($v4)) { echo is_array($v4) ? $k4 : $v4; } elseif (isset($v2['moderators'])) { echo $v2['moderators']; } ?><?php if (--$i4 != 0) { echo ', '; }; endforeach; ?> <?php endif; ?>
+ <?php $i4 = count($v2['moderators']); foreach ($v2['moderators'] as $k4 => $v4): ?><?php if (isset($v4)) { echo is_array($v4) ? $k4 : $v4; } elseif (isset($v2['moderators'])) { echo $v2['moderators']; } ?><?php if (--$i4 != 0) { echo ', '; }; endforeach; ?> <?php endif; ?>
</td>
<td style="text-align:center">
<?php echo $v2['message_count']; ?>
<a href="<?php echo $v2['last_message_url']; ?>"><?php echo $v2['last_message_date']; ?></a><br />
<?php echo _('by'); ?>
<?php echo $v2['last_message_author']; ?>
- <?php endif; ?>
- </td>
- </tr>
- <?php endforeach; ?>
+ <?php endif; ?>
+ </td>
+ </tr>
+ <?php endforeach; ?>
</table>
<?php echo $this->pager_link;?>
<?php else: ?>
<p><em><?php echo _('No forums have been created.'); ?></em></p>
-<?php endif; ?>
+<?php endif; ?>
<div id="menu"><?php echo $this->menu; ?></div>
-<?php echo $this->notify; ?>
+<?php echo $this->notify; ?>
<?php echo $this->main; ?>
<?php echo $this->formbox; ?>
-<?php if (!empty($this->replying)): ?>
+<?php if (!empty($this->replying)): ?>
<br class="spacer" />
<h1 class="header">
<?php echo $this->message_subject; ?>
</h1>
-<table style="padding: 2px; width: 100%" class="item">
+<table style="padding: 2px; width: 100%" class="item">
<tr>
- <td style="width: 10%" valign="top">
+ <td style="width: 10%" valign="top">
<?php if (!empty($this->message_author_avatar)): ?>
<img src="<?php echo $this->message_author_avatar; ?>" alt="<?php echo $this->message_author; ?>" />
<br />
<?php echo $v1['link']; ?><strong><?php echo $v1['message_subject']; ?></strong></a>
<span style="font-size: 0.9em;">
<?php
- echo sprintf(_("Posted by %s on %s"), $v1['message_author'], $v1['message_date']);
+ echo sprintf(_("Posted by %s on %s"), $v1['message_author'], $v1['message_date']);
if (!empty($v1['message_author_moderator'])): ?>
<?php echo _('Moderator'); ?>
<?php endif; ?>
<?php foreach ($this->threads_list as $k1 => $v1): ?>
-
+
<div class="messageContainer" style="margin-left: <?php echo $v1['indent']; ?>0px">
-<div class="messageAuthor">
+<div class="messageAuthor">
<?php echo $v1['link']; ?><strong><?php echo $v1['message_subject']; ?></strong></a><br />
<?php echo _('Posted by'); ?> <?php echo $v1['message_author']; ?><br />
<?php echo _('on: '); ?> <?php echo $v1['message_date']; ?>
<?php $i2 = count($v1['actions']); foreach ($v1['actions'] as $k2 => $v2): ?>
<?php if (isset($v2)) { echo is_array($v2) ? $k2 : $v2; } elseif (isset($v1['actions'])) { echo $v1['actions']; } ?>
<?php if (--$i2 != 0) { echo ', '; }; endforeach; ?> ]
- </span>
+ </span>
</div>
<div class="messageBody">
<br class="clear" />
</div>
-<?php endforeach; ?>
+<?php endforeach; ?>
<div id="menu"><?php echo $this->menu; ?></div>
<?php echo $this->notify; ?>
-
+
<?php echo $this->formbox; ?>
-
-<br class="spacer" />
-<h1 class="header">
+
+<br class="spacer" />
+<h1 class="header">
<?php echo $this->message_subject; ?>
-</h1>
-
-<table style="padding: 2px; width: 100%" class="item">
- <tr>
- <td style="width: 10%" valign="top">
+</h1>
+
+<table style="padding: 2px; width: 100%" class="item">
+ <tr>
+ <td style="width: 10%" valign="top">
<?php if (!empty($this->message_author_avatar)): ?>
<img src="<?php echo $this->message_author_avatar; ?>" alt="<?php echo $this->message_author; ?>" />
- <br />
- <?php endif; ?>
+ <br />
+ <?php endif; ?>
<?php echo $this->message_author; ?>
- </td>
- <td style="width: 90%" valign="top" class="box">
+ </td>
+ <td style="width: 90%" valign="top" class="box">
<?php echo $this->message_body; ?>
- </td>
- </tr>
-</table>
+ </td>
+ </tr>
+</table>
<div id="menu"><?php echo $this->menu; ?></div>
<?php echo $this->notify; ?>
-<div class="header">
- <?php if (!empty($this->actions)): ?>
+<div class="header">
+ <?php if (!empty($this->actions)): ?>
<span class="smallheader rightFloat">
- <?php $i1 = count($this->actions); foreach ($this->actions as $k1 => $v1): ?><?php if (isset($v1)) { echo is_array($v1) ? $k1 : $v1; } elseif (isset($this->actions)) { echo $this->actions; } ?><?php if (--$i1 != 0) { echo ', '; }; endforeach; ?>
- </span>
- <?php endif; ?>
+ <?php $i1 = count($this->actions); foreach ($this->actions as $k1 => $v1): ?><?php if (isset($v1)) { echo is_array($v1) ? $k1 : $v1; } elseif (isset($this->actions)) { echo $this->actions; } ?><?php if (--$i1 != 0) { echo ', '; }; endforeach; ?>
+ </span>
+ <?php endif; ?>
<?php if (!empty($this->message_subject)): ?><?php echo $this->message_subject; ?><?php else: ?> <?php endif; ?>
</div>
-<div class="messageContainer">
- <div class="messageAuthor">
+<div class="messageContainer">
+ <div class="messageAuthor">
<?php if (!empty($this->message_author_avatar)): ?>
<img src="<?php echo $this->message_author_avatar; ?>" alt="<?php echo $this->message_author; ?>" />
- <br />
- <?php endif; ?>
+ <br />
+ <?php endif; ?>
<?php echo $this->message_author; ?>
<?php if (!empty($this->message_author_moderator)): ?>
<br /><?php echo _('Moderator'); ?>
<?php endif; ?>
</div>
<div class="messageBody">
- <p>
+ <p>
<?php echo $this->message_body; ?>
<?php if (!empty($this->message_attachment)): ?><br /><?php echo $this->message_attachment; ?><?php endif; ?>
- </p>
- </div>
+ </p>
+ </div>
<br class="clear" />
</div>
-<h1 class="header">
- <?php echo _('Thread Summary'); ?>
+<h1 class="header">
+ <?php echo _('Thread Summary'); ?>
</h1>
-<div class="item">
+<div class="item">
<?php echo $this->threads; ?>
</div>
-<table style="width:100%; border-collapse:collapse;" class="item linedRow">
- <tr class="item">
- <th style="width:60%" class="leftAlign">
+<table style="width:100%; border-collapse:collapse;" class="item linedRow">
+ <tr class="item">
+ <th style="width:60%" class="leftAlign">
<?php echo $this->col_headers['message_thread']; ?>
- </th>
- <th style="width:20%" class="leftAlign">
+ </th>
+ <th style="width:20%" class="leftAlign">
<?php echo $this->col_headers['message_author']; ?>
- </th>
- <th style="width:19%" class="leftAlign">
+ </th>
+ <th style="width:19%" class="leftAlign">
<?php echo $this->col_headers['message_timestamp']; ?>
</th>
</tr>
</tr>
<?php endif; ?>
<?php endforeach; ?>
-
-</table>
+
+</table>
</tr>
</thead>
<tbody>
- <?php foreach ($this->messages as $k1 => $v1): ?>
+ <?php foreach ($this->messages as $k1 => $v1): ?>
<tr style="vertical-align:top">
<td><input type="checkbox" class="checkbox" name="message_ids[]" value="<?php echo $v1['message_id']; ?>" /></td>
<td class="nowrap"><?php echo $v1['forum_name']; ?></td>
<div id="menu"><?php echo $this->menu; ?></div>
<?php echo $this->notify; ?>
-
-<h1 class="header"><?php echo _('Moderators'); ?></h1>
-<?php if (!empty($this->forums)): ?>
-<table class="striped">
-<tr>
- <td class="control"><?php echo _('Forum'); ?></td>
- <td class="control"><?php echo _('Forum name'); ?></td>
- <td class="control"><?php echo _('Moderators'); ?></td>
-</tr>
-<?php foreach ($this->forums as $k1 => $v1): ?>
-<tr>
- <td><?php if (isset($v1)) { echo is_array($v1) ? $k1 : $v1; } elseif (isset($this->forums)) { echo $this->forums; } ?></td>
+
+<h1 class="header"><?php echo _('Moderators'); ?></h1>
+<?php if (!empty($this->forums)): ?>
+<table class="striped">
+<tr>
+ <td class="control"><?php echo _('Forum'); ?></td>
+ <td class="control"><?php echo _('Forum name'); ?></td>
+ <td class="control"><?php echo _('Moderators'); ?></td>
+</tr>
+<?php foreach ($this->forums as $k1 => $v1): ?>
+<tr>
+ <td><?php if (isset($v1)) { echo is_array($v1) ? $k1 : $v1; } elseif (isset($this->forums)) { echo $this->forums; } ?></td>
<td><?php echo $v1['forum_name']; ?></td>
- <td>
- <?php if (!empty($v1['moderators'])): ?>
- <?php foreach ($v1['moderators'] as $k2 => $v2): ?>
- <?php if (isset($v2)) { echo is_array($v2) ? $k2 : $v2; } elseif (isset($v1['moderators'])) { echo $v1['moderators']; } ?><br />
- <?php endforeach; ?>
- <?php endif; ?>
- </td>
-</tr>
-<?php endforeach; ?>
-</table>
-<?php else: ?>
- <p><em><?php echo _('No moderators have been created.'); ?></em></p>
-
-<?php endif; ?>
-
-<br class="spacer">
-
-<?php echo $this->formbox; ?>
\ No newline at end of file
+ <td>
+ <?php if (!empty($v1['moderators'])): ?>
+ <?php foreach ($v1['moderators'] as $k2 => $v2): ?>
+ <?php if (isset($v2)) { echo is_array($v2) ? $k2 : $v2; } elseif (isset($v1['moderators'])) { echo $v1['moderators']; } ?><br />
+ <?php endforeach; ?>
+ <?php endif; ?>
+ </td>
+</tr>
+<?php endforeach; ?>
+</table>
+<?php else: ?>
+ <p><em><?php echo _('No moderators have been created.'); ?></em></p>
+
+<?php endif; ?>
+
+<br class="spacer">
+
+<?php echo $this->formbox; ?>
<div id="menu"><?php echo $this->menu; ?></div>
<?php echo $this->notify; ?>
-
-<?php if (!empty($this->searchResults)): ?>
+
+<?php if (!empty($this->searchResults)): ?>
<h1 class="header"><?php echo _('Search Results'); ?> (<?php echo $this->searchTotal; ?>)</h1>
-<table style="width: 100%" class="item linedRow" cellspacing="0">
-<?php foreach ($this->searchResults as $k1 => $v1): ?>
-<tr class="item">
- <th colspan="4" style="width:99%" class="leftAlign item">
+<table style="width: 100%" class="item linedRow" cellspacing="0">
+<?php foreach ($this->searchResults as $k1 => $v1): ?>
+<tr class="item">
+ <th colspan="4" style="width:99%" class="leftAlign item">
<a href="<?php echo $v1['forum_url']; ?>"><strong><?php echo $v1['forum_name']; ?></strong></a>
- </th>
-</tr>
-<?php foreach ($v1['messages'] as $k2 => $v2): ?>
-<tr class="item">
- <td style="width:5%" class="item"> </td>
- <td style="width:54%" class="leftAlign item">
+ </th>
+</tr>
+<?php foreach ($v1['messages'] as $k2 => $v2): ?>
+<tr class="item">
+ <td style="width:5%" class="item"> </td>
+ <td style="width:54%" class="leftAlign item">
<a href="<?php echo $v2['message_url']; ?>"><?php echo $v2['message_subject']; ?></a>
- </td>
- <td style="width:20%" class="leftAlign item">
+ </td>
+ <td style="width:20%" class="leftAlign item">
<strong><?php echo $v2['message_author']; ?></strong>
- </td>
- <td style="width:20%" class="leftAlign item">
+ </td>
+ <td style="width:20%" class="leftAlign item">
<?php echo $v2['message_date']; ?>
- </td>
-</tr>
-<?php endforeach; ?>
-<?php endforeach; ?>
-</table>
-
+ </td>
+</tr>
+<?php endforeach; ?>
+<?php endforeach; ?>
+</table>
+
<?php echo $this->pager_link; ?>
-
-<br class="spacer" />
-
-<?php endif; ?>
-
+
+<br class="spacer" />
+
+<?php endif; ?>
+
<?php echo $this->searchForm; ?>
<div id="menu"><?php echo $this->menu; ?></div>
<?php echo $this->notify; ?>
-<div class="header">
- <?php if (!empty($this->actions)): ?>
- <span class="smallheader rightFloat">
+<div class="header">
+ <?php if (!empty($this->actions)): ?>
+ <span class="smallheader rightFloat">
<?php $i1 = count($this->actions); foreach ($this->actions as $k1 => $v1): ?><a href="<?php echo $v1['url']; ?>" class="smallheader"><?php echo $v1['label']; ?></a><?php if (--$i1 != 0) { echo ', '; }; endforeach; ?>
</span>
<?php endif; ?>
<?php echo $this->forum_name; ?>
</div>
-<div class="control">
+<div class="control">
<?php echo $this->forum_description; ?>
</div>
<?php if (!empty($this->threads)): ?>
-<table style="width:100%; border-collapse:collapse;" class="linedRow">
+<table style="width:100%; border-collapse:collapse;" class="linedRow">
<tr class="item">
<th style="width:50%"<?php echo $this->col_headers['message_subject_class']; ?>>
<?php echo $this->col_headers['message_subject']; ?>
</th>
<th style="width:20%; text-align: center;"<?php echo $this->col_headers['message_author_class']; ?>>
<?php echo $this->col_headers['message_author']; ?>
- </th>
+ </th>
<th style="width:19%"<?php echo $this->col_headers['message_modifystamp_class']; ?>>
<?php echo $this->col_headers['message_modifystamp']; ?>
- </th>
- </tr>
-
- <?php foreach ($this->threads as $k2 => $v2): ?>
+ </th>
+ </tr>
+
+ <?php foreach ($this->threads as $k2 => $v2): ?>
<tr>
- <td>
+ <td>
<?php echo $v2['link']; ?><?php echo $v2['message_subject']; ?></a>
<?php if (isset($v2['hot'])) { echo $v2['hot']; } ?>
<?php if (isset($v2['new'])) { echo $v2['new']; } ?>
- <small>
+ <small>
<?php if (!empty($v2['pages'])): ?><br />[ <?php echo _('Goto page:'); ?> <?php $i3 = count($v2['pages']); foreach ($v2['pages'] as $k3 => $v3): ?><?php if (isset($v3)) { echo is_array($v3) ? $k3 : $v3; } elseif (isset($v2['pages'])) { echo $v2['pages']; } ?><?php if (--$i3 != 0) { echo ', '; }; endforeach; ?> ]<?php endif; ?>
<?php if (!empty($v2['actions'])): ?><br />[<?php $i4 = count($v2['actions']); foreach ($v2['actions'] as $k4 => $v4): ?><?php if (isset($v4)) { echo is_array($v4) ? $k4 : $v4; } elseif (isset($v2['actions'])) { echo $v2['actions']; } ?><?php if (--$i4 != 0) { echo ', '; }; endforeach; ?> ]<?php endif; ?>
- </small>
- </td>
+ </small>
+ </td>
<td style="text-align: center;">
<?php echo $v2['message_seq']; ?>
- </td>
- <td style="text-align: center;">
+ </td>
+ <td style="text-align: center;">
<?php echo $v2['view_count']; ?>
- </td>
- <td style="text-align: center;">
+ </td>
+ <td style="text-align: center;">
<?php echo $v2['message_author']; ?>
- </td>
- <td>
+ </td>
+ <td>
<?php if (!empty($v2['message_url'])): ?>
<?php echo $v2['message_url']; ?><?php echo $v2['last_message_date']; ?></a><br />
- <?php echo _('by'); ?>
+ <?php echo _('by'); ?>
<?php echo $v2['last_message_author']; ?>
<?php endif; ?>
</td>
<?php endforeach; ?>
</table>
<?php echo $this->pager_link; ?>
-<?php else: ?>
- <p><em><?php echo _('There are no threads in this forum.'); ?></em></p>
-
-<?php endif; ?>
+<?php else: ?>
+ <p><em><?php echo _('There are no threads in this forum.'); ?></em></p>
+
+<?php endif; ?>
* @author Marko Djukic <marko@oblo.com>
*/
-define('AGORA_BASE', dirname(__FILE__));
-require_once AGORA_BASE . '/lib/base.php';
-require_once AGORA_BASE . '/lib/Messages.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none', 'cli' => true));
/* Make sure we have a forum id. */
list($forum_id, , $scope) = Agora::getAgoraId();
* @author Marko Djukic <marko@oblo.com>
*/
-define('AGORA_BASE', dirname(__FILE__));
-require_once AGORA_BASE . '/lib/base.php';
+require_once dirname(__FILE__) . '/lib/Application.php';
+Horde_Registry::appInit('agora', array('authentication' => 'none', 'cli' => true));
$action_id = Horde_Util::getFormData('action_id', 'download');
$file_id = Horde_Util::getFormData('file_id');