Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-11-28 17:26:58

gfdesign
Member
From: Argentina
Registered: 2009-04-20
Posts: 401

Logout using <txp:password_protect />

Hi everyone
I wonder if it’s possible to create a Log out link when you are watching contents protected by <txp:password_protect /> tag.
I think it should be useful especially when you’re in a public computer (such as cybercafe, school, etc)
I know about ign_password_protect plugins, but I’ll have many protected articles for differents users (one article per user), so I would use <txp:password_protect /> rather than ign_password_protect so, this way, I could put the user & password in the same article using custom_fields.
Any idea?
Thanks in advanced

Offline

#2 2012-12-10 10:23:12

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

Re: Logout using <txp:password_protect />

Install cbe_frotnauth

Make a logout link:

<a href="?logout=1">Log out</a>

txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#3 2022-07-20 12:54:48

helsinkifrostbites
Member
From: Ystad, Sweden
Registered: 2007-11-16
Posts: 47
Website

Re: Logout using <txp:password_protect />

I realize this thread is a decade old, but I have the same problem as the gfdesign, and the logout link doesn’t work. Is there a currently working solution?

Offline

#4 2022-07-21 10:55:50

etc
Developer
Registered: 2010-11-11
Posts: 5,236
Website GitHub

Re: Logout using <txp:password_protect />

There seem to be no easy way to unset clients Authorization header used by <txp:password_protect />, but you can replace it by another one on logout. Replace where appropriate

<txp:password_protect login="user" pass="password" />

with

<txp:password_protect login="user" pass='password<txp:page_url type="logout" />' />

and access this page via a HTML form sending, say, logout=password input. Txp will prompt you to login. Using user and passwordpassword should actually log you out.

This may certainly be naive security-wise, so test if one can easily circumvent it.

Offline

#5 2022-07-28 12:05:44

helsinkifrostbites
Member
From: Ystad, Sweden
Registered: 2007-11-16
Posts: 47
Website

Re: Logout using <txp:password_protect />

Thanks, etc! I’ll look into this. :)

Offline

Board footer

Powered by FluxBB