Commit bf0a884f authored by Jyhem's avatar Jyhem

[MOD] Better use of tiki_p_admin == y over user == admin

parent 89574c76
......@@ -11,13 +11,11 @@ if ($prefs['feature_featuredLinks'] != 'y') {
die;
}
// PERMISSIONS: NEEDS p_admin
if ($user != 'admin') {
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;
}
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;
}
$smarty->assign('title', '');
$smarty->assign('type', 'f');
......
......@@ -4,7 +4,7 @@
// 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.
require_once ('tiki-setup.php');
if ($user != 'admin' && $tiki_p_admin != 'y' && $tiki_p_clean_cache != 'y') { // admin test needed for the first inclusion of this perm befroring clearing the cache
if ( $tiki_p_admin != 'y' && $tiki_p_clean_cache != 'y') { // admin test needed for the first inclusion of this perm before clearing the cache
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra('You do not have permission to use this feature'));
$smarty->display('error.tpl');
......
......@@ -6,7 +6,7 @@
// Initialization
$tikifeedback = array();
require_once ('tiki-setup.php');
if (!($user == 'admin' || $tiki_p_admin == 'y' || $tiki_p_admin_users == 'y')) { // temporary patch: tiki_p_admin includes tiki_p_admin_users but if you don't clean the temp/cache each time you sqlupgrade the perms setting is not synchornous with the cache
if (!( $tiki_p_admin == 'y' || $tiki_p_admin_users == 'y')) { // temporary patch: tiki_p_admin includes tiki_p_admin_users but if you don't clean the temp/cache each time you sqlupgrade the perms setting is not synchornous with the cache
$smarty->assign('errortype', 401);
$smarty->assign('msg', tra("You do not have permission to use this feature"));
$smarty->display("error.tpl");
......
......@@ -105,7 +105,7 @@ if ($_REQUEST["galleryId"] != 0) {
//$smarty->assign_by_ref('theme',$gal_info["theme"]);
//$smarty->assign('use_theme','y');
/*
if($user!='admin' && $user!=$gal_info["user"] && $gal_info["public"]!='y') {
if( $tiki_p_admin != 'y' && $user!=$gal_info["user"] && $gal_info["public"]!='y') {
$smarty->assign('errortype', 401);
$smarty->assign('msg',tra("Permission denied you cannot browse this gallery"));
$smarty->display("error.tpl");
......
......@@ -10,7 +10,7 @@
include_once ("tiki-setup.php");
if ( isset($_REQUEST['user']) ) {
if ( $_REQUEST['user'] == 'admin' ) $smarty->assign('showloginboxes', 'y');
if ( $_REQUEST['user'] == 'admin' && $_SESSION["groups_are_emulated"] != "y" ) $smarty->assign('showloginboxes', 'y');
else $smarty->assign('loginuser', $_REQUEST['user']);
}
if ($prefs['useGroupHome'] != 'y' && !isset($_SESSION['loginfrom'])) {
......
......@@ -14,11 +14,11 @@ $access->check_script($_SERVER["SCRIPT_NAME"],basename(__FILE__));
global $usermoduleslib; include_once ('lib/usermodules/usermoduleslib.php');
include_once('tiki-module_controls.php');
global $prefs, $user, $userlib, $tiki_p_configure_modules, $smarty, $tikidomain, $tikilib, $section, $page;
global $prefs, $user, $userlib, $tiki_p_admin, $tiki_p_configure_modules, $smarty, $tikidomain, $tikilib, $section, $page;
clearstatcache();
if ($user != 'admin') {
if ($tiki_p_admin != 'y') {
$user_groups = $tikilib->get_user_groups($user);
} else {
$user_groups = array();
......
......@@ -16,7 +16,7 @@ include_once ('lib/userprefs/scrambleEmail.php');
include_once ('lib/userprefs/userprefslib.php');
// User preferences screen
if ($prefs['feature_userPreferences'] != 'y' && $prefs['change_password'] != 'y' && $user != 'admin') {
if ($prefs['feature_userPreferences'] != 'y' && $prefs['change_password'] != 'y' && $tiki_p_admin != 'y') {
$smarty->assign('msg', tra("This feature is disabled").": feature_userPreferences");
$smarty->display("error.tpl");
die;
......
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