Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Dec 1999
Posts: 37
Power User
Power User
Offline
Joined: Dec 1999
Posts: 37
Hi,

I have been using a perl script that was posted here a long time ago (w3t days) to synchronize a .htaccess password file with the passwords in the forum database.

After upgrading from 5.4.3 to 6.1.1 the script still works and creates the userfile.
However the password encryption has changed to md5 on ubbt. As new users are registered and old users change their passwords the database contains passwords encryped with the old and new methods.

Now the password file the script creates contains some passwords encrypted the old way, and some passwords encrypted with md5 the new way.

Since i used AuthType Basic in my .htaccess the newly md5 encrypted passwords are not recognized.

If I make the proper changes to use AuthType Digest is it backwards compatible to also accept the old style encrypted passwords? If that is not possible. Is there a way i can tell the database to re-encrypt everyones current passwords with md5? so i can exclusively use AuthType Digest.

Thanks


Here is the script i use:

#!/usr/bin/perl
################################################
# A script for converting users in the w3t_Users table into an
# .htaccess file
# Edit the $path variable and run this from the command line.
# Make sure you have permission to create and write to files in the
# directory you specify with $path.
# Rick Baker [][email protected][/]
################################################
use w3tvars qw(%config);
use w3t qw($dbh);
use strict;
# --------------------------
# Path to the .htaccess file
my $path = "/home/httpd/databaseusers/dbusers";
# -----------------------
# Connect to the database
w3t::db_connect();
# -----------------------------------------------------------
# Grab all of the usernames and passwords out of the database
my $query = qq!
SELECT U_Username,U_Password
FROM w3t_Users
!; my $sth = $dbh -> prepare ($query) or die "Query syntax error: $DBI::errstr. Query: $query";
$sth -> execute() or die "Can't execute query: $query. Reason: $DBI::errstr";
# ------------------------------------------------
# Now we cycle through the rows and print them out
open (FILE,">$path") or die "Can't open $path for writing.";
while (my ($User,$Password) = $sth -> fetchrow_array) {
print FILE "$User".":"."$Password\n";
}
close (FILE);


tgnb
Sponsored Links
Entire Thread
Subject Posted By Posted
password encryption and .htaccess authentication tgnb 12/17/2002 4:38 PM
Re: password encryption and .htaccess authentication dimopoulos 12/17/2002 5:31 PM
Re: password encryption and .htaccess authenticati tgnb 12/17/2002 6:11 PM
Re: password encryption and .htaccess authenticati dimopoulos 12/17/2002 7:23 PM
Re: password encryption and .htaccess authenticati tgnb 12/20/2002 4:04 PM
Re: password encryption and .htaccess authenticati dimopoulos 12/20/2002 7:04 PM
Re: password encryption and .htaccess authenticati tgnb 12/20/2002 10:43 PM
Re: password encryption and .htaccess authenticati Dave_L_dup1 12/20/2002 11:19 PM
Re: password encryption and .htaccess authenticati tgnb 12/23/2002 6:13 PM
Re: password encryption and .htaccess authenticati Dave_L_dup1 12/23/2002 7:34 PM
Re: password encryption and .htaccess authenticati tgnb 12/23/2002 10:14 PM
Re: password encryption and .htaccess authenticati Dave_L_dup1 12/23/2002 11:37 PM
Re: password encryption and .htaccess authenticati tgnb 12/24/2002 12:21 AM
Re: password encryption and .htaccess authentication mgdale2 01/07/2004 10:01 PM

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
Ruben Rocha
Ruben Rocha
Lutz,FL,USA
Posts: 254
Joined: January 2000
Forum Statistics
Forums63
Topics37,575
Posts293,932
Members13,824
Most Online6,139
Sep 21st, 2024
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,835
Greg Hard 4,625
Top Posters(30 Days)
Gizmo 1
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-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)