Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 06-21-2000 Last Update: Never Installs: 0
 
No support by the author.

For those of you wondering how to make restricted pages so that only members of your vB can view them, here is a quick code example to do so. Just require this file as the very first line of whatever file that you want to require a user to have logged into the vB in order to view. Copy this code into a file and save it into the forums directory (same directory as index.php, members.php, etc.) and name it whatever you want.

Its a REALLY simple script that just checks to see if the vB cookie exist. Nothing special at all, but for those of you with no programming experience it's something to work with.

Code:
<?php

/* Here we check to see if the vBulletin cookie exist.
If it doesn't, we prompt the user to either log in or
sign up*/

  if (!$HTTP_COOKIE_VARS["bbuserid"]) {
?>

<table border="0" width="600" cellspacing="0" cellpadding="2" align="center">
  <tr>
    <td valign="top">
<center><h2>Unathorized Access</h2></center>
If the users cookie isn't set, here is where your error message, or whatever message, will be.
	</td>
    <td valign="top" bgcolor="#D2D2D2">
    <form action="index.php" method="post">
      <table border="0" width="100%" cellpadding="2">
        <tr>
          <td width="50%" valign="top"><b>username</b></td>
          <td width="50%" valign="top"><input maxLength="25" name="username" size="10"></td>
        </tr>
        <tr>
          <td width="50%" valign="top"><b>password</b></td>
          <td width="50%" valign="top"><input maxLength="13" name="password" size="10" type="password" value></td>
        </tr>
        <tr>
          <td width="100%" valign="top" colspan="2">
            <p align="center"><input type="submit" value="Login!"></td>
        </tr>
      </table>
      </form>
    </td>
  </tr>
</table>

<?php
  exit;
  }
?>
[Edited by Krucifyx on 06-22-2000 at 07:02 AM]

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 10-21-2000, 04:38 PM
Guest
 
Posts: n/a
Default

That seems to be the problem. The file has to be in the bulletinboard directory (where global.php3 is located). Is there anyway around this?
Reply With Quote
  #13  
Old 01-21-2002, 06:08 AM
mashby's Avatar
mashby mashby is offline
 
Join Date: Jan 2002
Location: Nashville, TN - USA
Posts: 736
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone get an answer to this question? I'm looking to do the same thing on one of my sites.
Reply With Quote
  #14  
Old 03-28-2002, 02:59 PM
mt_100 mt_100 is offline
 
Join Date: Mar 2002
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When I use the code in the top example I get the login box on the screen, but I also see this error just above it.

Warning: Undefined index: bbuserid in c:\inetpub\wwwroot\dealerforge\vbulletin\homelogin .php on line 7

When I am logged into the forums, I go straight to the page, when I am not logged in I am presented with a login box with the error above, however when I try to login on that page I get this:

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

and the error ends there.

Any help would be appreciated in fixing this, but otherwise it is exactly what I am looking for, thank you!
Reply With Quote
  #15  
Old 12-20-2002, 10:06 AM
Ember's Avatar
Ember Ember is offline
 
Join Date: Sep 2002
Location: Hereford, England
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

mashby, all you need to do is put in the path that the global.php is stored in, and check that it is ch-mod'd correctly, it shouldnt give you any problems, you just need to make sure all the paths correspond.
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 11:06 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.03885 seconds
  • Memory Usage 2,240KB
  • Queries Executed 19 (?)
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)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (3)postbit_onlinestatus
  • (5)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
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_imicons
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete