logout problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

logout problem

Sebastián Perez Escribano
Hi list, I have a site with login. When you login, the site have one
component with two divs: a menu div (left) and a center div (right).  On
the menu div I have anchors, on click (using AJAX) shows a diferent
component on the center div. The problem is when the session expire, I`d
like to call to the login page. So I override the method:
#incomingRequest:. In that method I check and redirect if I need it. It
works fine with all components in the center div, but when I click on an
anchor in the menu div doesnt. Any ideas?


Cheers
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: logout problem

Sebastián Perez Escribano
Here is some example code:

MySession >> incomingRequest: aRequest

    ^self user
                ifNotNil: [super incomingRequest: aRequest]
                ifNil:  [self webLogOut: aRequest]]

MySessio >> webLogOut: aRequest
   
    | wttHome |
     wttHome := self parent baseUrl asString.
    ^WAResponse redirectTo: wttHome

WAMyMainPage >> renderContentOn: html
   
    (html div)
        id: 'leftMenu';
        with: [self renderLeftPanelOn: html].
    (html div)
        id: 'mainComponent';
        with: [self renderMainComponentOn: html].

WAMyLeftMenu >> renderComponent: component label: label on: html
   
    | updater |
    updater := self updaterOn: html for: component.
    (html div)
        id: label;
        with: [html listItem with:
                            [(html anchor)
                                onClick: updater;
                                with: label]]

WAMyLeftMenu >> updaterOn: html for: component
    "This is the method with problems"

    ^(html updater)
        id: 'mainComponent';
        callback: [:renderer | self showMainComponent: component on:
renderer]


Again, the problem is when the user is nil and when I click on an anchor
in WAMyLeftMenu.

Greatings in advance!

Sebastián Perez Escribano escribió:

> Hi list, I have a site with login. When you login, the site have one
> component with two divs: a menu div (left) and a center div (right).  
> On the menu div I have anchors, on click (using AJAX) shows a diferent
> component on the center div. The problem is when the session expire,
> I`d like to call to the login page. So I override the method:
> #incomingRequest:. In that method I check and redirect if I need it.
> It works fine with all components in the center div, but when I click
> on an anchor in the menu div doesnt. Any ideas?
>
>
> Cheers


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside