Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Sep 2004
Posts: 2
Lurker
Lurker
Offline
Joined: Sep 2004
Posts: 2
I am a new user of version 6.4.4 and would like a way to automatically creata entries for an htpasswd file that I use on a companion website when a new users registers for the forums.

I have done this with other forum software, but ubbthreads is different enough that I'm having a hard time finding the right place and tools to do this. I'm assuming it's easy and everyone knows what to do but me. Hoping someone will give me that wisdom so I can move on to hard problems :-)

Regards,
Dave

Sponsored Links
Joined: Aug 2000
Posts: 1,290
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,290
Paging LK.


- Custom Web Development
http://www.JCSWebDev.com
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
I don't think I know anything more than dzar does about Threads' registration procedures

Thanks for referring me tho

Joined: Sep 2004
Posts: 2
Lurker
Lurker
Offline
Joined: Sep 2004
Posts: 2
[]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.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Posts: 70
Joined: January 2007
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)