Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#541 2008-03-28 17:40:45

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

Re: ign_password_protect

Actually, now that I look at it, I have no idea what is creating that table. It’s not ign_password_protect, and it’s not a core table. It threw me because I see that table in my sandbox install, but that could have been from testing any number of plugins.


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

Offline

#542 2008-04-01 12:45:46

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: ign_password_protect

Igner:

Sorry for the delay in getting back to you. Since your last comment, even though you said it was not related to your plug in, I figured out how to load the table. Thank G-d for the internet. What I wound up having to do was make this change:

CREATE TABLE txp_priv (
id int(8) NOT NULL auto_increment,
priv varchar(128) NOT NULL default '',
`1` tinyint(1) NOT NULL default '0',
`2` tinyint(1) NOT NULL default '0',
`3` tinyint(1) NOT NULL default '0',
`4` tinyint(1) NOT NULL default '0',
`5` tinyint(1) NOT NULL default '0',
`6` tinyint(1) NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM;

Unfortunately (or fortunately) I now know this had nothing to do with the original problem. I am still getting the message “Restricted Area” when I go to the Extension Area. I am allowed to select tabs that have Mary’s Plug Ins, but ign_user_mgmt does not appear.

The I found this thread which describes the exact problem I am experiencing.

I posted there and Rudd responded with the answer.

add_privs('ign_user_mgmt', '1,2'); is missing.

When I added this to the code, the tab appeared. :)

Thanks again for all your help.

progre55

Last edited by progre55 (2008-04-01 13:16:41)

Offline

#543 2008-04-01 16:06:45

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

Re: ign_password_protect

progre55 – I just realized that I must have made a couple modifications to my archived source of 0.4.2d to correct that (bad habit of mine, thank god for version control). which explains why I wasn’t seeing a problem. it’s also not an issue in the current version, (which, BTW, adds a fair amount of additional / improved functionality, so is worth upgrading to when time permits).


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

Offline

#544 2008-04-01 16:16:09

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: ign_password_protect

igner:

Thanks.

I will definitely upgrade and look forward too using the newest version in upcoming projects.

progre55

Offline

#545 2008-04-04 05:31:20

typeshige
Member
From: USA
Registered: 2005-08-11
Posts: 151
Website

Re: ign_password_protect

I’m still having problems. I tried two sites I’m running which have different plugins and neither work.

Do you have any ideas? Thanks

Shige

igner wrote:

@typeshige – are you still having issues with the login form?

@progre55 – What version of TXP are you using?

Offline

#546 2008-04-04 06:12:49

typeshige
Member
From: USA
Registered: 2005-08-11
Posts: 151
Website

Re: ign_password_protect

Ok, so I think I figured it out and maybe this is a feature.

So I’m using .htaccess to password protect my development site and when you login Apache sets the server variables PHP_AUTH_USER and PHP_AUTH_PW. This seems to throw things off since the plugin seems to want to use that as the name and password pair to authenticate.

For now the .htaccess name/password is different than the one I want to use to pass to ign_password_protect

I can do a work-around, but I just wanted to see what you think of this and if this is intended.

Thanks.

Offline

#547 2008-04-04 06:25:47

typeshige
Member
From: USA
Registered: 2005-08-11
Posts: 151
Website

Re: ign_password_protect

I thought I was clever and created an account on my development site that matches the name/password I used on my .htaccess.

This is the result:

A problem occured while loading the plugin: ign_password_protect -> Notice: Undefined index: nonce on line 462

plugin/ign_password_protect.php:133 ign_doTxpValidate()
textpattern/lib/txplib_misc.php:452 include()
textpattern/lib/txplib_misc.php:555 load_plugin()
textpattern/publish.php:109 load_plugins()
index.php:39 include()

Offline

#548 2008-04-04 07:03:20

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

Re: ign_password_protect

@typeshige – the plugin has two modes, either inline, or browser-based. To do the browser-based, the plugin tests for the presence of php_auth_user and auth_pw, and if present, and attempts to validate against those first. Hence the problem logging in.

On the second – you should be able ignore the notice – that’s just an issue of my not checking to see if a variable’s set before testing against it. If you set the site status to Live, then the notice will be suppressed, and you won’t see it either.

Hope that helps.


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

Offline

#549 2008-04-04 15:30:18

typeshige
Member
From: USA
Registered: 2005-08-11
Posts: 151
Website

Re: ign_password_protect

@igner: Thanks! That was helpful.

Offline

#550 2008-04-04 16:12:46

typeshige
Member
From: USA
Registered: 2005-08-11
Posts: 151
Website

Re: ign_password_protect

So I have at least two options I’m considering:

1. If the user is not logged-in, have a hidden div with the login form that can be shown when they click “Login”. This is a non-secure page. An example is the way you login to Digg
2. Have the “login” button go to a secure page with the login form there. Is this the way to go?

If I want to have login appear on its own page, what are some strategies that have worked? i.e. Should I create a section called “login” and display the form from there? It does seem kind of wasteful to create a section just for that, so I was wondering if there are other elegant solutions.

Thanks,
Shige

Offline

#551 2008-04-04 17:14:21

typeshige
Member
From: USA
Registered: 2005-08-11
Posts: 151
Website

Re: ign_password_protect

At any time, if my questions seem like they’ve been covered already please let me know! I always try to do a basic search, but I think many of my questions have probably been asked by now… so please bear with me.

So, I made a section called “login” to display the login form. I can login and it’s dandy. I want to return to the home page if they’re logged in. What’s the best way to do that?

I saw this tag:

<txp:ign_if_logged_in><txp:else /></txp:ign_if_logged_in>

Is it possible to do a redirect if they’re logged in using that tag?

Thanks,
Shige

Offline

#552 2008-04-04 18:55:24

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

Re: ign_password_protect

Right now you could do a redirect with the if_logged_in logic by doing a meta-refresh – not 100% reliable, but it’s the best option at this juncture.1 So in the head of the login page, you’d have:

<txp:ign_if_logged_in><meta http-equiv="refresh" content="0;http://mysite/newsection/" /></txp:ign_if_logged_in>

That should do the trick – alternatively, set the refresh timeout to something a bit more reasonable – say 5-10 seconds, and for the body have something along the lines of:

<txp:ign_if_logged_in>
Put your success message here, and the redirect link so people can jump to the target page faster than the refresh time
<txp:else />
Put your login call here.
</txp:ign_if_logged_in>

Let me know if that makes sense.

1 I am (and have been for a while) planning on incorporating redirect functionality into the plugin at some point.


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

Offline

Board footer

Powered by FluxBB