4 * security levels + login requirement:
7 if (!isset($GLOBALS['phorkie']['auth']['securityLevel'])) {
8 //not set? highest level of security
9 $GLOBALS['phorkie']['auth']['securityLevel'] = 2;
12 if ($GLOBALS['phorkie']['auth']['securityLevel'] == 0) {
13 //everyone may do everything
18 if (!isset($_SESSION['identity'])) {
20 } else if ($GLOBALS['phorkie']['auth']['listedUsersOnly']) {
21 if (in_array($_SESSION['identity'], $GLOBALS['phorkie']['auth']['users'])) {
25 //session identity exists, no special checks required
30 //you may do everything if you're logged in
34 if (!isset($reqWritePermissions)) {
35 $reqWritePermissions = true;
37 if ($GLOBALS['phorkie']['auth']['securityLevel'] == 1
38 && !$reqWritePermissions
43 $_SESSION['REQUEST_URI'] = $_SERVER['REQUEST_URI'];
44 require 'forbidden.php';