[]
L_K said:I don't think I know anything more than dzar does about Threads' registration procedures
[/]
Well, I know more, now. Seems nobody around here wanted to generate a htpasswd file for use on a web site (not necessarity for the forum software). Here is what ended up doing:
1) Obtain class.Htpasswd.php3 from
http://www.thewebmasters.net/php/Htpasswd.phtml and put it in your includes directory
2) I wrote the following update_htpass.php include file:
<?php
// .htpasswd updating
if ( !empty($pass) )
{
include("$thispath/includes/class.Htpasswd.php3");
$Htpasswd = new Htpasswd("/path_to_your/.htpasswd.php");
// call it .php so loading it with a browser results in an
// error as opposed to a text file... depends on your web server
if(!($Htpasswd->EXISTS))
{
$message = "Error creating htpasswd file";
$html -> not_right($message, $Cat);
}
// Try updating username first
$query = $Htpasswd->changePass($Login_q, $pass, "");
// If that fails (which it never should) add username as a new user
if ($query == false) {
$query = $Htpasswd->addUser($Login_q, $pass);
if ($query == false) {
$message = "Error creating htpasswd entry: " . $Login_q . " " . $pass . ". Please send this information to the administrator.";
$html -> not_right($message, $Cat);
}
}
}
// end of .htpasswd updating
?>
3) I include this in a few files (and made a few necessary changes to get the right variables... yes, I should have made this a procedure and passed things in but this was a one-time, quick and dirty hack and you can do that for me if you'd like :-) ) The files I updated are:
adduser.php
changebasic.php
admin/dochangeuser.php
admin/dodeleteuser.php <== this one simply deletes the htpasswd entry
admin/editconfig.php
If you need/want more details, let me know. It's pretty straight forward, though. The hard part was finding all the places to modify and then figuring out what fields to send to the routine to add/update/delete the data.