logout not working?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

logout not working?

mail
I cannot seem to get a simple set of pages to do logout.


<?LassoScript

// configure navigation, i.e. the site's structure

// create main navigation object
var:'nav'=(knop_nav(-default=($s_user->auth ? 'logout' | 'login')));

$nav->(insert(
    -key='home',
    -label='Home'));
   
if: $s_user->auth;
    $nav->(insert(
        -key='logout',
        -label='Logout'));
else;
    $nav->(insert(
        -key='login',
        -label='Login'));
/if;   

// determine current location so we know what the current path and actionpath is
$nav->getlocation;

?>

I have tried to use the link /login/logout/ and /logout/ but not clear on which it should be.

act_logout.inc does not seem to even be called.

if($s_user->auth);
    // log out the user

    $s_user->logout;
    $message->insert($lang_ui->youhaveloggedout);
   
    // reload navigation to prevent access to privileged pages
    $nav->include('_config/cfg__nav.inc');
/if;

Any suggestions on how to start to debug this?

(NOTE: At this point I have disabled the jquery mobile formatting of a page to get the basic functionality working)

I have not modified anything in knop.lasso

Michael

-- 

#############################################################

This message is sent to you because you are subscribed to

the mailing list <[hidden email]>.

To unsubscribe, E-mail to: <[hidden email]>

Send administrative queries to  <[hidden email]>

List archive http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html

Project homepage http://montania.se/projects/knop/

Google Code has the latest downloads at http://code.google.com/p/knop/


	
	
	
	
Reply | Threaded
Open this post in threaded view
|

Re: logout not working?

stevepiercy
Sessions are a pain unto themselves, and IIRC there is an issue
with cookies and the rendering of a nav.  The example in Knop
may illustrate this issue if you hit the login, logout and
authentication-require pages in the right sequence.  It's been
so long that I forget what issues I had with it.

Instead I use a process where if the user hits the login page,
they are logged out.  My logout page merely redirects the user
to the login page.  I change the Login/Logout link to reflect
the user's current authentication.  If the user authenticates, I
redirect them to another page immediately.


cfg__nav.inc
----------------
$nav->insert(
     -key='login',
     -label='Login',
     -hide=true);  // hiding allows me to put a login/logout
link anywhere in my page template and not render it with the
rest of the navigation

$nav->insert(
     -key='logout',
     -label='Logout',
     -hide=true);


mytemplate.inc
----------------
[if($s_user->auth && $nav->path != 'login')]<a
href="/logout">Logout</a>[else]<a href="/login">Login</a>[/if]


HTH.

--steve


On 2/28/11 at 6:33 PM, [hidden email] pronounced:

>I cannot seem to get a simple set of pages to do logout.
>cfg__nav.inc <http://cfg__nav.inc>
>
><?LassoScript
>
>// configure navigation, i.e. the site's structure
>
>// create main navigation object
>var:'nav'=(knop_nav(-default=($s_user->auth ? 'logout' | 'login')));
>
>$nav->(insert(    -key='home',    -label='Home'));
>   
>if: $s_user->auth;
>   $nav->(insert(       -key='logout',       -label='Logout'));
>else;
>   $nav->(insert(       -key='login',       -label='Login'));
>/if;   
>// determine current location so we know what the current path and actionpath is
>$nav->getlocation;
>
>?>
>
>I have tried to use the link /login/logout/ and /logout/ but
>not clear on which it should be.
>act_logout.inc <http://act_logout.inc> does not seem to even be called.
>if($s_user->auth);
>   // log out the user
>
>   $s_user->logout;
>   $message->insert($lang_ui->youhaveloggedout);
>   
>   // reload navigation to prevent access to privileged pages
>   $nav->include('_config/cfg__nav.inc <http://cfg__nav.inc>');
>/if;
>
>
>Any suggestions on how to start to debug this?
>
>(NOTE: At this point I have disabled the jquery mobile
>formatting of a page to get the basic functionality working)
>
>I have not modified anything in knop.lasso <http://knop.lasso>
>
>
>Michael
>
>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: logout not working?

