Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-01-2003, 04:16 AM
BrettPower BrettPower is offline
 
Join Date: Dec 2002
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 05-01-2003, 04:44 AM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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;

Reply With Quote
  #3  
Old 05-01-2003, 05:54 AM
BrettPower BrettPower is offline
 
Join Date: Dec 2002
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 05-01-2003, 12:35 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 05-01-2003, 03:15 PM
BrettPower BrettPower is offline
 
Join Date: Dec 2002
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, that didn't work. Seemed logical, though. Any other suggestions? I have nothing else to do today!

Thanks,
Brett
Reply With Quote
  #6  
Old 05-01-2003, 05:11 PM
mr e's Avatar
mr e mr e is offline
 
Join Date: Dec 2001
Posts: 461
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 05-01-2003, 06:36 PM
BrettPower BrettPower is offline
 
Join Date: Dec 2002
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 05-01-2003, 10:35 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use this insted, it will load a login form.

PHP Code:
if ($bbuserinfo[userid] == 0
   {
    
show_nopermission();
    } 
Reply With Quote
  #9  
Old 05-02-2003, 02:34 AM
BrettPower BrettPower is offline
 
Join Date: Dec 2002
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #10  
Old 05-02-2003, 02:41 AM
BrettPower BrettPower is offline
 
Join Date: Dec 2002
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:40 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.04806 seconds
  • Memory Usage 2,256KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete