Commit 5e5ac2a0 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) remove session var page-match

parent 15da6558
......@@ -82,7 +82,8 @@ function isAllowedPage($page)
}
/* user privelege access check */
return cmp_page_matches($page, $_SESSION['page-match']);
$allowedpages = getAllowedPages();
return cmp_page_matches($page, $allowedpages);
}
......@@ -132,8 +133,6 @@ function getAllowedPages($username) {
}
}
$_SESSION['page-match'] = $allowed_pages;
return $allowed_pages;
}
......@@ -268,12 +267,12 @@ if (!session_auth()) {
* We give them access only to the appropriate pages based on
* the user or group privileges.
*/
$allowedpages = getAllowedPages($_SESSION['Username']);
/*
* redirect to first allowed page if requesting a wrong url
*/
if (!isAllowedPage($_SERVER['REQUEST_URI'])) {
$allowedpages = getAllowedPages($_SESSION['Username']);
if (count($allowedpages) > 0) {
$page = str_replace('*', '', $allowedpages[0]);
header("Location: /{$page}");
......
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