Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#331 2007-01-23 05:24:55
Re: ign_password_protect
>igner
Actually, I don’t mind using it as a container tag at all. Just didn’t know. BTW, I’d be happy to help with the documentation, but I have a feeling it would be as much work for you to explain it to me as it would be to write the thing. But let me kow if you want some help.
Thanks again for a terrific plugin.
Last edited by mrdale (2007-01-23 06:05:40)
Offline
#332 2007-01-25 04:24:19
- igner
- Plugin Author

- Registered: 2004-06-03
- Posts: 337
Re: ign_password_protect
time for another update – this one incorporates the change discussed above <txp:ign_logout_link> – see the documentation for details. Similar behaviour applied to <txp:ign_error_msg> (container, fallback constant only).
This release also adds a Cache-Control: must-revalidate header when not logged in, to force browsers to revalidate cached pages after login. This should address issues with some browsers not displaying the login form on refresh after logging in.
Get it here: ign_password_protect_0.5b3
@Dale – I appreciate the offer of help. I updated the documentation for this release, and hit the obvious question points. Let me know if you still see questionable areas in the docs, let me know.
Last edited by igner (2007-01-25 04:35:06)
And then my dog ate my badger, and the love was lost.
Offline
#333 2007-01-25 07:22:00
- melly
- New Member
- Registered: 2007-01-25
- Posts: 2
Re: ign_password_protect
I’ve been also experiencing problems when I login – When I login then when I tab into a new section – textpattern logs me out. Would it be a browser cache problem?
It works in Firefox 1.5.09 but not in IE 5.2
Offline
#334 2007-01-25 12:19:58
- infusion
- Member
- Registered: 2005-08-04
- Posts: 19
Re: ign_password_protect
I’ve got a few issues with the latest version. Here’s my code (in an article)
<txp:ign_if_not_logged_in privs="5">You are trying to access a password protected page. Please log in below.
<txp:ign_show_login login_msg="LOGIN" />
</txp:ign_if_not_logged_in>
First issue: The login_msg attribute does not appear. I presume, that the login message will be the header on top of the form but it doesn’t appear. When I was using the txp:ign_password_protect tag in the old version, it used to work but now with this new tag, it doesn’t work.
Second issue: With the code above, the HTML that is parsed is as follows:
<p>You are trying to access a password protected page. Please log below.</p>
<p><form action='Some/Location/here' method='post'><div class='login'>
<p><span class='error'></span></p>
<p><label>Name:<br />
<input type="text" name="p_userid" value="" />
</label><br />
<label>Password:<br />
<input type="password" name="p_password" value="" />
</label><br />
<label>Remember Me? <input type="checkbox" name="stay" value="1" class="checkbox" /></label>
<input type="submit" name="login" value="Login" /></p>
</div>
</form><br />
</p>
This results in a large gap between the text and the form due the 2 <p> tags. It’s quite an eye sore to be honest.
How do I resolve these 2 issues? Thanks
Last edited by infusion (2007-01-25 12:25:06)
Offline
#335 2007-01-25 14:51:51
- igner
- Plugin Author

- Registered: 2004-06-03
- Posts: 337
Re: ign_password_protect
@melly – not likely; most cases I’ve seen that behaviour on, it’s been an issue of mismatched hosts (i.e. login at www.domain.com, but TXP is set to return something like domain.com), which can have an effect on the cookies.
@infusion – on the first issue, I missed that when updating the documentation; I’ll update that. show_login now uses TXP forms to render the login form; by default it looks for a form named “login_form”, and if no such form exists it’ll use a hard-coded default form. Alternatively, you can use form=“form_name” to call a different form. Note that if using the form attribute and the form doesn’t exist, it’ll throw an error rather than failover to the hardcoded form. This is intentional, to prevent confusion.Also, <txp:ign_if_not_logged_in> no longer accepts the privs attribute. (My feeling is that either the user is logged in, or they aren’t). I’ll have to update the documentation there. <txp:ign_if_logged_in> does do a privs check, so you can use the <else /> clause in lieu of not_logged_in:
<txp:ign_if_logged_in privs="5"><txp:else />error message here</txp:ign_if_logged_in>
On the second issue, if you’ve got that code in an article, you’ll want to suppress textile parsing on those lines. Either start each line with a space, or use notextile. to prevent a block from being parsed. That should end the ugliness.
edit: typo in the example – sorry infusion.
Last edited by igner (2007-01-26 14:20:21)
And then my dog ate my badger, and the love was lost.
Offline
#336 2007-01-26 06:54:03
- infusion
- Member
- Registered: 2005-08-04
- Posts: 19
Re: ign_password_protect
Forgive my ignorance, but if it looks for a form called “login_form”, then login_form should contain the username and password fields that are to be entered by the user. But how do I call this in the login_form??
What I mean is….. if I just use <txp:ign_show_login show_logged="1" login_msg="LOGIN" /> , without creating login_form, then the default password and name challenge is there but without the Login message. However, when I create login_form and put as the first line “Login”, then the login message appears without the challenge fields. What do I have to put into login_form to make the challenge fields appear?
Offline
#337 2007-01-26 07:07:22
- infusion
- Member
- Registered: 2005-08-04
- Posts: 19
Re: ign_password_protect
Just tried the ign_if_logged_in with the else statement. Nothing comes up at all now.
<txp:ign_if_logged_in privs="5"> <else />You are trying to access a password protected page. Please log in or sign up with us as by clicking <a href="SOME LOCATION" title="Subscribe">here</a>.<txp:ign_show_login show_logged="1" login_msg="LOGIN" />
</txp:ign_if_logged_in>
Last edited by infusion (2007-01-26 07:08:07)
Offline
#338 2007-01-26 13:45:54
- igner
- Plugin Author

