Submitted By: Mario Fetka (mario dot fetka at gmail dot com)
Date: 2009-03-15
Initial Package Version: 0.2.1
Origin: http://trac-hacks.org/wiki/RegistrationConfirmationPatch
Upstream Status: unknown
Description: This is a patch for AccountManagerPlugin that adds an
IRegistrationConfirmation extension point that enables pluggable
verifications for new user registration.
diff -Naur trac-acct_mgr-0.2.1.orig/acct_mgr/api.py trac-acct_mgr-0.2.1/acct_mgr/api.py
--- trac-acct_mgr-0.2.1.orig/acct_mgr/api.py 2009-03-15 06:40:44.875670135 +0000
+++ trac-acct_mgr-0.2.1/acct_mgr/api.py 2009-03-15 06:41:38.225188601 +0000
@@ -77,6 +77,19 @@
"""User deleted
"""
+class IRegistrationConfirmation(Interface):
+ """An interface for receiving notification before and after the new user
+ registration form has been submitted.
+ """
+
+ def pre_registration(self, req):
+ """Returns the markup to be added to the registration form
+ """
+
+ def verify_registration(self, req):
+ """Returns an error message if confirmation fails, or None on success
+ """
+
class AccountManager(Component):
"""The AccountManager component handles all user account management methods
provided by the IPasswordStore interface.
diff -Naur trac-acct_mgr-0.2.1.orig/acct_mgr/templates/register.html trac-acct_mgr-0.2.1/acct_mgr/templates/register.html
--- trac-acct_mgr-0.2.1.orig/acct_mgr/templates/register.html 2009-03-15 06:40:44.873359012 +0000
+++ trac-acct_mgr-0.2.1/acct_mgr/templates/register.html 2009-03-15 06:41:38.227503636 +0000
@@ -43,6 +43,11 @@
class="textwidget" size="20" />
+