Example #1
0
 function close($focus = false)
 {
     echo '</form>' . "\n";
     if (Horde_Util::getGet('reply_focus')) {
         echo '<script type="text/javascript">document.getElementById("message_body").focus()</script>';
     }
 }
Example #2
0
 /**
  * Renders this page in content mode.
  *
  * @return string  The page content.
  * @throws Wicked_Exception
  */
 public function content()
 {
     global $wicked;
     $days = (int) Horde_Util::getGet('days', 3);
     $summaries = $wicked->getRecentChanges($days);
     if (count($summaries) < 10) {
         $summaries = $wicked->mostRecent(10);
     }
     $bydate = array();
     $changes = array();
     foreach ($summaries as $page) {
         $page = new Wicked_Page_StandardPage($page);
         $createDate = $page->versionCreated();
         $tm = localtime($createDate, true);
         $createDate = mktime(0, 0, 0, $tm['tm_mon'], $tm['tm_mday'], $tm['tm_year'], $tm['tm_isdst']);
         $version_url = $page->pageUrl()->add('version', $page->version());
         $diff_url = Horde::url('diff.php')->add(array('page' => $page->pageName(), 'v1' => '?', 'v2' => $page->version()));
         $diff_alt = sprintf(_("Show changes for %s"), $page->version());
         $diff_img = Horde::img('diff.png', $diff_alt);
         $pageInfo = array('author' => $page->author(), 'name' => $page->pageName(), 'url' => $page->pageUrl(), 'version' => $page->version(), 'version_url' => $version_url, 'version_alt' => sprintf(_("Show version %s"), $page->version()), 'diff_url' => $diff_url, 'diff_alt' => $diff_alt, 'diff_img' => $diff_img, 'created' => $page->formatVersionCreated(), 'change_log' => $page->changeLog());
         $bydate[$createDate][$page->versionCreated()][$page->version()] = $pageInfo;
     }
     krsort($bydate);
     foreach ($bydate as $bysecond) {
         $day = array();
         krsort($bysecond);
         foreach ($bysecond as $pageList) {
             krsort($pageList);
             $day = array_merge($day, array_values($pageList));
         }
         $changes[] = array('date' => $day[0]['created'], 'pages' => $day);
     }
     return $changes;
 }
Example #3
0
 /**
  */
 public function menu($menu)
 {
     $scope = Horde_Util::getGet('scope', 'agora');
     /* Agora Home. */
     $url = Horde::url('forums.php')->add('scope', $scope);
     $menu->add($url, _("_Forums"), 'forums.png', null, null, null, dirname($_SERVER['PHP_SELF']) == $GLOBALS['registry']->get('webroot') && basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
     /* Thread list, if applicable. */
     if (isset($GLOBALS['forum_id'])) {
         $menu->add(Agora::setAgoraId($GLOBALS['forum_id'], null, Horde::url('threads.php')), _("_Threads"), 'threads.png');
         if ($scope == 'agora' && $GLOBALS['registry']->getAuth()) {
             $menu->add(Agora::setAgoraId($GLOBALS['forum_id'], null, Horde::url('messages/edit.php')), _("New Thread"), 'newmessage.png');
         }
     }
     if ($scope == 'agora' && Agora_Driver::hasPermission(Horde_Perms::DELETE, 0, $scope)) {
         $menu->add(Horde::url('editforum.php'), _("_New Forum"), 'newforum.png', null, null, null, Horde_Util::getFormData('agora') ? '__noselection' : null);
     }
     if (Agora_Driver::hasPermission(Horde_Perms::DELETE, 0, $scope)) {
         $url = Horde::url('moderate.php')->add('scope', $scope);
         $menu->add($url, _("_Moderate"), 'moderate.png');
     }
     if ($GLOBALS['registry']->isAdmin()) {
         $menu->add(Horde::url('moderators.php'), _("_Moderators"), 'hot.png');
     }
     $url = Horde::url('search.php')->add('scope', $scope);
     $menu->add($url, _("_Search"), 'search.png');
 }
Example #4
0
 /**
  * Creates the Agora id.
  *
  * @return string  If passed with the $url parameter, returns a completed
  *                 url with the agora_id tacked on at the end, otherwise
  *                 returns the simple agora_id.
  */
 function setAgoraId($forum_id, $message_id, $url = '', $scope = null, $encode = false)
 {
     $agora_id = $forum_id . '.' . $message_id;
     if (!empty($url)) {
         if ($scope) {
             $url = Horde::url($url)->add('scope', $scope)->setRaw(!$encode);
         } else {
             $url = Horde::url($url)->add('scope', Horde_Util::getGet('scope', 'agora'))->setRaw(!$encode);
         }
         return $url->add('agora', $agora_id);
     }
     return $agora_id;
 }
Example #5
0
 /**
  * Get user profile
  *
  * @param string $user   Username
  */
 public function getProfile($user = null)
 {
     static $profiles;
     if ($user == null) {
         $user = $GLOBALS['registry']->getAuth();
     }
     if (empty($user)) {
         return PEAR::raiseError(sprintf(_("User \"%s\" does not exists."), $user));
     }
     if (isset($profiles[$user])) {
         return $profiles[$user];
     }
     $profile = $GLOBALS['cache']->get('folksProfile' . $user, $GLOBALS['conf']['cache']['default_lifetime']);
     if ($profile || $GLOBALS['registry']->isAdmin() && Horde_Util::getGet('debug')) {
         $profile = unserialize($profile);
     } else {
         // Load profile
         $profile = $this->_getProfile($user);
         if ($profile instanceof PEAR_Error) {
             return $profile;
         }
         // Filter description
         $filters = array('text2html', 'bbcode', 'highlightquotes', 'emoticons');
         $filters_params = array(array('parselevel' => Horde_Text_Filter_Text2html::MICRO), array(), array(), array());
         if (($hasBBcode = strpos($profile['user_description'], '[')) !== false && strpos($profile['user_description'], '[/', $hasBBcode) !== false) {
             $filters_params[0]['parselevel'] = Horde_Text_Filter_Text2html::NOHTML;
         }
         $profile['user_description'] = $GLOBALS['injector']->getInstance('Horde_Core_Factory_TextFilter')->filter(trim($profile['user_description']), $filters, $filters_params);
         // Get user last external data
         foreach ($profile as $key => $value) {
             if (substr($key, 0, 6) != 'count_') {
                 continue;
             }
             $service = substr($key, 6);
             if ($GLOBALS['conf']['services']['countcron']) {
                 if (empty($value)) {
                     continue;
                 }
             } else {
                 try {
                     $profile['count_' . $service] = Horde::callHook('countService', array($service, $user), 'folks');
                 } catch (Horde_Exception_HookNotSet $e) {
                 }
                 if (empty($profile['count_' . $service])) {
                     continue;
                 }
             }
             try {
                 $profile['count_' . $service . '_list'] = Horde::callHook('getService', array($service, $user), 'folks');
             } catch (Horde_Exception_HookNotSet $e) {
             }
             if (empty($profile['count_' . $service . '_list'])) {
                 $profile['count_' . $service] = 0;
             }
         }
         // Cache profile
         // cache profile
         $GLOBALS['cache']->set('folksProfile' . $user, serialize($profile));
     }
     $profiles[$user] = $profile;
     return $profile;
 }
Example #6
0
/**
 * Copyright 2005-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';
$beatnik = Horde_Registry::appInit('beatnik');
require_once BEATNIK_BASE . '/lib/Forms/EditRecord.php';
$domains = array();
if (Horde_Util::getGet('domain') == 'current') {
    $url = Horde::url('viewzone.php');
    $domains[] = $_SESSION['beatnik']['curdomain'];
} elseif (Horde_Util::getGet('domain') == 'all') {
    $url = Horde::url('listzones.php');
    foreach (Beatnik::needCommit() as $domain) {
        $domains[] = $beatnik->driver->getDomain($domain);
    }
}
foreach ($domains as $domain) {
    $_SESSION['beatnik']['curdomain'] = $domain;
    $vars = new Horde_Variables();
    $vars->set('rectype', 'soa');
    foreach ($domain as $field => $value) {
        $vars->set($field, $value);
    }
    $vars->set('serial', Beatnik::incrementSerial($domain['serial']));
    $form = new EditRecord($vars);
    $form->useToken(false);
Example #7
0
/**
 * Copyright Obala d.o.o. (www.obala.si)
 *
 * 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 <*****@*****.**>
 * @package Folks
 */
define('FOLKS_BASE', __DIR__ . '/..');
require_once FOLKS_BASE . '/lib/base.php';
require_once FOLKS_BASE . '/lib/Forms/Activity.php';
require_once 'tabs.php';
$title = _("Activity");
$activity_scope = Horde_Util::getGet('activity_scope');
$activity_date = Horde_Util::getGet('activity_date');
if ($activity_scope && $activity_date) {
    $result = $folks_driver->deleteActivity($activity_scope, $activity_date);
    if ($result instanceof PEAR_Error) {
        $notification->push($result);
    } else {
        $notification->push(_("Activity successfully deleted"), 'horde.success');
        Horde::url('edit/activity.php')->redirect();
    }
}
$form = new Folks_Activity_Form($vars, _("What are you doing right now?"), 'long');
if ($form->validate()) {
    $result = $form->execute();
    if ($result instanceof PEAR_Error) {
        $notification->push($result);
    } else {
Example #8
0
/* 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;
        }
        $params['server'] = $injector->getInstance('Horde_ActiveSyncServer');
        $params['requireAuthorization'] = true;
        break;
    case 'Soap':
        $serverVars = $request->getServerVars();
        if (!$serverVars['REQUEST_METHOD'] || $serverVars['REQUEST_METHOD'] != 'POST') {
            $params['requireAuthorization'] = false;
            $input = Horde_Util::getGet('wsdl') === null ? 'disco' : 'wsdl';
        }
        break;
}
/* Load the RPC backend based on $serverType. */
try {
    $server = Horde_Rpc::factory($serverType, $request, $params);
} catch (Horde_Rpc_Exception $e) {
    Horde::log($e, 'ERR');
    header('HTTP/1.1 501 Not Implemented');
    exit;
}
// Let the backend check authentication. By default, we look for HTTP
// basic authentication against Horde, but backends can override this
// as needed. Must reset the authentication argument since we delegate
// auth to the RPC server.
Example #9
0
 * did not receive this file, see http://www.horde.org/licenses/gpl.
 *
 * @author Ben Klang <*****@*****.**>
 */
require_once __DIR__ . '/lib/Application.php';
$beatnik = Horde_Registry::appInit('beatnik');
// Unset the current domain since we are generating a zone list
$_SESSION['beatnik']['curdomain'] = null;
// Set up categories
$cManager = new Horde_Prefs_CategoryManager();
$categories = $cManager->get();
$colors = $cManager->colors();
$fgcolors = $cManager->fgColors();
// Page results
// Check for and store the current page in the session
$page = Horde_Util::getGet('page', $_SESSION['beatnik']['curpage']);
$_SESSION['beatnik']['curpage'] = $page;
// Create the Pager UI
$pager_vars = Horde_Variables::getDefaultVariables();
$pager_vars->set('page', $page);
$perpage = $prefs->getValue('domains_perpage');
$pager = new Horde_Core_Ui_Pager('page', $pager_vars, array('num' => count($beatnik->domains), 'url' => 'listzones.php', 'page_count' => 10, 'perpage' => $perpage));
// Limit the domain list to the current page
$domains = array_slice($beatnik->domains, $page * $perpage, $perpage);
// Hide fields that the user does not want to see
$fields = Beatnik::getRecFields('soa');
foreach ($fields as $field_id => $field) {
    if ($field['type'] == 'hidden' || $field['infoset'] != 'basic' && !$_SESSION['beatnik']['expertmode']) {
        unset($fields[$field_id]);
    }
}
Example #10
0
/**
 * 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 Duck  <*****@*****.**>
 */
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('agora');
/* Default to agora and current user if is not an admin. */
$scope = Horde_Util::getGet('scope', 'agora');
$owner = $registry->isAdmin() ? Horde_Util::getGet('owner', $registry->getAuth()) : $registry->getAuth();
/* Get the sorting. */
$sort_by = Agora::getSortBy('threads');
$sort_dir = Agora::getSortDir('threads');
$page_output->header();
$notification->notify(array('listeners' => 'status'));
echo '<h1>' . sprintf(_("Last posts in forums owned by %s"), $owner) . '</h1>';
foreach ($registry->listApps() as $scope) {
    if ($scope == 'agora' || $registry->hasMethod('hasComments', $scope) && $registry->callByPackage($scope, 'hasComments') === true) {
        $scope_name = $registry->get('name', $scope);
        $forums = $injector->getInstance('Agora_Factory_Driver')->create($scope);
        $threads = $forums->getThreadsByForumOwner($owner, 0, false, $sort_by, $sort_dir, false, 0, 5);
        echo '<h1 class="header">' . $scope_name . '</h1>';
        if ($threads instanceof PEAR_Error) {
            echo $threads->getMessage();
        } elseif (empty($threads)) {
Example #11
0
Horde_Registry::appInit('agora');
/* Set up the messages object. */
list($forum_id, $message_id, $scope) = Agora::getAgoraId();
$messages = $injector->getInstance('Agora_Factory_Driver')->create($scope, $forum_id);
if ($messages instanceof PEAR_Error) {
    $notification->push($messages->getMessage(), 'horde.warning');
    Horde::url('forums.php', true)->redirect();
}
/* Get requested message, if fail then back to forums list. */
$message = $messages->getMessage($message_id);
if ($message instanceof PEAR_Error) {
    $notification->push(sprintf(_("Could not open the message. %s"), $message->getMessage()), 'horde.warning');
    Horde::url('forums.php', true)->redirect();
}
/* Check if we must show bodies */
if (($view_bodies = Horde_Util::getGet('bodies')) !== null) {
    $prefs->setValue('thread_view_bodies', $view_bodies);
} else {
    $view_bodies = $prefs->getValue('thread_view_bodies');
}
/* Get view settings. */
$sort_by = $view_bodies == 1 ? 'message_thread' : Agora::getSortBy('thread');
$sort_dir = Agora::getSortDir('thread');
$forum = $messages->getForum();
$title = $forum['forum_name'] . ' :: ' . $message['message_subject'];
$thread_page = Horde_Util::getFormData('thread_page');
/* Count = replies + opening thread */
$thread_count = $messages->countThreads($message['message_thread']);
if ($thread_count instanceof PEAR_Error) {
    $notification->push(sprintf(_("Could not open the message. %s"), $thread_count->getMessage()), 'horde.warning');
    $thread_count = 0;
Example #12
0
<?php

/**
 * Process an single image (to be called by ajax)
 *
 * Copyright 2008-2014 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file COPYING for license information (GPL). If you
 * did not receive this file, see http://www.horde.org/licenses/gpl.
 *
 * @author Duck <*****@*****.**>
 */
require_once __DIR__ . '/../../lib/Application.php';
Horde_Registry::appInit('ansel');
$thumb = Horde_Util::getGet('thumb');
$tmp = Horde::getTempDir();
$path = $tmp . '/search_face_' . ($thumb ? 'thumb_' : '') . $registry->getAuth() . Ansel_Faces::getExtension();
header('Content-type: image/' . $conf['image']['type']);
readfile($path);
Example #13
0
<?php

/**
 * Process an single image (to be called by ajax)
 *
 * Copyright 2008-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 'tabs.php';
$page = Horde_Util::getFormData('page', 0);
$perpage = $prefs->getValue('facesperpage');
$owner = Horde_Util::getGet('owner', $GLOBALS['registry']->getAuth());
if (!$owner) {
    $title = _("From system galleries");
} elseif ($owner == $GLOBALS['registry']->getAuth()) {
    $title = _("From my galleries");
} else {
    $title = sprintf(_("From galleries of %s"), $owner);
}
try {
    $count = $faces->countOwnerFaces($owner);
    $results = $faces->ownerFaces($owner, $page * $perpage, $perpage);
} catch (Ansel_Exception $e) {
    $notification->push($e->getMessage(), 'horde.err');
    $results = array();
    $count = 0;
}
Example #14
0
    setcookie('folks_login_user', '', $_SERVER['REQUEST_TIME'] - 1000, $conf['cookie']['path'], $conf['cookie']['domain']);
    setcookie('folks_login_code', '', $_SERVER['REQUEST_TIME'] - 1000, $conf['cookie']['path'], $conf['cookie']['domain']);
    $folks_driver->deleteOnlineUser($GLOBALS['registry']->getAuth());
    @session_destroy();
    if (!empty($_GET['redirect'])) {
        header('Location: ' . $_GET['redirect']);
    } else {
        $page = $registry->getInitialPage('folks');
        header('Location: ' . (empty($page) ? '/' : $page));
    }
    exit;
}
/*
 * Special login for apps (gollem, imp)?
 */
if ($conf['login']['prelogin'] && $GLOBALS['registry']->getAuth() && ($app = Horde_Util::getGet('app'))) {
    Horde::callHook('prelogin', array($app), 'folks');
}
/*
 * Login parameters
 */
$url_param = Horde_Util::getFormData('url');
$login_url = $registry->getServiceLink('login', 'folks')->add('url', $url_param);
/*
 * We are already logged in?
 */
if ($registry->isAuthenticated()) {
    if (empty($url_param)) {
        $url_param = Folks::getUrlFor('user', $GLOBALS['registry']->getAuth());
    }
    header('Location: ' . $url_param);
Example #15
0
/**
 * Copyright 2007-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 Duck <*****@*****.**>
 */
require_once __DIR__ . '/../lib/Application.php';
Horde_Registry::appInit('agora', array('authentication' => 'none'));
// Detect forum id
$scope = Horde_Util::getGet('scope', 'agora');
$forum_id = Horde_Util::getGet('forum_id');
if ($scope != 'agora') {
    if (($forum_name = Horde_Util::getGet('forum_name')) !== null) {
        $threads = $injector->getInstance('Agora_Factory_Driver')->create($scope);
        $forum_id = $threads->getForumId($forum_name);
        if ($forum_id instanceof PEAR_Error || empty($forum_id)) {
            die($forum_id);
        }
    } elseif ($forum_id !== null) {
        $threads = $injector->getInstance('Agora_Factory_Driver')->create($scope, $forum_id);
        if ($threads instanceof PEAR_Error) {
            die($threads);
        }
        $forum_array = $threads->getForum();
        $forum_name = $forum_array['forum_name'];
    }
}
$cache_key = 'agora_rss_' . $scope . '_' . $forum_id;
Example #16
0
 *
 * 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 <*****@*****.**>
 * @package Folks
 */
require_once __DIR__ . '/../../lib/base.php';
require_once FOLKS_BASE . '/lib/Forms/AddFriend.php';
require_once FOLKS_BASE . '/edit/tabs.php';
$title = _("Blacklist");
// Load driver
require_once FOLKS_BASE . '/lib/Friends.php';
$friends = Folks_Friends::singleton();
// Perform action
$user = Horde_Util::getGet('user');
if ($user) {
    if ($friends->isBlacklisted($user)) {
        $result = $friends->removeBlacklisted($user);
        if ($result instanceof PEAR_Error) {
            $notification->push($result);
        } else {
            $notification->push(sprintf(_("User \"%s\" was removed from your blacklist."), $user), 'horde.success');
            Horde::url('edit/friends/blacklist.php')->redirect();
        }
    } else {
        $result = $friends->addBlacklisted($user);
        if ($result instanceof PEAR_Error) {
            $notification->push($result);
        } else {
            $notification->push(sprintf(_("User \"%s\" was added to your blacklist."), $user), 'horde.success');
Example #17
0
<?php

/**
 * Copyright 2001-2015 Horde LLC (http://www.horde.org/)
 *
 * See the enclosed file LICENSE for license information (ASL). If you
 * did not receive this file, see http://www.horde.org/licenses/apache.
 *
 * @package Mnemo
 */
@define('MNEMO_BASE', dirname(__DIR__));
require_once MNEMO_BASE . '/lib/Application.php';
Horde_Registry::appInit('mnemo');
$search = Horde_Util::getGet('q');
if (!$search) {
    header('HTTP/1.0 204 No Content');
    exit;
}
$memos = Mnemo::listMemos($prefs->getValue('sortby'), $prefs->getValue('sortdir'));
$search_pattern = '/^' . preg_quote($search, '/') . '/i';
$search_results = array();
foreach ($memos as $memo_id => $memo) {
    if (preg_match($search_pattern, $memo['desc'])) {
        $search_results[$memo_id] = $memo;
    }
}
if (count($search_results) == 1) {
    $note = array_shift($search_results);
    Horde::url('view.php', true)->add(array('memo' => $note['memo_id'], 'memolist' => $note['memolist_id']))->redirect();
}
$memos = $search_results;
Example #18
0
         Horde::url('history.php')->add('page', $page->pageName())->redirect();
     }
     $notification->push(_("This page does not have a history"), 'horde.error');
     break;
 case 'special':
     $page->handleAction();
     break;
 case 'export':
     if (!$page->allows(Wicked::MODE_DISPLAY)) {
         $notification->push(_("You don't have permission to view this page."), 'horde.error');
         if ($page->pageName() == 'Wiki/Home') {
             throw new Horde_Exception(_("You don't have permission to view this page."));
         }
         Wicked::url('Wiki/Home', true)->redirect();
     }
     switch (Horde_Util::getGet('format')) {
         case 'html':
             $format = 'Xhtml';
             $ext = '.html';
             $mime = 'text/html';
             break;
         case 'tex':
             $format = 'Latex';
             $ext = '.tex';
             $mime = 'text/x-tex';
             break;
         case 'rst':
             $format = 'Rst';
             $ext = '';
             $mime = 'text/text';
             break;
Example #19
0
<?php

/**
 * Image search
 *
 * 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 /var/www/www.fsf.org/copyleft/gpl.html.
 *
 * @author Duck <*****@*****.**>
 */
require_once 'tabs.php';
$page = Horde_Util::getFormData('page', 0);
$perpage = $prefs->getValue('facesperpage');
if (($face_id = Horde_Util::getGet('face_id')) !== null) {
    try {
        $face = $faces->getFaceById($face_id, true);
        $signature = $face['face_signature'];
        $results = $faces->getSignatureMatches($signature, $face_id, $perpage * $page, $perpage);
    } catch (Ansel_Exception $e) {
        $notification->push($e->getMessage());
        Horde::url('faces/search/image.php')->redirect();
    }
} else {
    $tmp = Horde::getTempDir();
    $path = $tmp . '/search_face_' . $registry->getAuth() . '.sig';
    if (file_exists($path) !== true) {
        $notification->push(_("You must upload the search photo first"));
        Horde::url('faces/search/image.php')->redirect();
    }
Example #20
0
<?php

/**
 * Copyright 2001-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.
 */
require_once __DIR__ . '/../lib/Application.php';
Horde_Registry::appInit('nag');
$query = Horde_Util::getGet('q');
if (!$query) {
    header('HTTP/1.0 204 No Content');
    exit;
}
$vars = Horde_Variables::getDefaultVariables();
$vars->search_completed = Nag::VIEW_ALL;
$vars->search_pattern = $query;
$vars->search_in = array('search_name');
$vars->actionID = 'search_tasks';
try {
    $view = new Nag_View_List($vars);
} catch (Nag_Exception $e) {
    $notification->push($e, 'horde.error');
    Horde::url('list.php')->redirect();
    exit;
}
echo $view->render($page_output);
Example #21
0
    }
    try {
        $img->resize(min($conf['screen']['width'], $dimensions['width']), min($conf['screen']['height'], $dimensions['height']));
    } catch (Horde_Image_Exception $e) {
        $notification->push($e->getMessage());
        Horde::url('faces/search/image.php')->redirect();
        exit;
    }
    $path = $tmp . '/search_face_' . $registry->getAuth() . Ansel_Faces::getExtension();
    if (file_put_contents($path, $img->raw())) {
        Horde::url('faces/search/image_define.php')->redirect();
    } else {
        $notification->push(_("Cannot store search photo"));
        Horde::url('faces/search/image.php')->redirect();
    }
    exit;
}
$page_output->header(array('title' => _("Upload face photo")));
$notification->notify(array('listeners' => 'status'));
echo $tabs->render(Horde_Util::getGet('search_faces', 'image'));
$form->renderActive(null, null, null, 'post');
if (empty($name)) {
    // Do noting
} elseif (empty($results)) {
    echo _("No faces found");
} else {
    foreach ($results as $face_id => $face) {
        include ANSEL_TEMPLATES . '/tile/face.inc';
    }
}
$page_output->footer();
Example #22
0
/**
 * 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');
/* Which forums page are we on?  Default to page 0. */
Example #23
0
File: test.php Project: horde/horde
}
$test_ob = new $classname();
/* Register a session. */
if ($session && !$session->exists('horde', 'test_count')) {
    $session->set('horde', 'test_count', 0);
}
/* Template location. */
$test_templates = HORDE_TEMPLATES . '/test';
/* Self URL. */
$url = Horde::url('test.php', false, array('app' => 'horde'));
$self_url = $url->copy()->add('app', $app);
/* Handle special modes. */
switch (Horde_Util::getGet('mode')) {
    case 'extensions':
        echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">';
        $ext_get = Horde_Util::getGet('ext');
        require $test_templates . '/extensions.inc';
        exit;
    case 'phpinfo':
        echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">';
        echo '<a href="' . htmlspecialchars($self_url) . '">&lt;&lt; Back to test.php</a>';
        phpinfo();
        exit;
    case 'unregister':
        echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">';
        $session->remove('horde', 'test_count');
        ?>
<html>
 <body>
 The test session has been unregistered.<br />
 <a href="<?php 
Example #24
0
 * Copyright Obala d.o.o. (www.obala.si)
 *
 * 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 <*****@*****.**>
 * @package Folks
 */
require_once __DIR__ . '/lib/base.php';
$title = _("Popularity");
$count = $folks_driver->countUsers();
if ($count instanceof PEAR_Error) {
    $notification->push($count);
    $count = 0;
}
$page = Horde_Util::getGet('page', 0);
$perpage = $prefs->getValue('per_page');
$criteria = array('sort_by' => 'popularity', 'sort_dir' => 0);
$users = $folks_driver->getUsers($criteria, $page * $perpage, $perpage);
if ($users instanceof PEAR_Error) {
    $notification->push($users);
    $users = array();
}
$vars = Horde_Variables::getDefaultVariables();
$pager = new Horde_Core_Ui_Pager('page', $vars, array('num' => $count, 'url' => 'popularity.php', 'perpage' => $perpage));
$pager->preserve($criteria);
$list_url = Folks::getUrlFor('list', 'popularity');
$page_output->addScriptFile('stripe.js', 'horde');
$page_output->header(array('title' => $title));
$page_output->footer();
$notification->notify(array('listeners' => 'status'));
Example #25
0
 * @package Folks
 */
define('FOLKS_BASE', __DIR__);
require_once FOLKS_BASE . '/lib/base.php';
if (Horde_Util::getFormData('submitbutton') == _("Close")) {
    echo '<script type="text/javascript">RedBox.close();</script>';
} elseif (Horde_Util::getFormData('formname') == 'savesearch') {
    $result = $folks_driver->saveSearch(Horde_Util::getFormData('search_criteria'), Horde_Util::getFormData('search_name'));
    if ($result instanceof PEAR_Error) {
        $notification->push($result);
    } else {
        $notification->push(_("Search criteria saved successfuly"), 'horde.success');
        Horde::url('search.php')->redirect();
    }
} elseif (Horde_Util::getGet('delete') == 1 && Horde_Util::getGet('query')) {
    $result = $folks_driver->deleteSavedSearch(Horde_Util::getGet('query'));
    if ($result instanceof PEAR_Error) {
        $notification->push($result);
    } else {
        $notification->push(_("Search criteria deleted."), 'horde.success');
        Horde::url('search.php')->redirect();
    }
}
// Render
$vars = Horde_Variables::getDefaultVariables();
$vars->set('search_criteria', $session->get('folks', 'last_search'));
$form = new Horde_Form($vars, '', 'savesearch');
$form->addVariable(_("Name"), 'search_name', 'text', true);
$form->addHidden('', 'search_criteria', 'text', true);
$form->setButtons(array(_("Save"), _("Close")));
$notification->notify(array('listeners' => 'status'));