tiki-directory_redirect.php 811 Bytes
Newer Older
1
<?php
changi67's avatar
changi67 committed
2 3 4
/**
 * @package tikiwiki
 */
5
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
6
// 
7 8
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
9
// $Id$
changi67's avatar
changi67 committed
10

11 12
require_once ('tiki-setup.php');
include_once ('lib/directory/dirlib.php');
13 14
$access->check_feature('feature_directory');
$access->check_permission('tiki_p_view_directory');
15 16
if (!isset($_REQUEST['siteId'])) {
	$smarty->assign('msg', tra("No site indicated"));
17
	$smarty->display("error.tpl");
18
	die;
19 20 21 22 23 24
}
$site_info = $dirlib->dir_get_site($_REQUEST['siteId']);
$url = $site_info['url'];
// Add a hit to the site
$dirlib->dir_add_site_hit($_REQUEST['siteId']);
// Redirect to the site URI
25
header("location: $url");
26
die;