[Moin-user] Fun with user_autocreate

Daryl Tester Daryl.Tester at iocane.com.au
Fri Feb 24 14:49:02 EST 2006

Thomas Waldmann wrote:

>> Currently I'm using moin-1.5.1,

> For development it is best to use a current version, that means at least 
> the latest release, better a tla checkout.

At the time I wasn't aware of a later release having come out since
I started the project.  I've started working against the 1.5.2
release but couldn't find any development snapshots/tarballs (and
at the moment I'm really reluctant to learn Yet-Another-Revisioning
system on top of CVS, Subversion and OpenCM).

>> and I'm modifying it to support
>> HTTP authentication via LDAP (specifically, Active Directory)

> auth against AD / LDAP is already done in recent patchlevels.

Is it doing HTTP authentication?  I'm setting this up in an
"Enterprise" type scenario where all users must be authenticated,
(and therefore will have AD credentials).

>> The bit that's not working for me is that I
>> have "user_autocreate = True" set in the config, but by the
>> time User's create_or_update() method has been called,
>> user_autocreate is false.

> That sounds strange. X)
> Checked for typos? Maybe you assigned it twice in your configs?

No, I'd stepped through it with the debugger - it is definitely
assigned when server.standalone.run() is called, but I've since
discovered that it's not the same instance that's passed to
the request (see my follow up posting for details).

>> I guess this is where my confusion
>> kicks in; the cfg attribute in RequestStandAlone/RequestBase
>> (which in turn is passed to User()) is coming from multiconfig.

> MoinMoin/multiconfig.py just has the defaults (and some code to load 
> configs). Never change stuff there, only change YOUR farmconfig.py or 
> wikiconfig.py.

Sorry, my point here (has become) that it wasn't the same config
as passed in via moin.py, and I was chasing it to find out why.
This may have been a bad assumption on my part, but I couldn't
find anything that said the config in wikiconfig was treated
differently than the one in moin.py, and so I'd been making most
of my config changes to moin.py (except by happy chance I'd made
my initial auth changes to wikiconfig.py, which is why that part
worked OK).  My assumption was partly fueled by the fact that
they both (umtimately) derive from the same base class
(DefaultConfig) and implement the same class name (Config), so
I thought they served the same purpose (for which I was wrong).
Could a large note be added above moin.py's Config that states
"This is not the same as wikiconfig's Config, you dunderhead"
for people like me?  It's only going to affect those that run

> If you are doing your own auth method, you of course have to have the 
> usual few code lines at the end of your auth method calling the 
> create_or_update method, see those other auth methods.

Yes, that's where the problem was occurring.

>> Any help to unbend my head would be greatly appreciated.

> Join us on IRC #moin channel.

I did that - installed an IRC client just for the purpose
(since I don't use IRC).  No joy there.

I'm also trying to get work approval (seeing they're funding
this) to release the code back to the project.  If they
don't approve, I'll attempt to reimplement this code during
my upcoming holidays and contribute that instead.

  Daryl Tester, IOCANE Pty. Ltd.

More information about the Moin-user mailing list