[dokuwiki] [SOLVED] "No ACL setup yet!" warning when not logged in

  • From: Roland Hager <roland.hager@xxxxxxxxxxxx>
  • To: "dokuwiki@xxxxxxxxxxxxx" <dokuwiki@xxxxxxxxxxxxx>
  • Date: Fri, 14 Jan 2011 13:09:23 +0100

I'm just updating our Wikifarm from "lemming" to "anteater" and everything works fine except that nasty warning:


   "No ACL setup yet! Denying access to everyone."

I first thought there might be some trouble with our LDAP authentication but no - there wasn't. The reason was an incomplete $config_cascade array.

We make use of the preload.php to set some individual paths and stuff. We also set the $config_cascade array. With the new anteater version there are now three new fields:

        'userscript', 'acl','plainauth.users'.

Since these fields did not exist in "lemming" they were not set in our preload.php. The init.php will not override an existing array and thus the fields are missing, ending up with that annoying warning.

OKAY I could have just added the new fields to our preload.php but it seems more comfortable and compatible to add some minor changes.

1. Initialize $config_cascade as an array() and not as an empty string.

2. Always include the 'inc/config_cascade.php'. So ommit the if(empty) check.

3. In the 'inc/config_cascade.php' simply wrapped the default array with an array_merge().

With these changes one can set only that fields that are really needed in preload.php without having to copy the rest. Additionally it won't break existing installations when adding new fields, as it happened to me right now :-).


That's it. Hope it may help someone or even find it's way to the repository. Patches are attached.

Roland
--- original/inc/config_cascade.php     2010-11-07 17:43:03.000000000 +0100
+++ inc/config_cascade.php      2011-01-14 12:58:53.000000000 +0100
@@ -5,7 +5,8 @@
  * This array configures the default locations of various files in the
  * DokuWiki directory hierarchy. It can be overriden in inc/preload.php
  */
-$config_cascade = array(
+$config_cascade = array_merge(
+       array(
         'main' => array(
             'default'   => array(DOKU_CONF.'dokuwiki.php'),
             'local'     => array(DOKU_CONF.'local.php'),
@@ -62,5 +63,6 @@
         'plainauth.users' => array(
             'default' => DOKU_CONF.'users.auth.php',
             ),
-);
+       ),
+       $config_cascade);
 
--- original/inc/init.php       2010-11-07 17:43:04.000000000 +0100
+++ inc/init.php        2011-01-14 13:07:28.000000000 +0100
@@ -11,7 +11,7 @@
 define('DOKU_START_TIME', delta_time());
 
 global $config_cascade;
-$config_cascade = '';
+$config_cascade = array();
 
 // if available load a preload config file
 $preload = fullpath(dirname(__FILE__)).'/preload.php';
@@ -52,10 +52,9 @@
 global $cache_metadata;
        $cache_metadata = array();
 
-//set the configuration cascade - but only if its not already been set in 
preload.php
-if (empty($config_cascade)) {
-    include(DOKU_INC.'inc/config_cascade.php');
-}
+// Always include 'inc/config_cascade.php'
+// previously set fields of  $config_cascade will be merged with with the 
defaults
+include(DOKU_INC.'inc/config_cascade.php');
 
 //prepare config array()
 global $conf;

Other related posts: