[Seaside] Login process
michael.gorsuch at gmail.com
Sun Jun 17 12:55:50 UTC 2007
> Can someone give me a hint how create a login process for a site ?
> Login process have :
> - New user registration.
> - Old user login.
I have been building my sites with a subclass of WATask as the root
component. I implement the workflow in it's 'go' method.
The first task in my workflow is to build a new Welcome component
(subclass of WAComponent) and #call it.
The Welcome component has two child components that it displays during
#renderContentOn. One child is the registration form, the other is
the login form. When these components were initialized, I defined
onAnswer for each one, so that when they #answer, it sends it back to
Welcome, which will then #answer the original #call from my workflow.
Both of those subcomponents validate the input, and if all is well,
they #answer with a User object. If something went wrong, the stuff
the message into an instance variable called 'errors' that is always
checked when the components are rendered.
When one of the forms suceeds, and the user object is sent back with
#answer, I then store it in my session (I subclassed WASession and
added an instance variable called 'user').
I hope that gives you a rough idea as to how something like this could work.
Styled Bits 2.0: They're Mostly Broken, But I Try
More information about the Seaside