function item($n, $type = 'v') { $tbl = str_replace(' ', '', $n); global $sessionInfo; $tablePerm = admin_getpermissionstable($sessionInfo['userid'], $tbl); $tblstr = 'table=' . $tbl; $viewfile = 'view.php'; $addfile = 'addedit.php'; $target = 'target="main"'; $class = 'leftnavitem'; if ($tablePerm['view']) { if (is_integer(strpos($type, 'v')) || is_integer(strpos($type, 'a'))) { echo html_a($viewfile . '?' . $tblstr, $n, $class, $target); } if ($tablePerm['add'] && is_integer(strpos($type, 'a'))) { echo html_a($addfile . '?' . $tblstr, '(Add)', $class, $target); } echo '<br />' . "\n"; } }
<?php /* $Id: commontable.inc.php,v 1.7 2003/05/07 20:48:10 robbat2 Exp $ */ global $tableName; $tableName = v('table'); $tablePerm = admin_getpermissionstable($sessionInfo['userid'], $tableName); //check permissions if (!$tablePerm[$perm]) { //show an error here echo "include('./gui/permissiondenied.php')"; } else { //ok, we are ok include './lib/processtable.inc.php'; } ?>