Login / Logout / loggedinuser

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

Login / Logout / loggedinuser

Mariano Martinez Peck
hi all!

I think I am doing a mess here. I need to have:

1) a Login link if there is no user logged. Something like *Login>.|command=Login*
2) a Logout if there is a logged user. Something like *Logout>.|command=Logout*
3) Display something like what does loggedinuser (Logged in as +value:user+ (+widget+?))
4) a Register link if there is no user logged. This is to create a new user.

But I want all of them ;)   Is there a way of put like ifs in a page ? just to know if there is a user logged.

Can I do this just with Pier as it is now or I need to extend, modify or create something ?

Thanks!

Mariano

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Login / Logout / loggedinuser

Lukas Renggli
I missed that one ;-)

> Can I do this just with Pier as it is now or I need to extend, modify or
> create something ?

I would create a Seaside component (subclass of PRWidget). That's
probably the simplest solution.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Login / Logout / loggedinuser

Mariano Martinez Peck


On Wed, May 6, 2009 at 5:42 AM, Lukas Renggli <[hidden email]> wrote:
I missed that one ;-)

Yes, it's probable. I am sending lots of mails per day hahaha.
 

> Can I do this just with Pier as it is now or I need to extend, modify or
> create something ?

I would create a Seaside component (subclass of PRWidget). That's
probably the simplest solution.

Ok. I will do it then.

Thanks!

Mariano

 

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Login / Logout / loggedinuser

keith1y
Mariano Martinez Peck wrote:

>
>
> On Wed, May 6, 2009 at 5:42 AM, Lukas Renggli <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     I missed that one ;-)
>
>
> Yes, it's probable. I am sending lots of mails per day hahaha.
>  
>
>
>     > Can I do this just with Pier as it is now or I need to extend,
>     modify or
>     > create something ?
>
>     I would create a Seaside component (subclass of PRWidget). That's
>     probably the simplest solution.
>
>
> Ok. I will do it then.
>
> Thanks!
>
> Mariano
>
>  
Hi Mariano,

In my environment I am able to subclass the standard renderers,
including the PRReferenceRenderer

in my subclass I add the following, and it works much better than making
a special component for every message that you want to give the user
saying "please log in".

Keith

visitInternalLink: aLink

    ((link hasParameter: 'loggedout') and: [component context isLoggedIn
]) ifTrue: [ ^ self ].
    ((link hasParameter: 'loggedin') and: [component context isLoggedIn
not ]) ifTrue: [ ^ self ].

    (aLink hasParameter: 'button') ifFalse: [ ^ super visitInternalLink:
aLink ].

    html form: [
        html button
            attributes: (self attributesFor: aLink);
            class: 'internal';
            title: aLink title;
            goto: (self contextForInternalLink: aLink);
            with: [ self visitLink: aLink ]
        ]


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Login / Logout / loggedinuser

Mariano Martinez Peck


On Wed, May 6, 2009 at 1:12 PM, Keith Hodges <[hidden email]> wrote:
Mariano Martinez Peck wrote:
>
>
> On Wed, May 6, 2009 at 5:42 AM, Lukas Renggli <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     I missed that one ;-)
>
>
> Yes, it's probable. I am sending lots of mails per day hahaha.
>
>
>
>     > Can I do this just with Pier as it is now or I need to extend,
>     modify or
>     > create something ?
>
>     I would create a Seaside component (subclass of PRWidget). That's
>     probably the simplest solution.
>
>
> Ok. I will do it then.
>
> Thanks!
>
> Mariano
>
>
Hi Mariano,

In my environment I am able to subclass the standard renderers,
including the PRReferenceRenderer

in my subclass I add the following, and it works much better than making
a special component for every message that you want to give the user
saying "please log in".

Keith

visitInternalLink: aLink

   ((link hasParameter: 'loggedout') and: [component context isLoggedIn
]) ifTrue: [ ^ self ].
   ((link hasParameter: 'loggedin') and: [component context isLoggedIn
not ]) ifTrue: [ ^ self ].

   (aLink hasParameter: 'button') ifFalse: [ ^ super visitInternalLink:
aLink ].

   html form: [
       html button
           attributes: (self attributesFor: aLink);
           class: 'internal';
           title: aLink title;
           goto: (self contextForInternalLink: aLink);
           with: [ self visitLink: aLink ]
       ]


Keith: thanks for the help. I have Beach in mind and I was going to take ideas or just adapt it to run in pharo. At least for the thing I need right now.

Now I know where to start from.

Thanks again.

Mariano

 


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki