[Seaside] Login process

Todd Blanchard tblanchard at mac.com
Mon Jun 18 16:30:24 UTC 2007


This is one of  those things that gets done over and over and over  
again.  It is a well known pattern.  It would be really cool if  
someone would do this once and put it on squeaksource.


On Jun 18, 2007, at 8:37 AM, Squeak Smalltalk wrote:

> Thanks.
>
> to simple for my small brain ;)
> Great.
>
> Walle
> On 6/18/07, Michael Gorsuch <michael.gorsuch at gmail.com> wrote:
>> Sure, just go ahead and build a subclass of WASession, and add an
>> instance variable called 'user' or whatever seems appropriate.  Also
>> add accessors for it.
>>
>> Then, reconfig the app via /seaside/config, and overide the default
>> session class.
>>
>> After that, your components can then call 'self session user' or  
>> 'self
>> session user: myNewUser' to stuff things in the session object.
>>
>> Make sense?
>>
>> On 6/18/07, Squeak Smalltalk <wallenberg at gmail.com> wrote:
>> > Hi,
>> >
>> > I have some troubles with
>> > "I then store it in my session (I subclassed WASession and
>> > added an instance variable called 'user')."
>> >
>> > How do you subclass WASession for storing username ?
>> > Any hint :D
>> >
>> > Walle
>> >
>> > On 6/18/07, Squeak Smalltalk <wallenberg at gmail.com> wrote:
>> > > thanks.
>> > > Done ;)
>> > >
>> > > Walle
>> > > On 6/17/07, Michael Gorsuch <michael.gorsuch at gmail.com> wrote:
>> > > > > 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.
>> > > >
>> > > > -
>> > > > Michael Gorsuch
>> > > > Styled Bits 2.0: They're Mostly Broken, But I Try
>> > > > http://www.styledbits.com
>> > > > _______________________________________________
>> > > > Seaside mailing list
>> > > > Seaside at lists.squeakfoundation.org
>> > > > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/ 
>> seaside
>> > > >
>> > >
>> > _______________________________________________
>> > Seaside mailing list
>> > Seaside at lists.squeakfoundation.org
>> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>> >
>>
>>
>> --
>> Styled Bits 2.0: The Cult of Tech
>> http://www.styledbits.com
>> _______________________________________________
>> Seaside mailing list
>> Seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the Seaside mailing list