vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   password protection (https://vborg.vbsupport.ru/showthread.php?t=52404)

BrettPower 05-01-2003 04:16 AM

password protection
 
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:

PHP Code:

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.
PHP Code:

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

mr e 05-01-2003 05:11 PM

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

Brad 05-01-2003 10:35 PM

Use this insted, it will load a login form.

PHP Code:

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?

Brad 05-02-2003 05:57 AM

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.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


All times are GMT. The time now is 08:36 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00995 seconds
  • Memory Usage 1,742KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete