- Timestamp:
- 29 Jun 2012, 17:28:06 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r8742 r8853 1083 1083 # Send email with credentials 1084 1084 login_url = self.url(grok.getSite(), 'login') 1085 url_info = u'Login: %s' % login_url 1085 1086 msg = _('You have successfully been registered for the') 1086 1087 if kofa_utils.sendCredentials(IUserAccount(applicant), 1087 password, login_url, msg):1088 password, url_info, msg): 1088 1089 email_sent = applicant.email 1089 1090 else: -
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r8783 r8853 2129 2129 msg = _('You have successfully changed your password for the') 2130 2130 login_url = self.url(grok.getSite(), 'login') 2131 url_info = u'Login: %s' % login_url 2131 2132 success = kofa_utils.sendCredentials( 2132 IUserAccount(user),pwd, login_url,msg)2133 IUserAccount(user),pwd,url_info,msg) 2133 2134 if success: 2134 2135 self.flash(_('An email with your user name and password ' + -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/loginpage.pt
r8777 r8853 37 37 If you are having trouble logging in, make sure to enable cookies in your web browser. 38 38 </p> 39 <p i18n:translate="login_trouble2" >39 <p i18n:translate="login_trouble2" tal:condition="python:False"> 40 40 You don't have an account because you are a fresh student, or your student record has just been created? 41 Acquire a Password Access Code (PWD) and inititialize your student account 42 <strong><a href ="setpassword"> here</a></strong>. 41 Acquire a Password Activation Code (PWD) and inititialize your student account 42 <strong><a href ="setpassword"> here</a></strong>. 43 </p> 44 <p i18n:translate="login_trouble4"> 45 You don't have an account because you are a fresh student, or your student record has just been created? 46 Inititialize your student account <strong><a href="requestpw"> here</a></strong>. 43 47 </p> 44 48 <p i18n:translate="login_trouble3"> Or simply forgot your student id, application id or password? Then request a new password -
main/waeup.kofa/trunk/src/waeup/kofa/interfaces.py
r8759 r8853 234 234 """ 235 235 236 def sendCredentials(user, password, login_url, msg):236 def sendCredentials(user, password, url_info, msg): 237 237 """Send credentials as email. 238 238 -
main/waeup.kofa/trunk/src/waeup/kofa/mandates/mandate.py
r8849 r8853 68 68 msg = _('Mandate expired.') 69 69 if self._setStudentPassword(): 70 msg = _('Password has been successfully set.') 70 msg = _('Password has been successfully set. ' 71 'Proceed to the login page and enter your credentials.') 71 72 del self.__parent__[self.mandate_id] 72 73 return msg -
main/waeup.kofa/trunk/src/waeup/kofa/mandates/tests.py
r8850 r8853 104 104 msg = mandate.execute() 105 105 # Password has been set. 106 self.assertEqual(msg, u'Password has been successfully set.') 106 self.assertEqual(msg, 'Password has been successfully set. Proceed to ' 107 'the login page and enter your credentials.') 107 108 self.assertTrue(IUserAccount(student).checkPassword('mypwd1')) 108 109 # All mandates have been removed. … … 132 133 % mandate.mandate_id) 133 134 # Password has been set. 134 self.assertTrue('Password has been successfully set.' 135 self.assertTrue('Password has been successfully set. Proceed to ' 136 'the login page and enter your credentials.' 135 137 in self.browser.contents) 136 138 self.assertTrue(IUserAccount(student).checkPassword('mypwd1')) -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r8780 r8853 64 64 from waeup.kofa.hostels.hostel import NOT_OCCUPIED 65 65 from waeup.kofa.utils.helpers import get_current_principal, to_timezone 66 from waeup.kofa.mandates.mandate import StudentPasswordMandate 66 67 67 68 grok.context(IKofaObject) # Make IKofaObject the default context … … 1983 1984 kofa_utils = getUtility(IKofaUtils) 1984 1985 password = kofa_utils.genPassword() 1985 IUserAccount(student).setPassword(password) 1986 mandate = StudentPasswordMandate() 1987 mandate.params['password'] = password 1988 mandate.params['student_id'] = student.student_id 1989 site = grok.getSite() 1990 site['mandates'].addMandate(mandate) 1986 1991 # Send email with credentials 1987 login_url = self.url(grok.getSite(), 'login') 1992 args = {'mandate_id':mandate.mandate_id} 1993 mandate_url = self.url(site) + '/mandate?%s' % urlencode(args) 1994 url_info = u'Confirmation link: %s' % mandate_url 1988 1995 msg = _('You have successfully requested a password for the') 1989 1996 if kofa_utils.sendCredentials(IUserAccount(student), 1990 password, login_url, msg):1997 password, url_info, msg): 1991 1998 email_sent = student.email 1992 1999 else: -
main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
r8603 r8853 192 192 193 193 194 def sendCredentials(self, user, password=None, login_url=None, msg=None):194 def sendCredentials(self, user, password=None, url_info=None, msg=None): 195 195 """Send credentials as email. 196 196 … … 209 209 Your user name: ${d} 210 210 Your password: ${e} 211 Login page:${f}211 ${f} 212 212 213 213 Please remember your user name and keep … … 230 230 'd':user.name, 231 231 'e':password, 232 'f': login_url})232 'f':url_info}) 233 233 234 234 body = translate(text, 'waeup.kofa',
Note: See TracChangeset for help on using the changeset viewer.