Changeset 8858 for main/waeup.kofa/trunk/src/waeup/kofa/browser
- Timestamp:
- 30 Jun 2012, 07:39:07 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r8857 r8858 26 26 import time 27 27 import re 28 from urllib import urlencode 28 29 from zope import schema 29 30 from zope.authentication.interfaces import ( … … 67 68 from waeup.kofa.authentication import get_principal_role_manager 68 69 from waeup.kofa.utils.helpers import get_user_account, msave 70 from waeup.kofa.mandates.mandate import PasswordMandate 69 71 70 72 grok.context(IKofaObject) … … 2124 2126 # Change password 2125 2127 kofa_utils = getUtility(IKofaUtils) 2126 pwd = kofa_utils.genPassword() 2127 2128 ###: To be changed 2129 IUserAccount(user).setPassword(pwd) 2130 2131 2132 # Send email with new credentials 2133 msg = _('You have successfully changed your password for the') 2134 login_url = self.url(grok.getSite(), 'login') 2135 url_info = u'Login: %s' % login_url 2128 password = kofa_utils.genPassword() 2129 mandate = PasswordMandate() 2130 mandate.params['password'] = password 2131 mandate.params['user'] = user 2132 site = grok.getSite() 2133 site['mandates'].addMandate(mandate) 2134 # Send email with credentials 2135 args = {'mandate_id':mandate.mandate_id} 2136 mandate_url = self.url(site) + '/mandate?%s' % urlencode(args) 2137 url_info = u'Confirmation link: %s' % mandate_url 2138 msg = _('You have successfully requested a password for the') 2136 2139 success = kofa_utils.sendCredentials( 2137 IUserAccount(user),p wd,url_info,msg)2140 IUserAccount(user),password,url_info,msg) 2138 2141 if success: 2139 2142 self.flash(_('An email with your user name and password ' +
Note: See TracChangeset for help on using the changeset viewer.