Commit a26ce399 authored by chealer's avatar chealer

A bit of moving to save about 10 queries when browsing with tiki_p_admin.

parent 06546281
<?php <?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-setup_base.php,v 1.54 2004-03-18 21:22:36 chealer Exp $ // $Header: /cvsroot/tikiwiki/tiki/tiki-setup_base.php,v 1.55 2004-03-25 21:02:45 chealer Exp $
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors. // All Rights Reserved. See copyright.txt for details and a complete list of authors.
...@@ -191,23 +191,14 @@ if(!$cachelib->isCached("allperms")) { ...@@ -191,23 +191,14 @@ if(!$cachelib->isCached("allperms")) {
} }
$allperms = $allperms["data"]; $allperms = $allperms["data"];
//Initializes permissions
foreach ($allperms as $vperm) { foreach ($allperms as $vperm) {
$perm = $vperm["permName"]; $perm = $vperm["permName"];
$$perm = 'n';
if ($user != 'admin' && (!$user || !$userlib->user_has_permission($user, 'tiki_p_admin'))) {
$$perm = 'n';
$smarty->assign("$perm", 'n'); $smarty->assign("$perm", 'n');
} else {
$$perm = 'y';
$smarty->assign("$perm", 'y');
}
} }
unset($allperms);
// Permissions // Permissions
// Get group permissions here // Get group permissions here
$perms = $userlib->get_user_permissions($user); $perms = $userlib->get_user_permissions($user);
...@@ -371,6 +362,18 @@ if ($tiki_p_admin_cms == 'y') { ...@@ -371,6 +362,18 @@ if ($tiki_p_admin_cms == 'y') {
} }
} }
//Gives admins all permissions
if ($user == 'admin' || ($user && $userlib->user_has_permission($user, 'tiki_p_admin'))) {
foreach ($allperms as $vperm) {
$perm = $vperm["permName"];
$$perm = 'y';
$smarty->assign("$perm", 'y');
}
}
unset($allperms);
$tikiIndex = $tikilib->get_preference("tikiIndex", 'tiki-index.php'); $tikiIndex = $tikilib->get_preference("tikiIndex", 'tiki-index.php');
$style = $tikilib->get_preference("style", 'moreneat.css'); $style = $tikilib->get_preference("style", 'moreneat.css');
......
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