[Seaside] Sending a continuation link via email in Seaside-3.0
Yanni Chiu
yanni at rogers.com
Mon Oct 18 03:58:40 UTC 2010
I'm trying to adapt the "Forgot password" functionality from
SqueakSource for other uses. If you filein the included code, into a
recent Seaside-3.0 image, and go to http://localhost:8080/register,
you'll be shown a dialog, and then a link.
This link would ultimately be sent by email, but for the test cose, it's
just shown to you in the web browser. Copy & paste the link to another
another web browser window. The new web browser waits for a response,
and eventually times out.
Any one have any ideas what's wrong?
-------------- next part --------------
WAComponent subclass: #ZZRegistration
instanceVariableNames: 'email'
classVariableNames: ''
poolDictionaries: ''
category: 'ZZTemp'!
!ZZRegistration methodsFor: 'accessing' stamp: 'YanniChiu 10/17/2010 23:05'!
email
^ email! !
!ZZRegistration methodsFor: 'accessing' stamp: 'YanniChiu 10/17/2010 23:05'!
email: anObject
email := anObject! !
!ZZRegistration methodsFor: 'actions' stamp: 'YanniChiu 10/17/2010 23:17'!
register
self call: (ZZSendRegistrationLink new email: self email)! !
!ZZRegistration methodsFor: 'rendering' stamp: 'YanniChiu 10/17/2010 23:05'!
renderContentOn: html
self renderFormOn: html! !
!ZZRegistration methodsFor: 'rendering' stamp: 'YanniChiu 10/17/2010 23:05'!
renderFormOn: html
html form class: 'registration-form'; with: [
html span: 'Email: '.
html textInput
value: self email;
callback: [ :value | self email: value ].
html break.
html submitButton callback: [ self register ]; with: 'Register' ]! !
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
ZZRegistration class
instanceVariableNames: ''!
!ZZRegistration class methodsFor: 'accessing' stamp: 'YanniChiu 10/17/2010 23:05'!
label
^ 'Registration'! !
!ZZRegistration class methodsFor: 'initialize' stamp: 'YanniChiu 10/17/2010 23:06'!
initialize
WAAdmin register: self asApplicationAt: 'register'! !
!ZZRegistration class methodsFor: 'testing' stamp: 'YanniChiu 10/17/2010 23:05'!
isAbstract
^ false! !
WAComponent subclass: #ZZSendRegistrationLink
instanceVariableNames: 'email'
classVariableNames: ''
poolDictionaries: ''
category: 'ZZTemp'!
!ZZSendRegistrationLink methodsFor: 'accessing' stamp: 'YanniChiu 10/17/2010 23:07'!
email
^ email! !
!ZZSendRegistrationLink methodsFor: 'accessing' stamp: 'YanniChiu 10/17/2010 23:07'!
email: anObject
email := anObject! !
!ZZSendRegistrationLink methodsFor: 'actions' stamp: 'YanniChiu 10/17/2010 23:13'!
cancel
self answer: nil.! !
!ZZSendRegistrationLink methodsFor: 'actions' stamp: 'YanniChiu 10/17/2010 23:15'!
send
| url |
WAContinuation currentDo: [ :cc |
url := 'http://localhost:8080', (self session actionUrlForContinuation: cc) greaseString.
self inform: 'Use this url to continue registration process: ', url.
self answer ].
self inform: 'Continuing registration process...'.
self answer! !
!ZZSendRegistrationLink methodsFor: 'rendering' stamp: 'YanniChiu 10/17/2010 23:12'!
renderContentOn: html
html heading: 'I forgot my password'.
html render: 'You will get an e-mail with a secure url that takes you to your personal member-settings where you are able to set a new password. The url will be available for a few minutes only, so check your e-mail soon.'.
html break; break.
html form
defaultAction: [ self send ];
with: [
html div: [
html submitButton
callback: [ self send ];
text: 'Send'.
html space.
html submitButton
callback: [ self cancel ];
text: 'Cancel' ] ]! !
ZZRegistration initialize!
More information about the seaside
mailing list