Revision dff909d8
Added by Scott Ullrich over 15 years ago
etc/inc/priv.inc | ||
---|---|---|
175 | 175 |
return $privs; |
176 | 176 |
} |
177 | 177 |
|
178 |
function isAllowedPage($page, $username) {
|
|
178 |
function isAllowedPageUser($username, $page) {
|
|
179 | 179 |
global $_SESSION; |
180 | 180 |
|
181 |
if($username == "") |
|
182 |
$username = $_SESSION['Username']; |
|
181 |
if (!isset($username)) |
|
182 |
return false; |
|
183 |
|
|
184 |
/* admin/root access check */ |
|
185 |
$user = getUserEntry($username); |
|
186 |
if (isset($user)) |
|
187 |
if (isset($user['uid'])) |
|
188 |
if ($user['uid']==0) |
|
189 |
return true; |
|
190 |
|
|
191 |
/* user privelege access check */ |
|
192 |
if (cmp_page_matches($page, $_SESSION['page-match'])) |
|
193 |
return true; |
|
194 |
|
|
195 |
return false; |
|
196 |
} |
|
197 |
|
|
198 |
|
|
199 |
function isAllowedPage($page) { |
|
200 |
global $_SESSION; |
|
201 |
|
|
202 |
|
|
203 |
$username = $_SESSION['Username']; |
|
183 | 204 |
|
184 | 205 |
if (!isset($username)) |
185 | 206 |
return false; |
Also available in: Unified diff
Revert isAllowedUser commit and duplicate function to isAllowedPageUser()