[pmwiki-users] passwords and farms

H. Fox haganfox at users.sourceforge.net
Fri Nov 17 12:16:18 CST 2006


On 11/17/06, Sandy <sandy at onebit.ca> wrote:
> H. Fox wrote:
> > On 11/16/06, Sandy <sandy at onebit.ca> wrote:
> >> I now have a multi-field farm. (Yay!!!) Most of the fields will be CMS
> >> use rather than wiki -- one admin, few writers, lots of readers.
>
> > As you suspect, it's because this line
> >
> >          include_once("$FarmD/scripts/authuser.php");
> >
> > needs to come *after* the lines you put in config.php.
> >
> > One approach (that I haven't tried) is to make these the last two
> > lines of your farmconfig.php file:
> >
> >          include_once("local/config.php");
> >          include_once("$FarmD/scripts/authuser.php");
> >
> > Another approach is just to move the line out of farmconfig.php and
> > into each wiki's config.php.
> >
> > Hagan
>
> Method 1, moving it all to the local field worked.

That would be method three.  Method one was including config.php from
farmconfig.php.

> Sorta was hoping I
> could do the admin password from the farm,

You can do the admin password in farmconfig.php.  Just make sure to
include authuser.php after all lines relating to passwords.  Put
another way, you don't need to move it all to config.php, just the one
line that includes authuser.php.

> Method 2 makes me nervous. In the core program, there might be something
>   called between farmconfig.php and local/config.php that this method
> misses. I do like the PHP include_once function.

Nothing is called in between.  From pmwiki.php:

   if (file_exists("$FarmD/local/farmconfig.php"))
     include_once("$FarmD/local/farmconfig.php");
   if (IsEnabled($EnableLocalConfig,1)) {
     if (file_exists("$LocalDir/config.php"))
       include_once("$LocalDir/config.php");
     elseif (file_exists('config.php'))
       include_once('config.php');
   }

FWIW I thing there's a method four, too; and it may be the best one.
Use these two lines in farmconfig.php

   $AuthUser['Admin'] = '...crypted_password...';
   include_once("$FarmD/scripts/authuser.php");

then don't put any passwords in config.php and use Site.AuthUser for
local passwords instead.

Hagan




More information about the pmwiki-users mailing list