Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#811 2011-09-26 10:46:21
Re: ign_password_protect
Hi Anura
There is such a feature on mem_self_register plugin (reset password, change password, …).
Cheers
Offline
#812 2011-09-26 11:06:42
Re: ign_password_protect
aslsw66 wrote:
I assume there is nothing within the current
ign_password_protectfunctionality to help me out, because it immediately writes to thelast_accessfield in theign_userstable on the first login.
Hmm, yeah a tricky one. Both Txp’s login mechanism and ign_pw_protect set the last_access immediately so I think the only way to do this would be to hack the plugin. Since 4.4.0 you can separate the login process by doing a query-only credentials check without setting the last_access. So this is the process igner would probably use:
- check login is valid without updating last_access (call
txp_validate()with third arg set false) - assuming (1) passes, test last_access field: set a flag depending on content
- call
txp_validate()again (with third arg=true or omitted) to set the last_access and log the person in
Once the ign_if_logged_in (or other tag) has been retrofitted with the ability to test the status of the flag set in step 2, it’s game on (at least, I think that’d work).
Last edited by Bloke (2011-09-26 11:11:12)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#813 2011-09-26 14:09:28
Re: ign_password_protect
The other option I was thinking was to add a new field to the ign_users table for the first login. If it’s the first login, I could display the welcome message and then update it using smd_query. It doesn’t sound ideal because of (1) overhead from additional database queries and (2) it’s another field to add to the table.
I’ll try to play with both options, but frankly the database route is easier for me (but not everything worth doing in life is necessarily easy!).
Offline
#814 2011-09-26 14:28:27
Re: ign_password_protect
aslsw66 wrote:
The other option I was thinking was to add a new field to the
ign_userstable for the first login
If you’re going that route it might be easier to approach it differently with a few lines of php. Something like this (untested):
<txp:php>
global $variable, $txp_user;
$users = do_list(get_pref('aslsw66_users', ''));
if ($txp_user && !in_array($txp_user, $users)) {
// Person's first login
$variable['first_login'] = '1';
$users[] = $txp_user; // Add user to array
set_pref('aslws66_users', join(', ', $users), 'aslsw66', PREF_HIDDEN, 'text_input', 0); // Store latest user list
}
</txp:php>
That uses the txp_prefs table to keep a list of people who have logged in instead of faffing about with the users table. From that point on — you can include that code on every page via good ol’ output_form — you can use txp:if_variable to check if it’s first login time.
Last edited by Bloke (2011-09-26 14:32:19)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#815 2011-09-28 21:18:48
Re: ign_password_protect
That would still be another database query wouldn’t it? Also, part of me thinks it would be neater to keep all of the data about a user together with their record in the table (don’t talk to me about faffing about with the users table, I’ve already done it and am trying to figure out how to reverse engineer smd_bio to correct that mistake!).
Offline
#816 2011-09-28 21:40:42
Re: ign_password_protect
aslsw66 wrote:
That would still be another database query wouldn’t it?
get_pref() doesn’t incur any penalty by default but, yes, set_pref() will add one query when a user logs in for the first time.
Also, part of me thinks it would be neater to keep all of the data about a user together with their record in the table
As you wish.
reverse engineer
smd_bio
Good luck with that: I struggled to forward-engineer it ;-)
Of course, you could just add a bio field called first-login or something and ask people not to change it from the admin side (assuming you have smd_user_manager installed). If you don’t use smd_um then you can set that bio field up and just gloss over it when displaying your bio data. Use smd_query to set it to 1 after you’ve tested its value. Note to self: maybe hidden fields might be a useful addition.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#817 2011-12-14 03:36:46
- elwins
- Member

- From: Latvia
- Registered: 2011-08-29
- Posts: 80
Re: ign_password_protect
I have installed
mem_self_register 0.9.6 – Default register form works perfect, new users are in new database table and are shown in Admin panel.
ign_password_protect 0.5b4 – Default login form, and lot of mine versions dont work, always it says: “There was a problem logging in.” for new users, who are registred with mem_self_register and for TXP first and other admin users. Maybe someone can help me to activate tis login system?
Offline
#818 2011-12-14 03:51:53
Re: ign_password_protect
elwins wrote:
“There was a problem logging in.” for new users, who are registred with mem_self_register and for TXP first and other admin users.
I posted a reply to another post of yours in this thread.
I had mentioned cbe_frontauth as an alternative to ign_password protect. I don’t want to take away from ign_password_protect as it deeply ingrained now in many projects going forward so no offense intended to Igner. I’m merely seeking the best forward approaches to our questions.
I have been away from Textpattern for about a year and had had many similar questions to yours then. Since returning have had none using cbe_frontauth. May be something to do with cookies. Don’t know.
Perhaps you could give me a login to your site’s install. I’d be happy to help trouble shoot since I am hard at work with TXP again. There is huge potential under way and I’m really eager help and to learn. Also, you speak better English than I do Latvian so a look at your code would help us both.
Last edited by whaleen (2011-12-14 03:53:45)
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline
#819 2011-12-14 04:07:56
- elwins
- Member

