sundial2k
Newbie

Posts: 13
|
 |
« on: June 03, 2010, 05:44:02 pm » |
|
Hi - I'm wondering if it's possible to use an external text file (or ideally a Google Doc Spreadsheet) with a list of usernames/passwords for Password Protect. Thanks, John
|
|
|
|
|
Logged
|
|
|
|
|
zubrag
|
 |
« Reply #1 on: June 04, 2010, 02:42:43 am » |
|
Can be done for text file, but needs some changes. I'll post in a day
|
|
|
|
|
Logged
|
|
|
|
sundial2k
Newbie

Posts: 13
|
 |
« Reply #2 on: June 04, 2010, 06:03:39 am » |
|
Thanks!! I was wondering - is there a way to track the number of times one of these codes is used?
John
|
|
|
|
|
Logged
|
|
|
|
sundial2k
Newbie

Posts: 13
|
 |
« Reply #3 on: June 04, 2010, 06:33:54 am » |
|
I was just looking at Advanced Password Protect and I think this might work even better. Am I correct in understanding that I can give my admin access to MANAGER.PHP and he can log in and enter/change/add users?
John
|
|
|
|
|
Logged
|
|
|
|
|
zubrag
|
 |
« Reply #4 on: June 04, 2010, 06:40:51 am » |
|
Yes, "advanced password protect" script provides better user management than "password protect" script. But remember to backup users file sometimes as somebody reported lose of users list (possibly there is a bug)
In case you decide to update regular password protect script to load users from external file than: find this code
// Add login/password pairs below, like described above // NOTE: all rows except last must have comma "," at the end of line $LOGIN_INFORMATION = array( 'zubrag' => 'root', 'admin' => 'adminpass' );
and relace with this code
// list of users $users = file('/path/to/users/list/file/including/filename'); if (!$users) die('Cannot find users list!');
// prepare users list $LOGIN_INFORMATION = array(); foreach ($users as $user) { $u = explode(',',$user); if (USE_USERNAME) { $LOGIN_INFORMATION[trim($u[0])] = trim($u[1]); } else { $LOGIN_INFORMATION[] = trim($u[0]); } }
Note: remember to fix bolded path to the userlist file
|
|
|
|
|
Logged
|
|
|
|
sundial2k
Newbie

Posts: 13
|
 |
« Reply #5 on: June 04, 2010, 06:54:31 am » |
|
That's awesome! How do the passwords need to be formated in the external file, and I'm assuming that it should be a basic .txt file?
|
|
|
|
|
Logged
|
|
|
|
|
zubrag
|
 |
« Reply #6 on: June 04, 2010, 07:26:20 am » |
|
yes, basic txt file. Name/extension does not matter, can be anything.
users file format: username1,password1 username2,password2 ...
username/password pair delimiter defined in following line. As you can see it is set to comma. Change it if you need something else as delimiter $u = explode(',',$user);
|
|
|
|
|
Logged
|
|
|
|
sundial2k
Newbie

Posts: 13
|
 |
« Reply #7 on: June 04, 2010, 01:32:12 pm » |
|
Thanks - you made that super-easy! I appreciate your help!!
|
|
|
|
|
Logged
|
|
|
|
Kimball342
Newbie

Posts: 11
|
 |
« Reply #8 on: August 11, 2010, 12:31:38 am » |
|
What a tremendous article and helping comments, nice to see here, an amazing post, keep it Up. no doubt its a admirable post.
|
|
|
|
|
Logged
|
|
|
|
Uradelekcil
Newbie

Posts: 2
|
 |
« Reply #9 on: September 23, 2011, 07:27:16 am » |
|
very interesting article ... I hope this will continue
|
|
|
|
|
Logged
|
|
|
|
jasper2012
Newbie

Posts: 2
|
 |
« Reply #10 on: January 06, 2012, 02:27:29 am » |
|
we just would like to give a huge thumbs up for the great info you have here on this post. I will be coming back to your posr for more soon. __________________ Cost performance led 5050 online.
|
|
|
|
|
Logged
|
|
|
|
|