Previous Thread
Next Thread
Print Thread
Hop To
#241436 01/29/2011 1:38 PM
Joined: Apr 2010
Posts: 15
M
stranger
stranger
M Offline
Joined: Apr 2010
Posts: 15
Hi All, I am currently using ccBill which writes a user name and MD5 hashed password to the text file .htpasswd.

I want to convert the Apache authorization to write the user name and password directly to the ubbt_USERS table. Is this possible?

Does anyone have information and configuration examples of Apache site config files along the following lines?

<Directory /home/domain/public_html/membersonly>
AuthType Basic
AuthName "Add your login message here."
AuthMySQLHost localhost
AuthMySQLUser db_user
AuthMySQLPassword db_password
AuthMySQLDB database_name_used_for_authentication
AuthMysqlUserTable ubbt_USERS
AuthMySQLPwEncryption MD5
AuthMySQLEnable on
require valid-user
</Directory>

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
yes, it is possible

i've done this for 2 peeps and it is a non-stock modification

you really don't have to modify apache at all. CCBill just writes the .htaccess file for you when they install their software.

ubbthreads needs to detect that and act accordingly after that smile

Joined: Apr 2010
Posts: 15
M
stranger
stranger
M Offline
Joined: Apr 2010
Posts: 15
How would I go about that? Is there any code about for that in the public domain?

The *best* solution would be for the ccBill cgi to write to the ubbt_USERS table but that might be asking a bit much.

Using a db would be much more efficient than the .htpasswd text file.

Joined: Jun 2006
Posts: 16,532
Likes: 150
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,532
Likes: 150
This is what I use, you'd have to adapt it...

Code
# Start Authentication
AuthName "Auth Name"
AuthType Basic

# Database settings:
AuthMySQLHost localhost
AuthMySQLUser [username]
AuthMySQLPassword [password]
AuthMySQLDB [db]

# User table
AuthMySQLUserTable ubbt_USERS
AuthMySQLNameField [user]
AuthMySQLPasswordField [pass]

# User Roles tables
#AuthMySQLGroupTable data_staff
#AuthMySQLGroupField group
#AuthMySQLGroupCondition "access_cp=1"

# Where clauses
#AuthMySQLUserCondition "access_cp=1"

# Do it to it!
AuthMySQLPwEncryption md5
AuthMySQLEnable On
require valid-user


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Apr 2010
Posts: 15
M
stranger
stranger
M Offline
Joined: Apr 2010
Posts: 15
Thanks for that. I just contacted ccBill and they modified my cgi script to write the info to the database direct. These are the settings for my case. Can anyone comment on whether or not they look right?


$AUTHTABLE = 'ubbt_USERS';
$DATAHOST = 'localhost';
$DATANAME = 'asiabarhop';
$DATAUSER = 'root';
$DATAPASSWORD = 'secret';
$USERFIELD = 'USER_LOGIN_NAME';
$PASSWORDFIELD = 'USER_PASSWORD';
$PASS_BKUP = '1';

Joined: Apr 2010
Posts: 15
M
stranger
stranger
M Offline
Joined: Apr 2010
Posts: 15
I guess I will still need to edit my Apache site config file as above to make Apache auth work?

Do those settings go in the <DIRECTORY> block?

Last edited by markhorrocks; 01/29/2011 3:06 PM.
Joined: Apr 2010
Posts: 15
M
stranger
stranger
M Offline
Joined: Apr 2010
Posts: 15
An additional question, how would I go about writing the other fields such as USER_IS_APPROVED, USER_DISPLAY_NAME and USER_REGISTRATION_EMAIL?

Last edited by markhorrocks; 01/29/2011 3:16 PM.
Joined: Jun 2006
Posts: 16,532
Likes: 150
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,532
Likes: 150
My code goes into your .htaccess


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Apr 2010
Posts: 15
M
stranger
stranger
M Offline
Joined: Apr 2010
Posts: 15
I am not using .htaccess so that means it goes into the <DIRECTORY> block of the Apache site config file in /etc/apache2/sites-available.

I may have bitten off more than I can chew here. I am not sure how to set the other needed fields. I could set a default value for USER_IS_APPROVED but not sure about the other fields.

Joined: Jun 2006
Posts: 16,532
Likes: 150
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,532
Likes: 150
using htaccess is as simple as adding a .htaccess file to the directory, but to each their own; you can always add it to the apache config, but keep in mind that it won't be added to your site backups if you're using an automated backup script (as server configurations are generally out of the scope).


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Apr 2010
Posts: 15
M
stranger
stranger
M Offline
Joined: Apr 2010
Posts: 15
I have complete access to the server as its a cloud machine.

My original intention here was to have the ccBill signup write to the ubbThreads database but its quite impractical really. Using Postbacks it can be done but hardly worth the effort. In addition, its not desirable to use the ccBill User maintenance CGI to maintain users on ubbThreads.

What is possible is to change the authorization to use MySQL from .htpasswd. ccBill have provided a modified CGI to do that. The script also maintains a backup in the .htpasswd file. It is then a simple matter to use either .htaccess or the apache site config file to authorize from the database.

What I would like to do, however, is to integrate the user login and I'm wondering how to best approach that. Any input would be most welcome.

Joined: Apr 2010
Posts: 15
M
stranger
stranger
M Offline
Joined: Apr 2010
Posts: 15
I finally got Apache MYSQL authentication working using the following link

http://alimanfoo.wordpress.com/2010/11/17/apache-authentication-and-mysql/

ccBill provided a CGI script for me which writes to a db as well as .htpasswd

If anybody has implemented an integrated login between the ccBill authentication and their forum I would very much like to know how it was done. Thanks, sirdude and gizmo for your help.

Mark


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
PHP 8 bug in membermanage.tmpl
by phoenix011235 - 09/08/2026 7:47 PM
Are any of these legitmate?
by Baldeagle - 09/06/2026 1:37 PM
8.0.1 Patch Changelog Discussion
by isaac - 11/26/2025 1:34 PM
Upgraded to ver8 - now can't login
by phoenix011235 - 10/24/2024 8:50 AM
Who's Online Now
1 members (Phun), 259 guests, and 127 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260527)