- From: Latvia
- Registered: 2011-08-29
- Posts: 80
Re: ign_password_protect
I installed lastest version of ign_password_protect 0.6.2 and Login working, register with
mem_self_register 0.9.6
mem_form 0.8.4
working too, but now is this Error serie:
Ar spraudņa ielādi ir radušās problēmas – Problems with plugin
Ar spraudņa ielādi ir radušās problēmas: ign_password_protect -> Notice: Undefined index: nonce on line 494 textpattern/lib/txplib_misc.php(653) : eval()'d code:135 ign_doTxpValidate() textpattern/lib/txplib_misc.php:653 eval() textpattern/publish.php:118 load_plugins() index.php:44 include() tag_error <txp:mem_self_register_form form="u_register_form" /> -> Notice: Undefined index: txphorum_mem_Body on line 27 txphorum_mem() textpattern/lib/txplib_misc.php:695 call_user_func_array() textpattern/lib/txplib_misc.php(540) : eval()'d code:203 callback_event() textpattern/lib/txplib_misc.php(653) : eval()'d code:421 mem_form() textpattern/publish.php:1188 mem_self_register_form() textpattern/publish.php:1100 processTags() textpattern/publish.php:538 parse() index.php:45 textpattern() tag_error <txp:mem_self_register_form form="u_register_form" /> -> Notice: Undefined index: RealName on line 457 mem_self_register_form_submit() textpattern/lib/txplib_misc.php:695 call_user_func_array() textpattern/lib/txplib_misc.php(540) : eval()'d code:203 callback_event() textpattern/lib/txplib_misc.php(653) : eval()'d code:421 mem_form() textpattern/publish.php:1188 mem_self_register_form() textpattern/publish.php:1100 processTags() textpattern/publish.php:538 parse() index.php:45 textpattern()
This is about 2nd month while I am working with Textpattern, and I’m glad that I installed it on my computer! :)
Last edited by elwins (2011-12-14 04:13:48)
Offline
#820 2011-12-14 10:18:31
Re: ign_password_protect
elwins wrote:
Notice: Undefined index: txphorum_mem_Body on line 27
That implies you’re using TXPhorum. If so, are you using the publicly available version from Ben’s site (v0.3)? There were a number of issues with it that I’ve since tracked down and fixed, which may mend at least one of those two errors.
If you are using it and would like my newer version then just get in touch. Actually I should probably make it available as it is (perhaps as a beta), but I do have a little work to do on it when I get some time. I wanted to rip the default theme apart to make it look prettier out of the box, as well as using it to show off new features like txp-categories-as-sub-forums, and sticky posts.
Either way, both of those errors are just warnings that you can more than likely ignore. If it seems to work, you can take solace in the fact the messages will disappear when you set your site to Live mode.
Last edited by Bloke (2011-12-14 10:19:53)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#821 2012-03-14 15:58:39
- Teemu
- Member
- From: Shanghai
- Registered: 2010-04-27
- Posts: 60
Re: ign_password_protect
I’ve got some trouble with the ‘Also authenticate against txp_users?’ setting. I use alternate database and on first setup this function will copy users from txp_users table to the ign_user table. However if later users will be added to the txp_table, and I will try to update ign_users table, nothing happends. New users from txp_users are not copied to the ign_users table.
Nor will the checkbox state of ‘Also authenticate against txp_users?’ save.
Is this function only supposed to be used on setup?
Offline
#822 2012-07-11 23:28:56
Re: ign_password_protect
I’m not sure what I’m doing wrong. I installed ign_password_protect v0.6.2 on txp 4.4.1. I am using it with the regular txp users table. It works just fine for all users except for the ones with privilege 0 (none).
The plugin instructions say:
privs: Comma separated list of privilege levels to compare against.
If omitted, plugin simply checks for account existence (including privs = None).
This is my code:
<txp:ign_show_login />
<txp:ign_if_logged_in>
content for logged in users
<txp:else /></txp:ign_if_logged_in>
I’ve also tried it with <txp:ign_if_logged_in privs="0">content for logged in users<txp:else /></txp:ign_if_logged_in> to no avail.
if the user has a privilege level of none, then it always says: “There was a problem logging in.” (I’ve double-checked that the password is correct)
Last edited by photonomad (2012-07-11 23:51:20)
Offline
#823 2012-07-12 07:59:01
Re: ign_password_protect
correct me, if im wrong, but i guess that was due to a security update in txp 4.4.1. not possible any more to log in with priv 0.
Offline
#824 2013-12-06 11:29:12
- j0nr
- Member
- Registered: 2013-12-06
- Posts: 10
Re: ign_password_protect
Hi, New Textpattern user here. I have my installation set up and working but I cannot for the life of me figure out how I am supposed to setup this ign_password_protect plugin.
I have the plugin installed, but my lack of understanding on Textpattern admin-ing is a little green and I don’t know where I am supposed to be putting these tags to make it work.
If someone could explain or just link to some articles explaining how I might achieve the following, I would be really grateful:
I want a Public and Private section. (I have created my private section).
To all public (non-logged in members), by default, they just see a list of Public articles and know nothing of th existence of the Private section.
Once logged in (or trying to access via a link) the Private section becomes visible.
Thanks so much!
Jon
Offline
#825 2015-01-02 19:22:47
- pierlu
- Member
- Registered: 2014-08-12
- Posts: 153
Re: ign_password_protect
They nearly succeeded finally using the plugin ign_show_login, I created the following form:
<div class="login">
<txp:ign_show_login>
<form name="login" action="a href="<txp:section name="il-materiale" />"
<table border="0" cellspacing="5" cellpadding="5">
<tr>
<div class="utente"><td>Utente:</td><td><input type="text" name="nome" size="25" maxlength="25" value="pierlu" required></td>
</tr><tr></div>
<div class="password"><td>Password:</td><td><input type="password" size="25" value="pierlu" ></td>
</tr><tr></div>
<tr><td></td><td><input type=submit value="Invia i Dati" onClick="utente(this.form)"><input type=reset value="Annulla"></td></tr>
</table>
</form>
</txp:ign_show_login>
</div>
But I entered username and password redirects the home and not to the section indicated in the code why?
Offline