View Full Version : password protection
BrettPower
05-01-2003, 04:16 AM
I have searched for the answer to my question, but I could not find it. If it is there, sorry for the repeat post.
Anyways, does anybody know how to password protect a .php file? I have vbHome installed in root directory, but I don't want anybody to see that page untill they are verified.
Any suggestions?
Thanks,
Brett
editor@hoosierairnews.com
Velocd
05-01-2003, 04:44 AM
When you say verified, I'm assuming you mean verified to ensure the person is a member of the forum?
If that is the case, then just make sure whatever PHP file the member is accessing has require("global.php"); located in it near the top of the file, and shortly below this line of code add:
if($bbuserinfo[userid] == 0){
eval('standarderror("'.gettemplate('error_noregister').'");');
exit;
}
BrettPower
05-01-2003, 05:54 AM
Velocd,
Sorry about the confusing question.
I have a web site for me and my family members. Right now, I have VB 2.2.9, and vbHome 3.8.
On the vbHome page, the latest x-number of newest threads are shown. I do not want anyone to "walk in off the street" and see what my family is talking about. Obviously, some of it may be private and personal at times. I need a way to either only allow members to see the latest threads on the vbHome page, or password protect the vbHome page so my relatives have to enter a username and password before even getting to the site. Make sense?
My host tells me that I can't password protect my root directory. I thought about moving vbHome into a password protected directory, and then creating a redirect that points to the vbHome directory. Can't figure out how to do that, though.
Thanks,
Brett
Velocd
05-01-2003, 12:35 PM
That's a bit different than what you had asked in your first post, but thanks for clarifying.
I don't use the newest vBhome, so this may be a bit difficult for you to understand, but the easiest way to hide the latest threads for only members is to find in the vBhome index.php the whole section where the latest thread code lies, and place it inside an if-statement checking if the person is a member or not.
if($bbuserinfo[userid] > 0){
[place latest thread PHP code here]
}
Go to your homepage now and check it out as a guest, then what I'm guessing you should see is a blank area where the latest threads usually shows.
BrettPower
05-01-2003, 03:15 PM
Well, that didn't work. Seemed logical, though. Any other suggestions? I have nothing else to do today!
Thanks,
Brett
at the top of the index do what Velocd said only if their id = 0 give them the login info and nothing else on the main page
BrettPower
05-01-2003, 06:36 PM
That did work, guys. However, there is no way for the registered users to log in.
If they are a registered user, but not logged in, they need to have the ability to log in. And, after doing so, they would be re-directed to another web page, like index2.php (i wont make it that easy).
Make sense?
-Brett
Use this insted, it will load a login form.
if ($bbuserinfo[userid] == 0)
{
show_nopermission();
}
BrettPower
05-02-2003, 02:34 AM
I have the log in form loading!!! I am really close here.
Right now, the log in process works, but index.php is not loading after the login process. I working with the templates under the admin interface to see what is going on.
Thanks,
Brett
BrettPower
05-02-2003, 02:41 AM
Got it!!!
Thanks a bunch. You saved me a lot of work. I just had to change the path in the template of member.php to /forum/member.php. That was it. Duh!
-Brett
BrettPower
05-02-2003, 03:12 AM
Everything works great, but two minor problems.
The image in the upper left corner, vb_bullet.gif, and the drop-down menu at the bottom are not linked right. I am unable to locate the template that corrosponds to the login page. Does anybody know where it is?
change the images folder to the full path (www.mysite.com/forum/images) and it will work.
BrettPower
05-02-2003, 06:09 AM
vb_bullet.gif is the only image that does not show up. It is in the same folder as all the other VB images. I checked the path of the image, and it is all screwed up. I am pretty darn sure that if I can track down the template to this particular login screen, I will be able to correct the image path.
The path is like this;
http://www.mydomain.com/forum/images/vb_bullet.gifhttp://www.mydomain.com/forum/images/vb_bullet.gif. The path is in there twice.
As far as the hyper-link paths go, and the links in the drop down menu go, they link to files in the same directory (root). They need to link to fiels in /forum. I just can't find the right template!
-Brett
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.