Esempio n. 1
0
 /**
  * @param $page
  */
 function invalidate_cache($page)
 {
     unset($this->cache_page_info[urlencode($page)]);
     $this->table('tiki_pages')->update(array('cache_timestamp' => 0), array('pageName' => $page));
     $pageCache = Tiki_PageCache::create()->checkMeta('wiki-page-output-meta-timestamp', array('page' => $page))->invalidate();
 }
if (empty($_REQUEST['forumId'])) {
    $thread_info = $commentslib->get_comment($_REQUEST['comments_parentId']);
    if (empty($thread_info['object']) || $thread_info['objectType'] != 'forum') {
        $smarty->assign('msg', tra('Incorrect thread'));
        $smarty->display('error.tpl');
        die;
    }
    $_REQUEST['forumId'] = $thread_info['object'];
}
$forum_info = $commentslib->get_forum($_REQUEST["forumId"]);
if (empty($forum_info)) {
    $smarty->assign('msg', tra('Incorrect thread'));
    $smarty->display('error.tpl');
    die;
}
$pageCache = Tiki_PageCache::create()->disableForRegistered()->onlyForGet()->requiresPreference('memcache_forum_output')->addArray($_GET)->addValue('role', 'forum-page-output')->addKeys($_REQUEST, array('locale', 'forumId', 'comments_parentId'))->checkMeta('forum-page-output-meta-time', array('forumId' => @$_REQUEST['forumId'], 'comments_parentId' => @$_REQUEST['comments_parentId']))->applyCache();
if ($prefs['feature_categories'] == 'y') {
    global $categlib;
    include_once 'lib/categories/categlib.php';
}
if (!isset($_REQUEST['topics_offset'])) {
    $_REQUEST['topics_offset'] = 0;
}
if (!isset($_REQUEST['topics_sort_mode']) || empty($_REQUEST['topics_sort_mode'])) {
    $_REQUEST['topics_sort_mode'] = $forum_info['topicOrdering'];
} else {
    $smarty->assign('topics_sort_mode_param', '&topics_sort_mode=' . $_REQUEST['topics_sort_mode']);
}
if (!isset($_REQUEST['topics_find'])) {
    $_REQUEST['topics_find'] = '';
}
	if (empty($thread_info['object']) || $thread_info['objectType'] != 'forum') {
		$smarty->assign('msg', tra('Incorrect thread'));
		$smarty->display('error.tpl');
		die;
	}
	$_REQUEST['forumId'] = $thread_info['object'];
}
$forum_info = $commentslib->get_forum($_REQUEST["forumId"]);
if (empty($forum_info)) {
		$smarty->assign('msg', tra('Incorrect thread'));
		$smarty->display('error.tpl');
		die;
}

require_once 'lib/cache/pagecache.php';
$pageCache = Tiki_PageCache::create()
	->disableForRegistered()
	->onlyForGet()
	->requiresPreference('memcache_forum_output')
	->addArray($_GET)
	->addValue('role', 'forum-page-output')
	->addKeys($_REQUEST, array( 'locale', 'forumId', 'comments_parentId' ))
	->checkMeta(
					'forum-page-output-meta-time', array(
						'forumId'           => @$_REQUEST['forumId'],
						'comments_parentId' => @$_REQUEST['comments_parentId']
					)
	)
	->applyCache();

if ($prefs['feature_categories'] == 'y') {
Esempio n. 4
0
    global $flaggedrevisionlib;
    require_once 'lib/wiki/flaggedrevisionlib.php';
    if ($flaggedrevisionlib->page_requires_approval($page)) {
        $perms = Perms::get('wiki page', $page);
        if ($perms->wiki_approve) {
            $flaggedrevisionlib->flag_revision($page, $_REQUEST['revision'], 'moderation', 'OK');
        }
    }
    $access->redirect($wikilib->sefurl($page));
}
$pageRenderer = new WikiRenderer($info, $user);
$objectperms = $pageRenderer->applyPermissions();
if ($prefs['flaggedrev_approval'] == 'y' && isset($_REQUEST['latest']) && $objectperms->wiki_view_latest) {
    $pageRenderer->forceLatest();
}
$pageCache = Tiki_PageCache::create()->disableForRegistered()->onlyForGet()->requiresPreference('memcache_wiki_output')->addValue('role', 'wiki-page-output')->addValue('page', $page)->addValue('locale', $prefs['language'])->addKeys($_REQUEST, array('style_mode'))->checkMeta('wiki-page-output-meta-timestamp', array('page' => $page))->applyCache();
if ($page_ref_id) {
    $pageRenderer->setStructureInfo($page_info);
}
// Now check permissions to access this page
if (!$pageRenderer->canView) {
    $access->display_error($page, tra('You do not have permission to view this page.'), '401');
}
// Convert page to structure
if (isset($_REQUEST['convertstructure']) && isset($structs) && count($structs) == 0) {
    $page_ref_id = $structlib->s_create_page(0, null, $page);
    header('Location: tiki-index.php?page_ref_id=' . $page_ref_id);
    exit;
}
if (isset($_REQUEST['copyrightpage'])) {
    $smarty->assign_by_ref('copyrightpage', $_REQUEST['copyrightpage']);
Esempio n. 5
0
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */
// Initialization
define('COLUMN_MAXLEN', 64);
require_once 'tiki-setup.php';
$access->check_feature('feature_metrics_dashboard');
require_once "lib/metrics/metricslib.php";
require_once "lib/metrics/input-validation.php";
$metricslib = new MetricsLib();
$tab_id = $_REQUEST['tab_id'];
$range = $_REQUEST['range'];
$date_from = $_REQUEST['date_from'];
$date_to = $_REQUEST['date_to'];
$date_field = $_REQUEST['date_field'];
$pageCache = Tiki_PageCache::create()->requiresPreference('metrics_cache_output')->addKeys($_REQUEST, array('tab_id', 'range', 'date_from', 'date_to', 'date_field'))->applyCache();
$metrics_notify = '';
if (empty($date_field)) {
    $date_field = 'date_field';
} else {
    /** 
     * strip ` and limit column length
     */
    $date_field = preg_replace('/[`\\/\\\\<>"\']/', '', $date_field);
    $date_field = substr($date_field, 0, COLUMN_MAXLEN);
}
if (!is_numeric($tab_id)) {
    print tr("ERROR: Invalid tab_id received. Numeric format expected, got %0.", $tab_id);
    die;
}
$converted_range = convert_date_range($range, $date_from, $date_to, $date_field);