Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#157 2005-11-10 16:45:12
Re: ign_password_protect
One easy question:
when you use alternate database, ¿users in the built-in database (i mean, the txp_users database) cannot log in to view the password protected content?.
So, in this case, if you are using the alternate database, and you are the webmaster of the site (ie. if you are a registered user in the txp_users database) you will need to have another login/password (in the altarnate database) to log into the password protected content.
Am I right?
Is there anyway to check in both databases when you are logging in?. But, of course, when someone registers himself, to be added to the alternate database.
If not, I can think the only solution is that users in txp_users database have also a user in the alternate database. But, that is two users for one person, and I’m trying to avoid that.
Last edited by maniqui (2005-11-10 16:48:10)
Offline
#158 2005-11-10 17:15:37
Re: ign_password_protect
Mmmm…
I’m reading the plug-in description (in the description col, in plug-in tab at the admin-side)
<blockquote>Password protect articles or sections; authenticates against txp_users <strong>or</strong> alternate database (ign_users)</blockquote>That “or” seems to be exclusive: you authenticate against one database or the other, but not against both.
Last edited by maniqui (2005-11-10 17:16:28)
Offline
#159 2005-11-10 17:47:08
- igner
- Plugin Author
- Registered: 2004-06-03
- Posts: 337
Re: ign_password_protect
it is exclusively one OR the other – however, at the time the alternate database is created, it is populated with the users from the existing txp_users, so pre-existing users get migrated over. I suppose I could do a join of the two tables, but it wasn’t a primary concern for me at the time. I looked at doing a failover to the txp_users table if lookup failed on the alternate, but I also wanted to minimize the number of times the plugin hits the DB, so I abandoned that concept at the time. Maybe I’ll revisit it for a future release.
And then my dog ate my badger, and the love was lost.
Offline
#160 2005-11-10 17:49:52
- igner
- Plugin Author
- Registered: 2004-06-03
- Posts: 337
Re: ign_password_protect
step21 – the user credentials get set in the same way regardless of the authentication method, so I’m not sure what might be happening there.
darrepac – this is indeed an issue with caching; it’s something I’ve needed to address but haven’t had the opportunity to set up the necessary test environment. Anyone behind a cache / proxy interested in helping me test, contact me off list.
And then my dog ate my badger, and the love was lost.
Offline
#161 2005-11-10 18:32:30
Re: ign_password_protect
Thanks for replying, igner. <blockquote>however, at the time the alternate database is created, it is populated with the users from the existing txp_users</blockquote>
This doesnt seem to work for me.
I have only one user in txp_users, the “webmaster” user. But when the plug-in creates the ign_users, I get 0 records in that table.
And, in the case it works (i mean, if existing records from txp_users are copied to the ign_users)… how do you manage the following?
- when you delete a user in one table, is it deleted from the other one?
- when a user (in txp or ign database) changes his password/email, is it updated in both tables?
Maybe, the idea of hitting the DB twice is not a bad idea.
This way you can have one record per user and not two (duplicated) records.
Also, maybe in future releases, it would be possible to move users from one table to the other.
This will become a nice feature if a user in ign_user gets so involved with the site that he/she deserves to access to the admin side.
So, you move her/him from ign_users to txp_users.
Offline
#162 2005-11-10 19:12:20
- igner
- Plugin Author
- Registered: 2004-06-03
- Posts: 337
Re: ign_password_protect
odd, not sure why the user isn’t getting migrated. it’s a one shot deal, copying the users from txp_users over to ign_users. no reverse management – if you change in one place, it doesn’t propagate to the other, etc.
i’ve toyed with the idea of being able to push users from one table to the other – it’d be relatively trivial to accomplish on the back end…it’s just a lot of planning and effort into building a sensible UI, and I simply haven’t had the time (or the incentive, for that matter) to do so.
right now I’m pretty much in bug-fix / maintenance mode on this until I wrap up some other projects, but i will definitely take into consideration ALL suggestions offered up – so please, keep ‘em coming.
And then my dog ate my badger, and the love was lost.
Offline
#163 2005-11-16 03:43:06
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: ign_password_protect
igner, could you add an option on <txp:ign_logged_user />
to NOT add link to log out ?
i.e. I just want to display the logged-in user’s name (and provide a stand-alone link to “log out”)
Offline
#164 2005-11-16 19:01:50
- igner
- Plugin Author
- Registered: 2004-06-03
- Posts: 337
Re: ign_password_protect
I can put it on the list – in the meantime, around line 136 you can change:
<code>
$user= ($verbose) ?
graf(gTxt(‘logged_in_as’).’ ‘.$u_display.br.’<a href=”?logout=1” alt=”’.$alt.’” title=”’.$alt.’”>’.gTxt(‘logout’).’</a>’)
: ‘<a href=”?logout=1” alt=”’.$alt.’” title=”’.$alt.’”>’.$u_display.’</a>’;
</code>
to
<code>
$user= ($verbose) ?
graf(gTxt(‘logged_in_as’).’ ‘.$u_display.br.’<a href=”?logout=1” alt=”’.$alt.’” title=”’.$alt.’”>’.gTxt(‘logout’).’</a>’)
: $u_display;
</code>
And that should do the trick for you.
And then my dog ate my badger, and the love was lost.
Offline
#165 2005-11-16 23:03:39
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: ign_password_protect
thanx igner, appreciated
Offline
#166 2005-11-28 04:24:50
Re: ign_password_protect
Igner,
Great plugin! So I’m not using this inconjuction with the mem_self_register plugin, but I’m having issues changing the password using the self_edit tag. I change the password and have it mailed to me. The email comes in and has my new password, but surprisingly the email has a blank for my name (“Dear ,”). The new password won’t work, and the only way I can log back in is if I reset the password. As a note, I am using the alternate DB.
any ideas?
Last edited by variaas (2005-11-28 04:25:30)
Offline
#167 2005-11-28 15:19:29
- igner
- Plugin Author
- Registered: 2004-06-03
- Posts: 337
Re: ign_password_protect
variaas,
I’ll take a look at it and figure out what might be going on. Because of the overlap with Manfre’s plugin, I didn’t spend a lot of time on this particular function, but I know there were a couple places that the mail function wasn’t working as intended, and this may be one of them. I’ve been busy with other projects, but should have a bit of time to look at this and other issues with the plugin in the next week or so.
And then my dog ate my badger, and the love was lost.
Offline
#168 2005-12-27 12:32:47
Re: ign_password_protect
I know this sounds really silly, but I’ve been reading all the 7 pages repeatedly for the past few hours but I’ve yet to discover how to change the password that was given when I use the alternate database. Reset User Password isn’t what I’m thinking of, since it’ll randomly generate a new password. How do I go by this?
Oh, and on another note, I’ve been trying for ages trying to achieve this, but being a Textpattern newbie, I still am unsure how to do this. This is similar to some other posters’ questions, I think.
I have a blog site, and I’ve a category named “private” where all my private blog entries are. I want to ensure only a select few users who have the appropriate username/password to be able to see them on the main page, along with other public posts. I also know this requires editing the page template “default”, but for the life of me, been trying unsuccessfully getting it to work.
The code I was using was:
<code><txp:if_article_category name=“private”>
<txp:ign_if_logged_in>
<txp:ign_password_protect privs=“1”>
<txp:article />
<txp:if_individual_article>
<p>
<txp:link_to_prev><txp:prev_title /></txp:link_to_prev>
<txp:link_to_next><txp:next_title /></txp:link_to_next>
</p>
</txp:if_individual_article>
<txp:if_article_list>
<p>
<txp:older>Previous</txp:older>
<txp:newer>Next</txp:newer>
</p>
</txp:if_article_list>
</txp:ign_password_protect>
</txp:ign_if_logged_in>
</txp:if_article_category>
<txp:article limit=“5” />
<txp:if_individual_article> <p> <txp:link_to_prev><txp:prev_title /></txp:link_to_prev> <txp:link_to_next><txp:next_title /></txp:link_to_next> </p> </txp:if_individual_article> <txp:if_article_list> <p> <txp:older>Previous</txp:older> <txp:newer>Next</txp:newer> </p> </txp:if_article_list></code>
Let’s say I have four entries, Entry 1 being the latest while Entry 4 is the oldest. Entry 2 is placed under the category ‘private’ and as expected, will appear on the main page but only to users who have already logged in. Otherwise, other users who are not logged in are supposed to see only Entry 1, Entry 3 and Entry 4. How do I achieve this? Are the above codes correct?
Last edited by Saigo (2005-12-27 13:23:24)
Offline