aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/config.default.php9
-rw-r--r--data/config.php.dist5
-rw-r--r--www/www-security.php4
3 files changed, 12 insertions, 6 deletions
diff --git a/data/config.default.php b/data/config.default.php
index 0c9ec69..a0270b5 100644
--- a/data/config.default.php
+++ b/data/config.default.php
@@ -13,10 +13,13 @@ $GLOBALS['phorkie']['cfg'] = array(
'index' => 'new'//"new" or "list"
);
$GLOBALS['phorkie']['auth'] = array(
- 'securityLevel' => 0, // 0 = public, no authentication, 1 = protect adds/edits/deletes, 2 = require authentication
- 'userlist' => false, // true = user must be explicitly defined, false = anyone allowed, but they must authenticate
+ // 0 = public, no authentication, 1 = protect adds/edits/deletes,
+ // 2 = require authentication
+ 'securityLevel' => 0,
+ 'listedUsersOnly' => false,
+ 'users' => array(), // Array of OpenIDs that may login
'anonymousName' => 'Anonymous', // Email for non-authenticated commits
- 'anonymousEmail' => 'anonymous@phorkie' // Email for non-authenticated commits
+ 'anonymousEmail' => 'anonymous@phorkie', // Email for non-authenticated commits
);
$GLOBALS['phorkie']['tools'] = array(
'\\phorkie\\Tool_Xmllint' => true,
diff --git a/data/config.php.dist b/data/config.php.dist
index e90f704..ced993f 100644
--- a/data/config.php.dist
+++ b/data/config.php.dist
@@ -5,7 +5,10 @@
//$GLOBALS['phorkie']['cfg']['git']['private'] = 'ssh://git@bogo:paste/';
//$GLOBALS['phorkie']['cfg']['elasticsearch'] = 'http://localhost:9200/phorkie/';
//$GLOBALS['phorkie']['cfg']['setupcheck'] = false;
-//$GLOBALS['phorkie']['users'] = array(
+
+//$GLOBALS['phorkie']['auth']['securityLevel'] = 0;
+//$GLOBALS['phorkie']['auth']['listedUsersOnly'] = false;
+//$GLOBALS['phorkie']['auth']['users'] = array(
// 'https://www.google.com/accounts/o8/id?id=ABCDEFGHIJKLMNOPQRSTUVWXYZ',
// 'http://anonymous.phorkie.openid'
//);
diff --git a/www/www-security.php b/www/www-security.php
index e9fdab7..ccbdb97 100644
--- a/www/www-security.php
+++ b/www/www-security.php
@@ -17,8 +17,8 @@ if ($GLOBALS['phorkie']['auth']['securityLevel'] == 0) {
$logged_in = false;
if (!isset($_SESSION['identity'])) {
//not logged in
-} else if ($GLOBALS['phorkie']['auth']['userlist']) {
- if (in_array($_SESSION['identity'], $GLOBALS['phorkie']['users'])) {
+} else if ($GLOBALS['phorkie']['auth']['listedUsersOnly']) {
+ if (in_array($_SESSION['identity'], $GLOBALS['phorkie']['auth']['users'])) {
$logged_in = true;
}
} else {