The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to create a "members' area" in PHP?
Hello,
I recently bought vB 3.0.9 and have installed it on a test website. It runs great. I also want to create a separate members' area, let me explain. I want to somehow password-protect an entire folder on the website. I could then post files etc there that only members would have access to. I thought on using .htaccess files but apparantly they become rather slow after a few hundred users have been added. I also want the users to be able to use their vBulletin login details to access the members area. Is it possible to write a PHP script to do this? Ideally, the PHP script would check up the same MySQL database that vB uses. Actually, I came across a link on the web that seemed to be exactly what I needed: http://php.resourceindex.com/detail/03892.html but the site isn't available I'd really appreciate any help with this! Lindsay Wilson |
#2
|
|||
|
|||
umm, it involves making a .htaccess file.
Code:
AuthName "Password Protected Area!" AuthType Basic AuthUserFile "location\of\.htpasswd" require valid-user Code:
username:password and vola ^^ lme know if that works |
#3
|
||||
|
||||
Why not just use one of the file management enhancments on here? Im sure there is at least 1 that will allow you to control by usergroup. That would be FAR easier to manage.
|
#4
|
|||
|
|||
Hi,
Pyro: Your code didn't appear in the post! Do you want to email it to me? My email is lindsay.wilson@strath.ac.uk (don't know if that'll be removed by the moderator!) The Geek: I've been looking around for file management systems on the forum, but they all seem (to me ;-) rather complex. Could you suggest any simple ones you think might do, or any other way of doing this? There's gotta be some way of protecting a folder! Thanks, Lindsay |
#5
|
|||
|
|||
|
#6
|
|||
|
|||
Hi,
I think I've solved the problem.... All the files that I want to be accessed by members only are located in a folder "secret" that is one level up from my "public_html" folder i.e. Joe Soap can't get the contents of that folder by entering it into his web browser. I wrote a couple of PHP scripts. One, getfile.php takes a filename of something in the "secret" folder as its argument (e.g. getfile.php?do=members.htm) and sends the contents of the file to the browser. (Several if-loops deal with different file types and adjust the header "Content-type: " accordingly). It even works with HTML pages that contain images if the image is loaded via getfile.php. The other script, authenticate.php acts as a login script. It basically uses a modified version of the vBulletin function verify_authentication (that's in /includes/functions_login.php) to check if a user is in the database. It also checks to see if the user has bought a subscription to the members' area (by checking the usergroupid) or if the user is an administrator. It then sets a cookie confirming that the user is authenticated. A login script, login.php, imitates the login text fields and button at the top of the main vBulletin page, and uses vbulletin_md5.js for encryption. I do have the pages hosted online, but I'd rather keep the location secret for now! :nervous: Thanks, Lindsay P.S. vBulletin is one helluva piece of coding! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|