-
Website
http://twofishcreative.com/michael/blog -
Original page
http://twofishcreative.com/michael/blog/2009/03/06/registration-plugin-for-habari -
Subscribe
All Comments -
Community
-
Top Commenters
-
michaeltwofish
61 comments · 12 points
-
Andy C
33 comments · 48 points
-
Ali B.
9 comments · 1 points
-
ringmaster
6 comments · 1 points
-
h0bbel
5 comments · 1 points
-
-
Popular Threads
-
More swimming. Give me money. - echo "hey, it works" > /dev/null
3 weeks ago · 4 comments
-
More swimming. Give me money. - echo "hey, it works" > /dev/null
OK - I admit it - ACL was a good idea . Without it, this would have been non-trivial, I suspect :-)
Thanks for the plugin and for taking the time to write it up.
One thing you might consider is that the FormUI object you create and pass around is the actual original FormUI object, and the full instance is passed to register_user() (your on_success() callback function) when the form succeeds at submission. If you set options on the form when you create it, you should be able to recall them from your success callback, since that's the same form object. For example, setting the group into the object in the get_form() method:
$form->set_option('my_group', $group);
And then calling it back out from inside the register_user() on_success method:
$group = $form->get_option('my_group');
No encryption required, no hacker tampering possible, because it all passes behind the curtain.
I can also see this easily having an option added to let you select the group that a user would be added to by default if the group parameter was omitted from the call to $theme->registration(). It would be pretty trivial to add.
The other thing I'd like to do is have plugin hooks for the form construction and saving, so that other plugins can alter the form, adding other fields etc.
Of course, the plugin is in -extras, so if anyone feels like making those changes, feel free :)