mail
In reply to this post by mail
I cannot get even a basic login and logoff to work with this solution. I have followed exactly what you suggested below. I am about to give up on knop as a viable framework. Is anyone willing to look at my set of files?

-------- Original Message --------
Subject: Re: logout not working?
From: Steve Piercy - Web Site Builder <[hidden email]>
Date: Mon, February 28, 2011 8:46 pm
To: "Knop Framework Discussion" <[hidden email]>

Sessions are a pain unto themselves, and IIRC there is an issue
with cookies and the rendering of a nav. The example in Knop
may illustrate this issue if you hit the login, logout and
authentication-require pages in the right sequence. It's been
so long that I forget what issues I had with it.

Instead I use a process where if the user hits the login page,
they are logged out. My logout page merely redirects the user
to the login page. I change the Login/Logout link to reflect
the user's current authentication. If the user authenticates, I
redirect them to another page immediately.


cfg__nav.inc
----------------
$nav->insert(
-key='login',
-label='Login',
-hide=true); // hiding allows me to put a login/logout
link anywhere in my page template and not render it with the
rest of the navigation

$nav->insert(
-key='logout',
-label='Logout',
-hide=true);


mytemplate.inc
----------------
[if($s_user->auth && $nav->path != 'login')]
href="/logout">Logout
[else]Login[/if]


HTH.

--steve


On 2/28/11 at 6:33 PM, [hidden email] pronounced:

>I cannot seem to get a simple set of pages to do logout.
>cfg__nav.inc <http://cfg__nav.inc>;
>
><?LassoScript
>
>// configure navigation, i.e. the site's structure
>
>// create main navigation object
>var:'nav'=(knop_nav(-default=($s_user->auth ? 'logout' | 'login')));
>
>$nav->(insert(    -key='home',    -label='Home'));
>   
>if: $s_user->auth;
>   $nav->(insert(       -key='logout',       -label='Logout'));
>else;
>   $nav->(insert(       -key='login',       -label='Login'));
>/if;   
>// determine current location so we know what the current path and actionpath is
>$nav->getlocation;
>
>?>
>
>I have tried to use the link /login/logout/ and /logout/ but
>not clear on which it should be.
>act_logout.inc <http://act_logout.inc>; does not seem to even be called.
>if($s_user->auth);
>   // log out the user
>
>   $s_user->logout;
>   $message->insert($lang_ui->youhaveloggedout);
>   
>   // reload navigation to prevent access to privileged pages
>   $nav->include('_config/cfg__nav.inc <http://cfg__nav.inc>;');
>/if;
>
>
>Any suggestions on how to start to debug this?
>
>(NOTE: At this point I have disabled the jquery mobile
>formatting of a page to get the basic functionality working)
>
>I have not modified anything in knop.lasso <http://knop.lasso>;
>
>
>Michael
>
>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy Web Site Builder
Soquel, CA
<[hidden email]> <http://www.StevePiercy.com/>;


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to <[hidden email]>
List archive http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/

-- 

#############################################################

This message is sent to you because you are subscribed to

the mailing list <[hidden email]>.

To unsubscribe, E-mail to: <[hidden email]>

Send administrative queries to  <[hidden email]>

List archive http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html

Project homepage http://montania.se/projects/knop/

Google Code has the latest downloads at http://code.google.com/p/knop/


	
	
	
	
Reply | Threaded
Open this post in threaded view
|

Re: logout not working?

mail
In reply to this post by mail
Is there a need to pass the session name and id with every URL?
Is there a variable that holds that information to make it easy to append it to URLs?

Michael

-------- Original Message --------
Subject: Re: logout not working?
From: Steve Piercy - Web Site Builder <[hidden email]>
Date: Mon, February 28, 2011 8:46 pm
To: "Knop Framework Discussion" <[hidden email]>

Sessions are a pain unto themselves, and IIRC there is an issue
with cookies and the rendering of a nav. The example in Knop
may illustrate this issue if you hit the login, logout and
authentication-require pages in the right sequence. It's been
so long that I forget what issues I had with it.

