Send WikiName to Plugin registrationHandler
Cloyce is a big moron -- he didn't notice that $wikiName was already the second parameter. (Actually, he thought it was the name of the Main web, which seems to get passed around a lot, so he just didn't check.) So you can just ignore the rest of this (except for
AddDBMFileHandling, which isn't moronic and is needed).
I'd like to propose a small change to the Plugin API. Currently the registrationHandler callback gets the loginName of a newly registered user. In all of the tests that I've performed, this value is empty.
What I'd like to do is to make the new user's
WikiName also available to the registrationHandler. This involves a simple one-line change to bin/register (I'll attach the patch, too):
--- TWiki.orig/bin/register Sat May 29 02:51:36 2004
+++ twiki/bin/register Sun Jan 2 13:59:34 2005
@@ -207,3 +207,3 @@
# Plugin callback to set cookies. Contrib by SvenDowideit
- &TWiki::Plugins::registrationHandler( $webName, $wikiName, $remoteUser );
+ &TWiki::Plugins::registrationHandler( $webName, $wikiName, $remoteUser, $wikiName );
This shouldn't affect the operation of any existing plugins that use registrationHandler, though I suppose there's a small chance that it might expose bugs in some.
I want to do this because the registrationHandler can be useful for much more than just setting cookies. In my case, we do access control based on DBM files (see
AddDBMFileHandling for more on that). Everyone who visits the site must authenticate to view content (and not just for the wiki). So for view I just require a valid user ID/password, but for edit and most other things, I require that they be in a particular group.
I've written a plugin to automatically add newly registered users to this group, but it won't work unless this change goes in. I'll probably post it anyway, but with big warnings about how it doesn't work.
What do you thinks, sirs?
--
CloyceSpradling - 02 Jan 2005
Hi Cloyce,
Please can you check how your changes will fit against the
DevelopBranch? Since the
RegisterCgiScriptRewrite, the registration system is quite different there and it will minimise your rework if you at least understand the differences before proceding.
That said, apart from the imminent naming change (to e.g.
AuthenticationHandler), I support your change.
Also, the setting of cookies is to do with remembering authentication details - thus it belong principally with login
not registration. I posit that the handler is to date misused and I will be pushing for this handler name to be deprecated in Dakar.
--
MartinCleaver - 02 Jan 2005
The change against
DevelopBranch would be very similar, and is similiarly not needed.

Sorry for wasting the collective's time...
--
CloyceSpradling - 02 Jan 2005

as you can see, Cloyce, you didn't waste too much of my time... I didn't really read your point about parameters, I only really commented because I wanted to make the point about the name of the
RegistrationHandler being wrong.
--
MartinCleaver - 02 Jan 2005