Question
I need to dispatch users into specific groups automatically when they register.
Is there any pluging or patch doing that?
Environment
--
MohamedSghir - 03 Apr 2006
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
I have never seen one. But what you want to do could easily be done by a script on the server that maintains the groups.
--
CrawfordCurrie - 05 Apr 2006
The feature I really want to add is:
As soon as a new user, whose email respects a specific regexp, registers, it's automatically added to his group as shown below.
--
xxxx@group1PLEASENOSPAM.zz -> group1
--
yyyy@group2PLEASENOSPAM.zz -> group2
So, I need to know which script in the server is adding users to groups in order to pick up the required variables and use them to make my feature works.
thanks in advance
--
MohamedSghir - 05 Apr 2006
As far as I recall there is
NO script that adds users to groups - its normally done manually.
That being said, in Dakar/TWiki-4.0 the registration code in
TWiki::UI::Register.pm has places one
could insert call-outs to perform such things at registration time. Look at the subroutine
_finish(). (The sad thing about this is that it isn't atomic.)
You could either insert a call somewhere in
_finish() or in
_newUserFromRemplate().
The other way to do it is to write a custom plugin. There is a call in
_finish() to the plugin registration handler. (Sadly it doen't convey all of the data!) If you read the example code in
TWiki::Plugins::EmptyPlugin::registrationHandler() you can see what is possible. As I say, not enough information is hadned down for this to make sensible decisions based on the contnets of the registration form. Exmples of this in 'real life; are in the
AddDBMPlugin and the
FakeBasicAuthRegPlugin. But the best example I can think of, if my memory serves, is actually in the original Cairo code for
NatSkinPlugin.
--
AntonAylward - 05 Apr 2006
Has any progress been made on this? It's exactly the sort of thing that I want to do!
Cheers in advance
--
ChrisCauser - 07 Dec 2007
Yes! there has been progress made - I wrote some code for it just last week. I'll post the patch when I get back to work.
--
SvenDowideit - 08 Dec 2007
see
AddUserToGroupsOnRegistration for the 4.1.2 patch.
--
SvenDowideit - 10 Dec 2007