update patch
git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/linamh@873 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
parent
68e5304cca
commit
9417763d39
@ -1,4 +1,4 @@
|
|||||||
AUX RegistrationConfirmationPatch.diff 4615 RMD160 06d9aa3e7e0440ff6494a910a3e066f546161b77 SHA1 73abf363a623ffb82907f1b8eaab73a8b8ae12ad SHA256 0552049c1e0ac445d6620bd4875be9fddc62dabfb6d4ac46353f24036e21a530
|
AUX RegistrationConfirmationPatch.diff 4067 RMD160 c32d63d9ef9c533c306d7b6c76bc4cf6424bc715 SHA1 39b13622b3a58c9800c1cf89e8aad24e4f8fed96 SHA256 c328b0f23a2baf8314e201be1c42aca2c2267c10d56a7ca71a63250a44af690f
|
||||||
EBUILD trac-acct_mgr-0.1.3.ebuild 1214 RMD160 08c61116b34731a9204414a8801df2ed49327e61 SHA1 366ed27ec819f45a352573b3029ad79d84ece486 SHA256 dbcaa0bbb198ee2c4bb8d354dce62faabe36c823bfda827daf16fb87ec2c9b2c
|
EBUILD trac-acct_mgr-0.1.3.ebuild 1214 RMD160 08c61116b34731a9204414a8801df2ed49327e61 SHA1 366ed27ec819f45a352573b3029ad79d84ece486 SHA256 dbcaa0bbb198ee2c4bb8d354dce62faabe36c823bfda827daf16fb87ec2c9b2c
|
||||||
EBUILD trac-acct_mgr-0.2.1.ebuild 1452 RMD160 68f332836dd6f90301280babd27349a34b929f1c SHA1 7dfea05925fd88cf661a866281dcb05575c41afa SHA256 a9bfbde6a13df29c28af2eb09dcc2b528ef4281380951e9dd5a191535edc1f8f
|
EBUILD trac-acct_mgr-0.2.1.ebuild 1452 RMD160 68f332836dd6f90301280babd27349a34b929f1c SHA1 7dfea05925fd88cf661a866281dcb05575c41afa SHA256 a9bfbde6a13df29c28af2eb09dcc2b528ef4281380951e9dd5a191535edc1f8f
|
||||||
MISC ChangeLog 792 RMD160 789c44d0277047faf0131f7e7d6bc450e6d08eeb SHA1 4de822506b6f0e779bec655c9d4ebe830e014a5d SHA256 e8b0a9b2dd0060c63ada86c20d275b213b49b283d0e3d71ab0b44cdd3e8e097b
|
MISC ChangeLog 792 RMD160 789c44d0277047faf0131f7e7d6bc450e6d08eeb SHA1 4de822506b6f0e779bec655c9d4ebe830e014a5d SHA256 e8b0a9b2dd0060c63ada86c20d275b213b49b283d0e3d71ab0b44cdd3e8e097b
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
Submitted By: Mario Fetka (mario dot fetka at gmail dot com)
|
Submitted By: Mario Fetka (mario dot fetka at gmail dot com)
|
||||||
Date: 2009-02-18
|
Date: 2009-03-15
|
||||||
Initial Package Version: unknown
|
Initial Package Version: 0.2.1
|
||||||
Origin: http://trac-hacks.org/wiki/RegistrationConfirmationPatch
|
Origin: http://trac-hacks.org/wiki/RegistrationConfirmationPatch
|
||||||
Upstream Status: unknown
|
Upstream Status: unknown
|
||||||
Description: This is a patch for AccountManagerPlugin that adds an
|
Description: This is a patch for AccountManagerPlugin that adds an
|
||||||
IRegistrationConfirmation extension point that enables pluggable
|
IRegistrationConfirmation extension point that enables pluggable
|
||||||
verifications for new user registration.
|
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
|
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-02-18 09:10:33.000000000 +0000
|
--- 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-02-18 09:42:33.254276668 +0000
|
+++ trac-acct_mgr-0.2.1/acct_mgr/api.py 2009-03-15 06:41:38.225188601 +0000
|
||||||
@@ -77,6 +77,19 @@
|
@@ -77,6 +77,19 @@
|
||||||
"""User deleted
|
"""User deleted
|
||||||
"""
|
"""
|
||||||
@ -31,8 +31,8 @@ diff -Naur trac-acct_mgr-0.2.1.orig/acct_mgr/api.py trac-acct_mgr-0.2.1/acct_mgr
|
|||||||
"""The AccountManager component handles all user account management methods
|
"""The AccountManager component handles all user account management methods
|
||||||
provided by the IPasswordStore interface.
|
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
|
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-02-18 09:10:33.000000000 +0000
|
--- 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-02-18 09:42:33.256586814 +0000
|
+++ trac-acct_mgr-0.2.1/acct_mgr/templates/register.html 2009-03-15 06:41:38.227503636 +0000
|
||||||
@@ -43,6 +43,11 @@
|
@@ -43,6 +43,11 @@
|
||||||
class="textwidget" size="20" />
|
class="textwidget" size="20" />
|
||||||
</label>
|
</label>
|
||||||
@ -46,30 +46,13 @@ diff -Naur trac-acct_mgr-0.2.1.orig/acct_mgr/templates/register.html trac-acct_m
|
|||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Optional</legend>
|
<legend>Optional</legend>
|
||||||
diff -Naur trac-acct_mgr-0.2.1.orig/acct_mgr/web_ui.py trac-acct_mgr-0.2.1/acct_mgr/web_ui.py
|
diff -Naur trac-acct_mgr-0.2.1.orig/acct_mgr/web_ui.py trac-acct_mgr-0.2.1/acct_mgr/web_ui.py
|
||||||
--- trac-acct_mgr-0.2.1.orig/acct_mgr/web_ui.py 2009-02-18 09:10:33.000000000 +0000
|
--- trac-acct_mgr-0.2.1.orig/acct_mgr/web_ui.py 2009-03-15 06:40:44.875670135 +0000
|
||||||
+++ trac-acct_mgr-0.2.1/acct_mgr/web_ui.py 2009-02-18 09:45:45.904094348 +0000
|
+++ trac-acct_mgr-0.2.1/acct_mgr/web_ui.py 2009-03-15 06:59:06.581876742 +0000
|
||||||
@@ -27,6 +27,7 @@
|
@@ -394,19 +394,28 @@
|
||||||
from genshi.builder import tag
|
|
||||||
|
|
||||||
from api import AccountManager
|
|
||||||
+from api import IRegistrationConfirmation
|
|
||||||
from acct_mgr.util import urandom
|
|
||||||
|
|
||||||
def _create_user(req, env, check_permissions=True):
|
|
||||||
@@ -351,6 +352,8 @@
|
|
||||||
|
|
||||||
implements(INavigationContributor, IRequestHandler, ITemplateProvider)
|
|
||||||
|
|
||||||
+ listeners = ExtensionPoint(IRegistrationConfirmation)
|
|
||||||
+
|
|
||||||
def __init__(self):
|
|
||||||
self._enable_check(log=True)
|
|
||||||
|
|
||||||
@@ -394,26 +397,42 @@
|
|
||||||
'name' : None,
|
'name' : None,
|
||||||
'email' : None,
|
'email' : None,
|
||||||
},
|
},
|
||||||
+ 'extra_required_content' : self._get_extra_content(req)
|
+ 'extra_required_content' : self._get_extra_content(req),
|
||||||
}
|
}
|
||||||
+ error = None
|
+ error = None
|
||||||
if req.method == 'POST' and action == 'create':
|
if req.method == 'POST' and action == 'create':
|
||||||
@ -77,50 +60,46 @@ diff -Naur trac-acct_mgr-0.2.1.orig/acct_mgr/web_ui.py trac-acct_mgr-0.2.1/acct_
|
|||||||
- _create_user(req, self.env)
|
- _create_user(req, self.env)
|
||||||
- except TracError, e:
|
- except TracError, e:
|
||||||
- data['registration_error'] = e.message
|
- data['registration_error'] = e.message
|
||||||
|
- formdata = getattr(e, 'acctmgr', None)
|
||||||
|
- if formdata:
|
||||||
|
- data['acctmgr'] = formdata
|
||||||
|
- else:
|
||||||
|
- raise e
|
||||||
|
- else:
|
||||||
|
- req.redirect(req.href.login())
|
||||||
+ for listener in self.listeners:
|
+ for listener in self.listeners:
|
||||||
+ error = listener.verify_registration(req)
|
+ error = listener.verify_registration(req)
|
||||||
+ if error is not None:
|
+ if error is not None:
|
||||||
+ break
|
+ break
|
||||||
+ data['registration_error'] = error
|
+ data['registration_error'] = error
|
||||||
+ if error is None:
|
+ if error is None:
|
||||||
+ try:
|
+ try:
|
||||||
+ _create_user(req, self.env)
|
+ _create_user(req, self.env)
|
||||||
+ except TracError, e:
|
+ except TracError, e:
|
||||||
+ data['registration_error'] = e.message
|
+ data['registration_error'] = e.message
|
||||||
formdata = getattr(e, 'acctmgr', None)
|
+ formdata = getattr(e, 'acctmgr', None)
|
||||||
if formdata:
|
+ if formdata:
|
||||||
data['acctmgr'] = formdata
|
+ data['acctmgr'] = formdata
|
||||||
else:
|
+ else:
|
||||||
raise e
|
+ raise e
|
||||||
- else:
|
+ else:
|
||||||
- req.redirect(req.href.login())
|
+ req.redirect(req.href.login())
|
||||||
+ else:
|
|
||||||
+ req.redirect(req.href.login())
|
|
||||||
+
|
+
|
||||||
data['reset_password_enabled'] = \
|
data['reset_password_enabled'] = \
|
||||||
(self.env.is_component_enabled(AccountModule)
|
(self.env.is_component_enabled(AccountModule)
|
||||||
and NotificationSystem(self.env).smtp_enabled)
|
and NotificationSystem(self.env).smtp_enabled)
|
||||||
|
@@ -414,6 +423,14 @@
|
||||||
return 'register.html', data, None
|
return 'register.html', data, None
|
||||||
|
|
||||||
-
|
|
||||||
+ def _get_extra_content(self, req):
|
+ def _get_extra_content(self, req):
|
||||||
+ ret = ""
|
+ ret = ""
|
||||||
+ for listener in self.listeners:
|
+ for listener in self.listeners:
|
||||||
+ response = listener.pre_registration(req)
|
+ response = listener.pre_registration(req)
|
||||||
+ if response is not None:
|
+ if response is not None:
|
||||||
+ ret += response
|
+ ret += response
|
||||||
+ return ret
|
+ return ret
|
||||||
+
|
+
|
||||||
# ITemplateProvider
|
# ITemplateProvider
|
||||||
|
|
||||||
def get_htdocs_dirs(self):
|
def get_htdocs_dirs(self):
|
||||||
@@ -427,7 +446,7 @@
|
|
||||||
ClearSilver templates.
|
|
||||||
"""
|
|
||||||
from pkg_resources import resource_filename
|
|
||||||
- return [resource_filename(__name__, 'templates')]
|
|
||||||
+ return [resource_filename(__name__, 'templates')]
|
|
||||||
|
|
||||||
|
|
||||||
def if_enabled(func):
|
|
||||||
|
Loading…
Reference in New Issue
Block a user