Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#577 2008-05-06 03:59:12

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: ign_password_protect

markusfalk wrote:

do you think it would somehow be possible to inlcude the users privilege into the cookie so that something like <txp:ign_user_info type=“priv”/> would then output the set privilege level

No need to add it into cookie, as it already is stored inside the database. Actually all info is pull from the db, based on the cookie. In example the priv level can be output by:

<txp:php>
	global $ign_user, $ign_user_db, $txp_user, $ign_levels, $ign_levels;
	$name = ($ign_user) ? $ign_user : $txp_user;
	$privs = safe_field('privs', $ign_user_db, "name='$name'"); // Now $privs is number
	echo $ign_levels[$privs]; // Now it should be text, based on $ign_levels inside the plugin
</txp:php>

Last edited by Gocom (2008-05-06 04:02:15)

Offline

#578 2008-05-06 22:06:45

markusfalk
Member
Registered: 2007-08-16
Posts: 57
Website

Re: ign_password_protect

indeed :)

thanks


I sometimes destructively reverse engineer my own work and the only help is this forum.

visit me at visiongraphix

Offline

#579 2008-05-21 23:28:42

idoremus
Member
From: NW United States
Registered: 2008-04-16
Posts: 19

Re: ign_password_protect

Hello all,
I am an extremely new user to Textpattern. I am still trying to get my head around the forms and tags. I am designing a member website which will be password protected. My idea is to have a front welcome page, a join page, about page, and picture page unprotected. In the navbar I would have a sign-in form which would give the viewer access to the Members Home page, and five or so other sections. Someone recommended ign_password_protect so I have it installed.

I apologize for asking such a basic question, I have searched high an low for a “Dummies Guide” to get ign_password_protect to work. I have read the info page several times but I just don’t get it. I figure if I can get this piece to work, I can start designing the content and work on my tag/form training as I go. If I can’t get it to work, I would be concerned about building the site.

Can someone give me simple steps to get this working? Can this plugin be setup to protect entire sections in TXP? Am I working with the right plugin? My other option was to have all my open content in flat files and link to a password protected install of TXP. Any help would be appreciated.

Cheers,
Ian

Offline

#580 2008-05-22 01:11:03

garbo
Member
From: Montreal, Canada
Registered: 2007-01-02
Posts: 28
Website

Re: ign_password_protect

@idoremus

Welcome to Textpattern. I’ve been using it for more than a year and it does get easier over time. The ign_password_protect plug-in can be used in discreet locations throughout your site. For example, if you have a template page for your photos, you can put the content that needs to be protected between the {txp:ign_if_logged_in} and {/txp:ign_if_logged_in} tags with an optional {txp:else /} tag that shows up when the person is not logged in.

This tag alone logs in users that are added in the Admin section of the backend (writers, publishers, etc.), so if you need to have members register themselves, you may need to add the mem_self_register plug-in.

I admit, I haven’t quite figured it all out myself, but I’m currently working on a client site that requires membership access. Unfortunately, the documentation for this plug-in is a little scant and needs more examples, but all these plug-in authors have busy lives outside of this community, so patience is sometimes required.

If you want to stay in touch, I can help walk you through as I get it up and running myself.

Offline

#581 2008-05-22 06:32:25

idoremus
Member
From: NW United States
Registered: 2008-04-16
Posts: 19

Re: ign_password_protect

Gary,

Thank you for the help, it makes sense. I would be interested in hearing how your project turns out.

I took a look at your website, I love the clean design — very easy to navigate.

Ian

Offline

#582 2008-05-28 21:53:35

yatil.de
Archived Plugin Author
From: Vienna/Austria
Registered: 2004-02-26
Posts: 14
Website

Re: ign_password_protect

Hello,

the plugin doesn’t work for me on my MAMP development server. I get authorized, but there is no cookie set and every reload (form interaction, link) forces me to reenter my credentials. There are no TXP errors, even in Debug Mode. (cookies are allowed, credentials are right)

Any Idea?

Thanks for your help,
Eric


Eric Eggert
Textpattern-Sites: yatil! | Snookerblog | Schachfreunde Ruhbank

Offline

