Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#181 2006-02-20 03:37:49

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

Re: ign_password_protect

For the login message, change the IGN_NOT_LOGGED_IN constant toward the top of the plugin. For the logout message, change the following
<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.’”>logout</a>’;
</code>

Hope that helps.


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

Offline

#182 2006-03-08 12:16:47

aslsw66
Member
From: Canberra, Australia
Registered: 2004-08-04
Posts: 342
Website

Re: ign_password_protect

I know that igner has done a fantastic job of responding to all of our picky requests, but here’s another one …

Is there some way to set up new users in the alternate database with an existing password and suppress the email that goes out. I’m thinking of setting up a site for a small rural fire brigade (max 40 members) and would like to set up each user in bulk, using their id number as the initial password and then inform them at one of our meetings that they can log in with their name and id number. In this way, I could control (1) how they find out that the site is now available and (2) their initial password to make life easier.

I’ve had a look in the code, but I’m no PHP guru and it’s all Greek to me (as we say – I assume if I was Greek I would say it’s all Aussie to me!)

Thanks for any help. Great plugin.

Offline

#183 2006-03-08 14:18:01

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

Re: ign_password_protect

two options:

1) use your own email address at account creation time, then change it later. This is the easiest option, but means you’d have to create the account, then change the email address. Kind of tedious, really, but it’s an option.

2) Alternatively, it’d be relatively trivial to write some sql to do the insert directly, assuming you’ve got access to phpMyAdmin or some other means for accessing mysql directly.

<blockquote>insert into ign_users (name, pass, RealName, email, privs) VALUES
(‘name’, password(lower(‘pass’)), ‘RealName’, ‘email’, privs),
(‘name2’, password(lower(‘pass2’)), ‘RealName2’, ‘email2’, privs2);</blockquote>

Replace the italics with the appropriate values, of course, and repeat the value list for each user you want to add (be sure to separate with commas). I’d save the sql in a text file, then use phpMysqlAdmin to insert from the textfile. (If you have shell access, you could also use mysql -u username -p database < textfile where username is the database username, database is the name of your txp database, and textfile is the name of the textfile you’ve saved your sql to.)


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

Offline

#184 2006-03-09 05:26:09

aslsw66
Member
From: Canberra, Australia
Registered: 2004-08-04
Posts: 342
Website

Re: ign_password_protect

Thanks igner. That’s what I really like about this forum, being reminded of the things I should know but totally forget.

Believe it or not, I actually learnt SQL at university but now I’m on the wrong side of 40 … I’m using rss_admin_db_manager and just plugged in the SQL to create a new user and hey presto it works.

Great plugin plus great after ‘sales’ service! Thanks again.

Offline

#185 2006-03-21 04:40:46

chariscomp
Member
Registered: 2006-03-02
Posts: 14

Re: ign_password_protect

Hello,

I am trying to use your great plugin on my church’s web site. I had it working fine until I selected the use of the alternate database. Now, I can’t login at all. I always get the message that indicates it thinks it is not a valid username and password combination. What do I need to do to make this work? I would prefer to use the alternate table. I have looked at my database using the mysql command line client and I do have a ign_users table that appears to be populated properly. Any suggestions on how to resolve this?

My page markup looks like this:
<code>
<txp:ign_password_protect login_msg=“You must log in to view these resources. If you don’t have a login, please contact the church.” err_msg=“Error, dude!”>

<txp:if_category name=“directory”>
<txp:if_article_list>
<h2>Church Directory</h2>
</txp:if_article_list>
<txp:chh_article_custom form=“directory_single” listform=“directory_list” section=“member-resources” category=“directory” limit=“9999999” sortby=“Title” sortdir=“asc” />
<txp:else /> <txp:article limit=1 form=“static_article” sortby=“custom_1” />
</txp:if_category>
<txp:if_article_list>
<txp:if_category name=“directory”>
<p>* Part of our church family, but not a church member</p>
</txp:if_category>
</txp:if_article_list>
</txp:ign_password_protect>
</code>

This was working when using the txp_users database. Thanks for any help anyone can give. Also, it doesn’t show the login_msg when prompting for the password, but it does show the error message when there is an error.

Thanks!

Joshua

Offline

#186 2006-03-21 05:08:26

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

Re: ign_password_protect

Joshua,

Off the top of my head, I can’t think of a reason that one would work and the other not – it’s the same table structure, same routine, just hitting a different table. Does it work again if you go back to the txp_users table?

As far as not displaying the login_msg, is that only when using the ign_users table, or is this also an issue when using the txp_users table?

If you want to email me details, I can take a look.


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

Offline

#187 2006-03-23 12:54:01

dog_biscuits
Member
Registered: 2005-10-14
Posts: 10

Re: ign_password_protect

Hi,

I’m using this plugin along with mem_self_register and I’ve encountered a problem with usernames that have an underscore character in them.

Registration succeeds, but the user cannot login (gets the IGN_LOGIN_ERR error string)

could this be something to do with the ign_validate function adding slashes before underscore characters?

$safe_user = strtr(addslashes($user),array('_' => '\_', '%' => '\%'));

<p>thanks,
d_b</p>

Last edited by dog_biscuits (2006-03-23 12:54:22)

Offline

#188 2006-03-23 20:25:32

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

Re: ign_password_protect

dog_biscuits: you are correct. Not sure when it changed, but TXP itself used to not authenticate names with underscores. I’ve updated the plugin to reflect this; grab the latest version.

Also in this update:

-cache control code to (hopefully) prevent proxies from caching protected pages. Note: This has NOT been tested. If you have access to a couple machines behind a proxy server, and are willing to test this, please let me know.
-addressed an issue with the ign_users table being created with the incorrect character set on MySQL 4.1 and later. Thanks to chariscomp for granting access to his install so I could track down this bug.
-sundry minor back-end tweaks


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

Offline

#189 2006-03-24 09:26:08

dog_biscuits
Member
Registered: 2005-10-14
Posts: 10

Re: ign_password_protect

Thanks for the quick response igner.

d_b

Offline

#190 2006-03-24 14:42:07

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

Re: ign_password_protect

and thanks to you for doing the legwork. saved me a bunch of effort.


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

Offline

#191 2006-04-01 11:25:26

aslsw66
Member
From: Canberra, Australia
Registered: 2004-08-04
Posts: 342
Website

Re: ign_password_protect

Everyone else seems to have this working smoothly so I feel a bit stupid… I have deleted and re-installed the plugin several times on a personal site but keep hitting the following problem.

At the moment, all I’m testing is a simple login form, with only one user in the ign_users table. If I enter an incorrect name/password combination, I get the error message. But if I enter the correct name/password combination, I get the following:

<code>A problem occured while loading the plugin: ign_password_protect -> Warning: ign_dotxpvalidate(_update.php): failed to open stream: No such file or directory</code>
<code>A problem occured while loading the plugin: ign_password_protect -> Warning: ign_dotxpvalidate(): Failed opening ‘_update.php’ for inclusion (include_path=’.:/usr/local/lib/php’)</code>
<code>Please reload</code>

I know I have had this working before, and for the life of me I can’t figure this out. Any ideas anyone?

Offline

#192 2006-04-01 13:19:14

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

Re: ign_password_protect

@aslsw66 – What version of the plugin are you using?

Using phpMyAdmin or some other SQL tool – take a look at the ign_users table. There should be a value in the “nonce” column. If there isn’t, insert a value (any value), and try to login again.


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

Offline

Board footer

Powered by FluxBB