rename auth configuration variables to make them more readable
authorChristian Weiske <cweiske@cweiske.de>
Tue, 18 Sep 2012 05:46:49 +0000 (07:46 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 18 Sep 2012 05:46:49 +0000 (07:46 +0200)
data/config.default.php
data/config.php.dist
www/www-security.php

index 0c9ec69..a0270b5 100644 (file)
@@ -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,
index e90f704..ced993f 100644 (file)
@@ -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'
 //);
index e9fdab7..ccbdb97 100644 (file)
@@ -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 {