Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#325 2007-01-23 01:23:40

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

Re: ign_password_protect

er, you must certainly have gotten a bad download – there’s no way any of my code would say that.

re-download and you should be set. ;)


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

Offline

#326 2007-01-23 01:26:36

szac
Member
From: Detroit-ish
Registered: 2004-09-18
Posts: 50

Re: ign_password_protect

mrdale, a write about that method would be AWESOME! I hit the forums today specifically looking for a way to do what you just described!

And yes, the wondertag was a game changer for me as well. easily managed 3 tier navigation, etc… Lovin it!

Offline

#327 2007-01-23 02:26:20

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: ign_password_protect

>igner
Woo Hoo! ;)

It’s almost working for me. Right now <txp:ign_logout_link> produces a link with no text <a href='?logout=1'alt='Logout'title='Logout'></a>. I’d really like it to say “log out, ladies” or something.

[edit]
OK, I hacked the plugin to allow the user to specify the logout link text as an attribute. Yay! Could you incorporate this (or the function thereof) in your next release?

Here’s what I did:

Find

$o[] = ">$thing</a>";

Replace it with

$o[] = ">";
$o[] = (!empty($linktext)) ? "$linktext" : '';
$o[] = "</a>";

Then Find

'id' => ''

Replace it with

'id' => '',
'linktext' => 'log out'

Last edited by mrdale (2007-01-23 02:51:45)

Offline

#328 2007-01-23 03:40:54

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

Re: ign_password_protect

actually, the way it was in the release, usage would be <txp:ign_logout_link>Logout link text</txp:ign_logout_link>. It’s part of the whole move to forms for all localization (you can incorporate the logout link however you want, wherever you want. What I neglected to do was add default text if using the self-closing form, and some built in logic to not display if not logged in. (Right now you’d need to wrap it in if_logged_in conditionals).

That’s a nice addtion, though my whole train of thought here is that I want to NOT use attributes for these sorts of things, if for no other reason than it makes the tags more cryptic for the lay person.

Of course, it’s not easy if there’s no documentation :)


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

Offline

#329 2007-01-23 04:39:53

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: ign_password_protect

Fair enough. conatiner tag it is then.

Unhacking…

Last edited by mrdale (2007-01-23 04:40:24)

Offline

#330 2007-01-23 05:08:42

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

Re: ign_password_protect

in the spirit of obfuscation, what I’ll do is allow for a linktext attribute as a fallback if $thing is empty, then fall back to a constant if both are empty. That way it’ll be impossible to generate an empty link, as happens now. nothing like three ways to do one thing :)


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

Offline

#331 2007-01-23 05:24:55

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

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

Board footer

Powered by FluxBB