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 0c9ec69fee54ec949922aa47d0c794bafb73f792..a0270b51e90c4bb4078964c0251d9c11196eb7fb 100644 (file)
@@ -13,10 +13,13 @@ $GLOBALS['phorkie']['cfg'] = array(
     'index'         => 'new'//"new" or "list"
 );
 $GLOBALS['phorkie']['auth'] = 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
     '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,
 );
 $GLOBALS['phorkie']['tools'] = array(
     '\\phorkie\\Tool_Xmllint' => true,
index e90f704ca28bd01094cc07c79a2879edaa14bb4e..ced993f508afe4e654b5d8c337358e874c9b4e04 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']['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'
 //);
 //    'https://www.google.com/accounts/o8/id?id=ABCDEFGHIJKLMNOPQRSTUVWXYZ',
 //    'http://anonymous.phorkie.openid'
 //);
index e9fdab7207eb1340422f1ebc07f30c70c06f2e42..ccbdb9784c6b3e78f1d154363310a7f99591a642 100644 (file)
@@ -17,8 +17,8 @@ if ($GLOBALS['phorkie']['auth']['securityLevel'] == 0) {
 $logged_in = false;
 if (!isset($_SESSION['identity'])) {
     //not logged in 
 $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 {
         $logged_in = true;
     }
 } else {