Instead I use a process where if the user hits the login page,
they are logged out. My logout page merely redirects the user
to the login page. I change the Login/Logout link to reflect
the user's current authentication. If the user authenticates, I
redirect them to another page immediately.


cfg__nav.inc
----------------
$nav->insert(
-key='login',
-label='Login',
-hide=true); // hiding allows me to put a login/logout
link anywhere in my page template and not render it with the
rest of the navigation

$nav->insert(
-key='logout',
-label='Logout',
-hide=true);


mytemplate.inc
----------------
[if($s_user->auth && $nav->path != 'login')]
href="/logout">Logout
[else]Login[/if]


HTH.

--steve


On 2/28/11 at 6:33 PM, [hidden email] pronounced:

>I cannot seem to get a simple set of pages to do logout.
>cfg__nav.inc <http://cfg__nav.inc>;
>
><?LassoScript
>
>// configure navigation, i.e. the site's structure
>
>// create main navigation object
>var:'nav'=(knop_nav(-default=($s_user->auth ? 'logout' | 'login')));
>
>$nav->(insert(    -key='home',    -label='Home'));
>   
>if: $s_user->auth;
>   $nav->(insert(       -key='logout',       -label='Logout'));
>else;
>   $nav->(insert(       -key='login',       -label='Login'));
>/if;   
>// determine current location so we know what the current path and actionpath is
>$nav->getlocation;
>
>?>
>
>I have tried to use the link /login/logout/ and /logout/ but
>not clear on which it should be.
>act_logout.inc <http://act_logout.inc>; does not seem to even be called.
>if($s_user->auth);
>   // log out the user
>
>   $s_user->logout;
>   $message->insert($lang_ui->youhaveloggedout);
>   
>   // reload navigation to prevent access to privileged pages
>   $nav->include('_config/cfg__nav.inc <http://cfg__nav.inc>;');
>/if;
>
>
>Any suggestions on how to start to debug this?
>
>(NOTE: At this point I have disabled the jquery mobile
>formatting of a page to get the basic functionality working)
>
>I have not modified anything in knop.lasso <http://knop.lasso>;
>
>
>Michael
>
>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy Web Site Builder
Soquel, CA
<[hidden email]> <http://www.StevePiercy.com/>;


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to <[hidden email]>
List archive http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/

-- 

#############################################################

This message is sent to you because you are subscribed to

the mailing list <[hidden email]>.

To unsubscribe, E-mail to: <[hidden email]>

Send administrative queries to  <[hidden email]>

List archive http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html

Project homepage http://montania.se/projects/knop/

Google Code has the latest downloads at http://code.google.com/p/knop/


	
	
	
	
Reply | Threaded
Open this post in threaded view
|

Re: logout not working?

stevepiercy
In reply to this post by mail
My example is not a complete working example.  I left out other
parts because I do other stuff that is not relevant to a basic
authentication routine.

In any case, Knop itself is not the issue.  Knop is a
lightweight framework that gives just enough stuff to help out,
and leaves the details to the developer.  Knop has no session manager.

If you have a session manager that works for you, then you can
try to figure out how to get it to work with Knop.  Most of the
work I've seen by colleagues uses a session manager file which
they include in their onefile framework.  If that's what you
have, then include it in the global config file.  That's what I
do for my session manager.

--steve


On 2/28/11 at 9:56 PM, [hidden email] pronounced:

>I cannot get even a basic login and logoff to work with this
>solution. I have followed exactly what you suggested below. I
>am about to give up on knop as a viable framework. Is anyone
>willing to look at my set of files?
>
>
>
>-------- Original Message --------
>Subject: Re: logout not working?
>From: Steve Piercy - Web Site Builder <[hidden email] <mailto:[hidden email]>>
>Date: Mon, February 28, 2011 8:46 pm
>To: "Knop Framework Discussion" <[hidden email] <mailto:[hidden email]>>
>
>Sessions are a pain unto themselves, and IIRC there is an issue
>with cookies and the rendering of a nav. The example in Knop
>may illustrate this issue if you hit the login, logout and
>authentication-require pages in the right sequence. It's been
>so long that I forget what issues I had with it.
>
>Instead I use a process where if the user hits the login page,
>they are logged out. My logout page merely redirects the user
>to the login page. I change the Login/Logout link to reflect
>the user's current authentication. If the user authenticates, I
>redirect them to another page immediately.
>
>
>cfg__nav.inc <http://cfg__nav.inc>
>----------------
>$nav->insert(
>-key='login',
>-label='Login',
>-hide=true); // hiding allows me to put a login/logout link
>anywhere in my page template and not render it with the rest of
>the navigation
>
>$nav->insert(
>-key='logout',
>-label='Logout',
>-hide=true);
>
>
>mytemplate.inc <http://mytemplate.inc>
>----------------
>[if($s_user->auth &&$nav->path != 'login')]
>href="/logout">Logout[else]Login </login>[/if]
>
>
>HTH.
>
>--steve
>
>
>On 2/28/11 at 6:33 PM, [hidden email]
><mailto:[hidden email]> pronounced:
>
>>I cannot seem to get a simple set of pages to do logout.
>>cfg__nav.inc <http://cfg__nav.inc> <http://cfg__nav.inc&gt</a>;
>>
>><?LassoScript
>>
>>// configure navigation, i.e. the site's structure
>>
>>// create main navigation object
>>var:'nav'=(knop_nav(-default=($s_user->auth ? 'logout' | 'login')));
>>
>>$nav->(insert(    -key='home',    -label='Home'));
>>   
>>if: $s_user->auth;
>>   $nav->(insert(       -key='logout',       -label='Logout'));
>>else;
>>   $nav->(insert(       -key='login',       -label='Login'));
>>/if;   
>>// determine current location so we know what the current path and actionpath is
>>$nav->getlocation;
>>
>>?>
>>
>>I have tried to use the link /login/logout/ and /logout/ but
>>not clear on which it should be.
>>act_logout.inc <http://act_logout.inc> <http://act_logout.inc&gt</a>; does not
>seem to even be called.
>>if($s_user->auth);
>>   // log out the user
>>
>>   $s_user->logout;
>>   $message->insert($lang_ui->youhaveloggedout);
>>   
>>   // reload navigation to prevent access to privileged pages
>>   $nav->include('_config/cfg__nav.inc <http://cfg__nav.inc>
><http://cfg__nav.inc&gt</a>;');
>>/if;
>>
>>
>>Any suggestions on how to start to debug this?
>>
>>(NOTE: At this point I have disabled the jquery mobile
>>formatting of a page to get the basic functionality working)
>>
>>I have not modified anything in knop.lasso <http://knop.lasso>
><http://knop.lasso&gt</a>;
>>
>>
>>Michael
>>
>>
>
>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>-- --
>Steve Piercy Web Site Builder Soquel, CA
><[hidden email] <mailto:[hidden email]>> <http://www.StevePiercy.com/&gt</a>;
>
>
>--
>#############################################################
>This message is sent to you because you are subscribed to
>the mailing list <[hidden email] <mailto:[hidden email]>>.
>To unsubscribe, E-mail to: <[hidden email] <mailto:[hidden email]>>
>Send administrative queries to <[hidden email] <mailto:[hidden email]>>
>List archive
>http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html 
><http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html>
>Project homepage http://montania.se/projects/knop <http://montania.se/projects/knop>/
>Google Code has the latest downloads at
>http://code.google.com/p/knop <http://code.google.com/p/knop>/
>
>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: logout not working?

stevepiercy
In reply to this post by mail
Nope and nope.  That's all Lasso session stuff, and depends on
how you start sessions in your session manager.

Knop does not manage sessions.  It has a knop_user type that
allows one to add arbitrary data to the user instance.  You then
store that object in the session.  Here is a simplified excerpt
from my act_login.inc.

     if($s_user->auth);
         session_start(-name='name', -expires=$expires);
         session_addvar(-name='name', 's_user', 's_lang');
         redirect_url('/welcome/?loggedinas'); // the Knop
example does not redirect
     else;
         $message->insert($lang_ui->authfailed);
     /if;

--steve


On 2/28/11 at 10:08 PM, [hidden email] pronounced:

>[ This message was sent as HTML. The text you see here was    ]
>[ generated by Mailsmith; the original HTML is available as   ]
>[ an enclosure.                                               ]
>
>Is there a need to pass the session name and id with every URL?
>Is there a variable that holds that information to make it easy to append it to URLs?
>
>Michael
>
>
>-------- Original Message --------
>Subject: Re: logout not working?
>From: Steve Piercy - Web Site Builder <[hidden email] <mailto:[hidden email]>>
>Date: Mon, February 28, 2011 8:46 pm
>To: "Knop Framework Discussion" <[hidden email] <mailto:[hidden email]>>
>
>Sessions are a pain unto themselves, and IIRC there is an issue
>with cookies and the rendering of a nav. The example in Knop
>may illustrate this issue if you hit the login, logout and
>authentication-require pages in the right sequence. It's been
>so long that I forget what issues I had with it.
>
>Instead I use a process where if the user hits the login page,
>they are logged out. My logout page merely redirects the user
>to the login page. I change the Login/Logout link to reflect
>the user's current authentication. If the user authenticates, I
>redirect them to another page immediately.
>
>
>cfg__nav.inc <http://cfg__nav.inc>
>----------------
>$nav->insert(
>-key='login',
>-label='Login',
>-hide=true); // hiding allows me to put a login/logout link
>anywhere in my page template and not render it with the rest of
>the navigation
>
>$nav->insert(
>-key='logout',
>-label='Logout',
>-hide=true);
>
>
>mytemplate.inc <http://mytemplate.inc>
>----------------
>[if($s_user->auth &&$nav->path != 'login')]
>href="/logout">Logout[else]Login </login>[/if]
>
>
>HTH.
>
>--steve
>
>
>On 2/28/11 at 6:33 PM, [hidden email]
><mailto:[hidden email]> pronounced:
>
>>I cannot seem to get a simple set of pages to do logout.
>>cfg__nav.inc <http://cfg__nav.inc> <http://cfg__nav.inc&gt</a>;
>>
>><?LassoScript
>>
>>// configure navigation, i.e. the site's structure
>>
>>// create main navigation object
>>var:'nav'=(knop_nav(-default=($s_user->auth ? 'logout' | 'login')));
>>
>>$nav->(insert(    -key='home',    -label='Home'));
>>   
>>if: $s_user->auth;
>>   $nav->(insert(       -key='logout',       -label='Logout'));
>>else;
>>   $nav->(insert(       -key='login',       -label='Login'));
>>/if;   
>>// determine current location so we know what the current path and actionpath is
>>$nav->getlocation;
>>
>>?>
>>
>>I have tried to use the link /login/logout/ and /logout/ but
>>not clear on which it should be.
>>act_logout.inc <http://act_logout.inc> <http://act_logout.inc&gt</a>; does not
>seem to even be called.
>>if($s_user->auth);
>>   // log out the user
>>
>>   $s_user->logout;
>>   $message->insert($lang_ui->youhaveloggedout);
>>   
>>   // reload navigation to prevent access to privileged pages
>>   $nav->include('_config/cfg__nav.inc <http://cfg__nav.inc>
><http://cfg__nav.inc&gt</a>;');
>>/if;
>>
>>
>>Any suggestions on how to start to debug this?
>>
>>(NOTE: At this point I have disabled the jquery mobile
>>formatting of a page to get the basic functionality working)
>>
>>I have not modified anything in knop.lasso <http://knop.lasso>
><http://knop.lasso&gt</a>;
>>
>>
>>Michael
>>
>>
>
>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>-- --
>Steve Piercy Web Site Builder Soquel, CA
><[hidden email] <mailto:[hidden email]>> <http://www.StevePiercy.com/&gt</a>;
>
>
>--
>#############################################################
>This message is sent to you because you are subscribed to
>the mailing list <[hidden email] <mailto:[hidden email]>>.
>To unsubscribe, E-mail to: <[hidden email] <mailto:[hidden email]>>
>Send administrative queries to <[hidden email] <mailto:[hidden email]>>
>List archive
>http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html 
><http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html>
>Project homepage http://montania.se/projects/knop <http://montania.se/projects/knop>/
>Google Code has the latest downloads at
>http://code.google.com/p/knop <http://code.google.com/p/knop>/
>
>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: logout not working?

Johan Solve-2
In reply to this post by mail
At 18.33 -0700 2011-02-28, <[hidden email]> wrote:
>I have tried to use the link /login/logout/ and /logout/ but not clear on which it should be.
>
><http://act_logout.inc>act_logout.inc does not seem to even be called.

action files are only called when there is an -action parameter with the corresponding path.

You can verify that Knop sees an action parameter by looking at $nav -> actionpath.

This means that in your nav for the logout link you need to hard code an action parameter.
                        $nav -> insert(
                                        -key='logout',
                                        -label='Log out',
                                        -url='?-action=logout');


--
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:[hidden email]
 (spam-safe email address, replace '-' with 'a')

--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: logout not working?

Johan Solve-2
At 09.08 +0100 2011-03-01, Johan Solve wrote:

>At 18.33 -0700 2011-02-28, <[hidden email]> wrote:
>>I have tried to use the link /login/logout/ and /logout/ but not clear on which it should be.
>>
>><http://act_logout.inc>act_logout.inc does not seem to even be called.
>
>action files are only called when there is an -action parameter with the corresponding path.
>
>You can verify that Knop sees an action parameter by looking at $nav -> actionpath.
>
>This means that in your nav for the logout link you need to hard code an action parameter.
> $nav -> insert(
> -key='logout',
> -label='Log out',
> -url='?-action=logout');

Of course you can also place the logout code somewhere else instead of in an action file, as Steve showed.

--
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:[hidden email]
 (spam-safe email address, replace '-' with 'a')

--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: logout not working?

mail
In reply to this post by mail
Aha! I did not realize the details of managing a session were not part of the knop.lasso classes and methods. There is a session started in a demo file "cfg__global.inc" and there is a login and logout method, so I guess I just assumed that the session was being managed. There is a real need to redirect after a log out so I have also added that. I just cannot understand what mechanism is relied on with the default setup of knop but I will not dwell on it. I added my session start and session variable adds and clearing that on logout so it works better now. But still working on the bugs. Thanks for the heads up and pointers.

Michael
-------- Original Message --------
Subject: Re: logout not working?
From: Steve Piercy - Web Site Builder <[hidden email]>
Date: Mon, February 28, 2011 10:26 pm
To: "Knop Framework Discussion" <[hidden email]>

My example is not a complete working example. I left out other
parts because I do other stuff that is not relevant to a basic
authentication routine.

In any case, Knop itself is not the issue. Knop is a
lightweight framework that gives just enough stuff to help out,
and leaves the details to the developer. Knop has no session manager.

If you have a session manager that works for you, then you can
try to figure out how to get it to work with Knop. Most of the
work I've seen by colleagues uses a session manager file which
they include in their onefile framework. If that's what you
have, then include it in the global config file. That's what I
do for my session manager.

--steve


On 2/28/11 at 9:56 PM, [hidden email] pronounced:

>I cannot get even a basic login and logoff to work with this
>solution. I have followed exactly what you suggested below. I
>am about to give up on knop as a viable framework. Is anyone
>willing to look at my set of files?
>
>
>
>-------- Original Message --------
>Subject: Re: logout not working?
>From: Steve Piercy - Web Site Builder <[hidden email] <[hidden email]>>
>Date: Mon, February 28, 2011 8:46 pm
>To: "Knop Framework Discussion" <[hidden email] <[hidden email]>>
>
>Sessions are a pain unto themselves, and IIRC there is an issue
>with cookies and the rendering of a nav. The example in Knop
>may illustrate this issue if you hit the login, logout and
>authentication-require pages in the right sequence. It's been
>so long that I forget what issues I had with it.
>
>Instead I use a process where if the user hits the login page,
>they are logged out. My logout page merely redirects the user
>to the login page. I change the Login/Logout link to reflect
>the user's current authentication. If the user authenticates, I
>redirect them to another page immediately.
>
>
>cfg__nav.inc <http://cfg__nav.inc>;
>----------------
>$nav->insert(
>-key='login',
>-label='Login',
>-hide=true); // hiding allows me to put a login/logout link
>anywhere in my page template and not render it with the rest of
>the navigation
>
>$nav->insert(
>-key='logout',
>-label='Logout',
>-hide=true);
>
>
>mytemplate.inc <http://mytemplate.inc>;
>----------------
>[if($s_user->auth &&$nav->path != 'login')]
>href="/logout">Logout[else]Login </login>[/if]
>
>
>HTH.
>
>--steve
>
>
>On 2/28/11 at 6:33 PM, [hidden email]
><[hidden email]> pronounced:
>
>>I cannot seem to get a simple set of pages to do logout.
>>cfg__nav.inc <http://cfg__nav.inc>; <http://cfg__nav.inc&gt</a>;;
>>
>><?LassoScript
>>
>>// configure navigation, i.e. the site's structure
>>
>>// create main navigation object
>>var:'nav'=(knop_nav(-default=($s_user->auth ? 'logout' | 'login')));
>>
>>$nav->(insert(    -key='home',    -label='Home'));
>>   
>>if: $s_user->auth;
>>   $nav->(insert(       -key='logout',       -label='Logout'));
>>else;
>>   $nav->(insert(       -key='login',       -label='Login'));
>>/if;   
>>// determine current location so we know what the current path and actionpath is
>>$nav->getlocation;
>>
>>?>
>>
>>I have tried to use the link /login/logout/ and /logout/ but
>>not clear on which it should be.
>>act_logout.inc <http://act_logout.inc>; <http://act_logout.inc&gt</a>;; does not
>seem to even be called.
>>if($s_user->auth);
>>   // log out the user
>>
>>   $s_user->logout;
>>   $message->insert($lang_ui->youhaveloggedout);
>>   
>>   // reload navigation to prevent access to privileged pages
>>   $nav->include('_config/cfg__nav.inc <http://cfg__nav.inc>;
><http://cfg__nav.inc&gt</a>;;');
>>/if;
>>
>>
>>Any suggestions on how to start to debug this?
>>
>>(NOTE: At this point I have disabled the jquery mobile
>>formatting of a page to get the basic functionality working)
>>
>>I have not modified anything in knop.lasso <http://knop.lasso>;
><http://knop.lasso&gt</a>;;
>>
>>
>>Michael
>>
>>
>
>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>-- --
>Steve Piercy Web Site Builder Soquel, CA
><[hidden email] <[hidden email]>> <http://www.StevePiercy.com/&gt</a>;;
>
>
>--
>#############################################################
>This message is sent to you because you are subscribed to
>the mailing list <[hidden email] <[hidden email]>>.
>To unsubscribe, E-mail to: <[hidden email] <[hidden email]>>
>Send administrative queries to <[hidden email] <[hidden email]>>
>List archive
>http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html
><http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html>;
>Project homepage http://montania.se/projects/knop <http://montania.se/projects/knop>;/
>Google Code has the latest downloads at
>http://code.google.com/p/knop <http://code.google.com/p/knop>;/
>
>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy Web Site Builder
Soquel, CA
<[hidden email]> <http://www.StevePiercy.com/>;


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to <[hidden email]>
List archive http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/

-- 

#############################################################

This message is sent to you because you are subscribed to

the mailing list <[hidden email]>.

To unsubscribe, E-mail to: <[hidden email]>

Send administrative queries to  <[hidden email]>

List archive http://lasso.2283332.n4.nabble.com/Knop-Framework-Discussion-f3157831.html

Project homepage http://montania.se/projects/knop/

Google Code has the latest downloads at http://code.google.com/p/knop/