#583 2008-05-28 22:18:06

igner
Plugin Author
Registered: 2004-06-03
Posts: 337

Re: ign_password_protect

@yatil.de – how are you accessing the site? by IP or a URL?


And then my dog ate my badger, and the love was lost.

Offline

#584 2008-05-29 06:22:37

yatil.de
Archived Plugin Author
From: Vienna/Austria
Registered: 2004-02-26
Posts: 14
Website

Re: ign_password_protect

igner wrote:

@yatil.de – how are you accessing the site? by IP or a URL?

By URL: http://localhost:9100/

Edit:
Version 0.4.2d works like a charm and does everything I need at the moment.

Last edited by yatil.de (2008-05-29 06:40:11)


Eric Eggert
Textpattern-Sites: yatil! | Snookerblog | Schachfreunde Ruhbank

Offline

#585 2008-05-29 14:53:54

igner
Plugin Author
Registered: 2004-06-03
Posts: 337

Re: ign_password_protect

ah – yes. I can see where the fix I added to address multiple top-level domains might have an issue with that url. Hmm. I’ll look at options to improve that.


And then my dog ate my badger, and the love was lost.

Offline

#586 2008-06-02 17:27:44

fpradignac
Plugin Author
From: France near Cognac
Registered: 2005-01-29
Posts: 359
Website

Re: ign_password_protect

Hello Igner,

I’ve installed your plugin : excellent !

Just 2 suggestions :

1- In your function ign_logout_link() (to log out;-), I saw that you have put an alt attribute in the <a> tag that doesn’t exit for this tag. So I deleted it in this function to validate my code (line 1583 in your 0.5b9 release).
'alt' => 'Logout',

2- When I add 2 users and then add a “privs=1” in an article, the only one that can access this article is user level1 : good thing ;-).
With the same browser, same computer, when I try to access with the second user name and pass, I can’t access the article (normal) : but I’m still logged as second user. Try again with the first user name and pass : it’s impossible to access, untill the second one logged out. Hope that I’m clear ;-)
So I put an <txp:ign_if_logged_in> to display a logout link (“please click here to refresh this page”) and an <txp:else /> to display the connection form : if the second one try to access, the connection doesn’t work and he’s invited to click on the logout link, then first one can access.

Thanks for your work.


françois

Offline

#587 2008-06-03 14:48:34

igner
Plugin Author
Registered: 2004-06-03
Posts: 337

Re: ign_password_protect

fpradignac wrote:

Hello Igner,

I’ve installed your plugin : excellent !

thanks
bq.. Just 2 suggestions :

1- In your function ign_logout_link() (to log out;-), I saw that you have put an alt attribute in the <a> tag that doesn’t exit for this tag. So I deleted it in this function to validate my code (line 1583 in your 0.5b9 release).
'alt' => 'Logout',

good catch, I’ll remove that alt tag.

2- When I add 2 users and then add a “privs=1” in an article, the only one that can access this article is user level1 : good thing ;-).
With the same browser, same computer, when I try to access with the second user name and pass, I can’t access the article (normal) : but I’m still logged as second user. Try again with the first user name and pass : it’s impossible to access, untill the second one logged out. Hope that I’m clear ;-)
So I put an <txp:ign_if_logged_in> to display a logout link (“please click here to refresh this page”) and an <txp:else /> to display the connection form : if the second one try to access, the connection doesn’t work and he’s invited to click on the logout link, then first one can access.

Yes, the logic assumes that if a user is already logged in, they should stay logged in. In earlier versions of the plugin the login form displayed a logout link instead of the form if the user was logged in; the change is a byproduct of decoupling the login form from displaying the logged-in user. Your approach is what I typically do – wrap the login form in a conditional and display a logout link instead if a user is already logged in. But I’ve added it to the list of things to look at / address in the next revision.


And then my dog ate my badger, and the love was lost.

Offline

#588 2008-06-03 16:49:39

fpradignac
Plugin Author
From: France near Cognac
Registered: 2005-01-29
Posts: 359
Website

Re: ign_password_protect

Thanks for your very clear reponse Igner.


françois

Offline

Board footer

Powered by FluxBB