- Registered: 2004-06-03
- Posts: 337
Re: ign_password_protect
infusion – I described how the default form is generated in this post, but that information should really be in the documentation as well. I should have an updated version with improved documentation (and a couple of other fixes) in the next day or two.
In the meantime, this is the code that renders the default login form:
<div class=‘login’> <p><span class=‘error’><txp:ign_error_msg >There was a problem logging in.</txp:ign_error_msg></span></p> <p><label>Name:<br /> <txp:ign_user_field /> </label><br /> <label>Password:<br /> <txp:ign_pass_field /> </label><br /> <label>Remember Me? <txp:ign_checkbox name=‘stay’ value=‘1’ /></label> <txp:ign_submit_field name=‘login’ value=‘Login’ /></p>
</div>
use <txp:ign_user_field />, <txp:ign_pass_field />, <txp:ign_checkbox name="stay" value="1" />, and <txp:ign_submit_field name="login" value="Login" />, along with traditional markup (labels, etc.), in your form to render the login form. My apologies that this wasn’t clear. Alternatively, there’s nothing that prevents using plain HTML markup to create the form as well. Bottom line is that I wanted to remove as much rendered code from the plugin, to allow for more flexible markup and easier localization (as I know many users have had to drastically hack previous versions to localized them).
And then my dog ate my badger, and the love was lost.
Offline
#339 2007-01-26 14:19:20
- igner
- Plugin Author

- Registered: 2004-06-03
- Posts: 337
Re: ign_password_protect
infusion wrote:
Just tried the ign_if_logged_in with the else statement. Nothing comes up at all now.
you need to use <txp:else /> not <else /> – that was a typo in the previous message. Again, sorry. I seem to be unfairly unleashing difficulties on you. If you’d like, I’d be happy to refund your purchase price.
And then my dog ate my badger, and the love was lost.
Offline
#340 2007-01-26 16:41:47
- infusion
- Member
- Registered: 2005-08-04
- Posts: 19
Re: ign_password_protect
haha…. don’t sweat it. It’s a great plugin but my infamiliarity with txp itself is the one that’s causing so much problems.
Offline
#341 2007-01-27 02:26:13
- melly
- New Member
- Registered: 2007-01-25
- Posts: 2
Re: ign_password_protect
igner, I’m getting this warning
Warning: Cannot modify header information – headers already sent by (output started at /home/virtual/site35/fst/var/www/html/pan/textpattern/textpattern/lib/txplib_db.php:84) in /home/virtual/site35/fst/var/www/html/pan/textpattern/textpattern/include/txp_auth.php on line 163
I’ve got the latest textpattern. Is the issue for the error somthing with my server, or having a long URL?
How do you set the changes from domain.com to www.domain.com?
And I have this error:
Warning: Can’t open file: ‘txp_lang.MYD’. (errno: 145) select name, data from txp_lang where lang=‘en-gb’ in /home/virtual/site35/fst/var/www/html/pan/textpattern/textpattern/lib/txplib_db.php on line 84
I’m abit of a newbie to textpattern.
Offline
#342 2007-01-27 13:57:14
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: ign_password_protect
melly
regarding your second warning; looks like you have a problem with (at least) one of your MySQL database tables. Could try repairing the txp_lang table using Rob’s rss_admin_db_manager plugin and see if that sorts out your problem.
Last edited by net-carver (2007-01-27 13:57:47)
— Steve
Offline
#343 2007-01-27 15:35:29
- guiguibonbon
- Member
- Registered: 2006-02-20
- Posts: 296
Re: ign_password_protect
I think I just found a bug. I just couldn’t manage to log in, then checked debugging, tried the sql querry, which returned no results. Went looking in txp source, and saw there’s an alternate for the usual password checking, with sql function old_password(). That does return a result in my case, I can now login. You should try to incorporate this in the plugin, as well as checking for both with and without the lower() function.
Offline
#344 2007-01-27 15:51:57
- igner
- Plugin Author

- Registered: 2004-06-03
- Posts: 337
Re: ign_password_protect
guigibonbon – what version of the plugin, and what version of txp? (and what version of mysql is running on the host?) But yes, I can see that being a problem, and I’ll have to build some failover logic in there. Good catch.
And then my dog ate my badger, and the love was lost.
Offline
#345 2007-01-27 15:54:32
- igner
- Plugin Author

- Registered: 2004-06-03
- Posts: 337
Re: ign_password_protect
melly – fix the database issue and I suspect that the problem will go away. For the most part, the headers ign_password_protect should be sent before any data is sent to the browser, but because the error you saw is part of the initial queries txp does to establish the environment, I suspect it’s send the error to the browser before the plugins are loaded. Let me know if you continue to have issues after the database is repaired, and I’ll dig into that further.
And then my dog ate my badger, and the love was lost.
Offline