Commit e24f8e22 authored by changi67's avatar changi67

[MOD] access check: deploy some accesslib check functions.

parent f8410ef7
......@@ -6,11 +6,7 @@
// $Id: /cvsroot/tikiwiki/tiki/tiki-read_article.php,v 1.61.2.2 2007-12-19 16:11:26 sylvieg Exp $
$section = 'cms';
require_once ('tiki-setup.php');
if ($prefs['feature_articles'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled") . ": feature_articles");
$smarty->display("error.tpl");
die;
}
$access->check_feature('feature_articles');
if (!isset($_REQUEST["articleId"])) {
$smarty->assign('msg', tra("No article indicated"));
$smarty->display("error.tpl");
......
......@@ -7,17 +7,9 @@
require_once ('tiki-setup.php');
include_once ('lib/commcenter/commlib.php');
include_once ('lib/articles/artlib.php');
if ($prefs['feature_comm'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled") . ": feature_comm");
$smarty->display("error.tpl");
die;
}
if ($tiki_p_admin_received_articles != 'y') {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra("You do not have permission to use this feature"));
$smarty->display("error.tpl");
die;
}
$access->check_feature('feature_comm');
$access->check_permission('tiki_p_admin_received_articles');
if (!isset($_REQUEST["receivedArticleId"])) {
$_REQUEST["receivedArticleId"] = 0;
}
......
......@@ -8,17 +8,8 @@ require_once ('tiki-setup.php');
include_once ('lib/commcenter/commlib.php');
include_once ('lib/wiki/wikilib.php');
$auto_query_args = array('receivedPageId', 'sort_mode', 'offset', 'find', 'sort_modes');
if ($prefs['feature_comm'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled") . ": feature_comm");
$smarty->display("error.tpl");
die;
}
if ($tiki_p_admin_received_pages != 'y') {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra("You do not have permission to use this feature"));
$smarty->display("error.tpl");
die;
}
$access->check_feature('feature_comm');
$access->check_permission('tiki_p_admin_received_pages');
if (!isset($_REQUEST["receivedPageId"])) {
$_REQUEST["receivedPageId"] = 0;
}
......
......@@ -6,17 +6,9 @@
// $Id: /cvsroot/tikiwiki/tiki/tiki-referer_stats.php,v 1.15 2007-10-12 07:55:32 nyloth Exp $
require_once ('tiki-setup.php');
include_once ('lib/refererstats/refererlib.php');
if ($prefs['feature_referer_stats'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled") . ": feature_referer_stats");
$smarty->display("error.tpl");
die;
}
if ($tiki_p_view_referer_stats != 'y') {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra("You do not have permission to use this feature"));
$smarty->display("error.tpl");
die;
}
$access->check_feature('feature_referer_stats');
$access->check_permission('tiki_p_view_referer_stats');
if (isset($_REQUEST["clear"])) {
$area = 'delrefstats';
if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) {
......
......@@ -5,12 +5,7 @@
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
require_once ('tiki-setup.php');
if ($tiki_p_admin != 'y') {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra("You do not have permission to use this feature"));
$smarty->display("error.tpl");
die;
}
$access->check_permission('tiki_p_admin');
include_once ('lib/directory/dirlib.php');
$tmp1 = isset($_SERVER["SERVER_NAME"]) ? $_SERVER["SERVER_NAME"] : "";
$tmp2 = isset($_SERVER["PHP_SELF"]) ? $_SERVER["PHP_SELF"] : "";
......
......@@ -5,11 +5,7 @@
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id: /cvsroot/tikiwiki/tiki/tiki-remind_password.php,v 1.34.2.1 2008-01-16 13:48:10 sylvieg Exp $
require_once ('tiki-setup.php');
if ($prefs['forgotPass'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled") . ": forgotPass");
$smarty->display("error.tpl");
die;
}
$access->check_feature('forgotPass');
$smarty->assign('showmsg', 'n');
$smarty->assign('showfrm', 'y');
$smarty->assign('headtitle', tra('I forgot my password'));
......
......@@ -9,11 +9,7 @@ $section_class = "tiki_wiki_page manage"; // This will be body class instead of
require_once ('tiki-setup.php');
include_once ('lib/wiki/histlib.php');
include_once ('lib/wiki/wikilib.php');
if ($prefs['feature_wiki'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled") . ": feature_wiki");
$smarty->display("error.tpl");
die;
}
$access->check_feature('feature_wiki');
// Get the page from the request var or default it to HomePage
if (!isset($_REQUEST["page"])) {
$smarty->assign('msg', tra("No page indicated"));
......
......@@ -8,11 +8,7 @@ $section = 'wiki page';
$section_class = "tiki_wiki_page manage"; // This will be body class instead of $section
require_once ('tiki-setup.php');
include_once ('lib/wiki/wikilib.php');
if ($prefs['feature_wiki'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled") . ": feature_wiki");
$smarty->display("error.tpl");
die;
}
$access->check_feature('feature_wiki');
// Get the page from the request var or default it to HomePage
if (!isset($_REQUEST["page"])) {
$smarty->assign('msg', tra("No page indicated"));
......
......@@ -7,11 +7,7 @@
require_once ('tiki-setup.php');
include_once ('lib/wiki/histlib.php');
include_once ('lib/wiki/wikilib.php');
if ($prefs['feature_wiki'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled") . ": feature_wiki");
$smarty->display("error.tpl");
die;
}
$access->check_feature('feature_wiki');
// Get the page from the request var or default it to HomePage
if (!isset($_REQUEST["page"])) {
$smarty->assign('msg', tra("No page indicated"));
......
......@@ -7,17 +7,8 @@
require_once ('tiki-setup.php');
include_once ('lib/themecontrol/tcontrol.php');
include_once ('lib/categories/categlib.php');
if ($prefs['feature_theme_control'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled") . ": feature_theme_control");
$smarty->display("error.tpl");
die;
}
if ($tiki_p_admin != 'y') {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra("You do not have permission to use this feature"));
$smarty->display("error.tpl");
die;
}
$access->check_feature('feature_theme_control');
$access->check_permission('tiki_p_admin');
$auto_query_args = array('find', 'sort_mode', 'offset', 'theme', 'theme-option', 'categId');
......
......@@ -16,17 +16,8 @@ function correct_array(&$arr, $id, $name) {
$arr[$i]['objName'] = $arr[$i][$name];
}
}
if ($prefs['feature_theme_control'] != 'y') {
$smarty->assign('msg', tra("This feature is disabled") . ": feature_theme_control");
$smarty->display("error.tpl");
die;
}
if ($tiki_p_admin != 'y') {
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra("You do not have permission to use this feature"));
$smarty->display("error.tpl");
die;
}
$access->check_feature('feature_theme_control');
$access->check_permission('tiki_p_admin');
$auto_query_args = array('find', 'sort_mode', 'offset', 'theme', 'theme-option', 'type', 'objdata');
$smarty->assign('a_object', isset($_REQUEST['objdata']) ? $_REQUEST['objdata'] : '');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment