- Timestamp:
- 28 Nov 2011, 21:42:28 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/authentication.py
r7229 r7234 245 245 return None 246 246 247 def getAccount(self, login):248 return None249 250 247 class ApplicantsAuthUtility(grok.GlobalUtility): 251 248 """A global utility that sets up any PAU passed. -
main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt
r7233 r7234 45 45 >>> print browser.contents 46 46 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 47 ... >Required input is missing...47 ...Required input is missing... 48 48 ... 49 49 … … 187 187 ... 188 188 189 We fill the form and try to send message to contact@waeup.org):: 189 We fill the form (this will send a real message to 190 contact@waeup.org):: 190 191 191 192 >>> browser.open('http://localhost/myuniversity/contactadmin') … … 194 195 >>> print browser.contents 195 196 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 196 ...<li class="message">You don't have a user account.</li> 197 ... 198 199 We can't send messages without a user account. 197 ...<li class="message">Your message has been sent.</li> 198 ... 199 200 If this test fails, chances are, that the local machine has no SMTP 201 server installed. 202 200 203 201 204 -
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r7233 r7234 216 216 @grok.action('Send message now') 217 217 def send(self, *args, **data): 218 useraccount = self.get_user_account 219 if useraccount is None: 220 self.flash("You don't have a user account.") 221 return 222 fullname = useraccount.title 223 email_from = useraccount.email 224 username = useraccount.name 218 fullname = self.request.principal.title 219 try: 220 email_from = self.request.principal.email 221 except AttributeError: 222 email_from = self.config.email_admin 223 username = self.request.principal.id 225 224 body = data['body'] 226 225 email_to = self.config.email_admin … … 462 461 @grok.action('Send message now') 463 462 def send(self, *args, **data): 464 useraccount = self.get_user_account 465 if useraccount is None: 466 self.flash("You don't have a user account.") 467 return 468 fullname = useraccount.title 469 email_from = useraccount.email 470 username = useraccount.name 463 fullname = self.request.principal.title 464 try: 465 email_from = self.request.principal.email 466 except AttributeError: 467 email_from = self.config.email_admin 468 username = self.request.principal.id 471 469 body = data['body'] 472 470 email_to = self.context.email -
main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
r7230 r7234 375 375 @grok.action('Send message now') 376 376 def send(self, *args, **data): 377 useraccount = self.get_user_account 378 if useraccount is None: 379 self.flash("You don't have a user account.") 380 return 381 fullname = useraccount.title 382 email_from = useraccount.email 383 username = useraccount.name 377 fullname = self.request.principal.title 378 try: 379 email_from = self.request.principal.email 380 except AttributeError: 381 email_from = self.config.email_admin 382 username = self.request.principal.id 384 383 body = data['body'] 385 384 #subject = u'Mail from SIRP' -
main/waeup.sirp/trunk/src/waeup/sirp/utils/helpers.py
r7229 r7234 477 477 """ 478 478 principal_id = request.principal.id 479 authenticators = getUtilitiesFor(IAuthenticatorPlugin) 480 for authenticator in authenticators: 481 account = authenticator[1].getAccount(principal_id) 482 if account: 483 break 479 authenticator = getUtility(IAuthenticatorPlugin, name='users') 480 account = authenticator.getAccount(principal_id) 484 481 return account 485 482
Note: See TracChangeset for help on using the changeset viewer.