vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Simple vB User login and access control on non vB pages (https://vborg.vbsupport.ru/showthread.php?t=100992)

Billspaintball 11-23-2005 09:05 PM

Quote:

Originally Posted by boske
I am getting the error

Line: 469
Char: 1
Error: Expected '('
Code: 0

I cant see how the script causes that error.

I think that there is something else on your page, that in combination with the script produces that error.

Billspaintball 11-23-2005 09:08 PM

Note for people having problems with Paths.

Put the following code on a page all by its self.

Name the page something like findpath.php and place in your forums root directory.
browse to the page and it will display the exact path to your forums root.

PHP Code:

 <?php
echo getcwd();
?>


AutoXer 12-03-2005 11:43 PM

Quote:

Originally Posted by Billspaintball
Note for people having problems with Paths.

Put the following code on a page all by its self.

Name the page something like findpath.php and place in your forums root directory.
browse to the page and it will display the exact path to your forums root.

PHP Code:

 <?php
echo getcwd();
?>


If I do the above, I get the following: /home/racett56/public_html/forums

I think I'm having path problems. Can you post up a little tutorial on directorys and the chdir command?

I can get the page to load without any errors but it never shows me as "logged in". It always presents the login prompts as if I'm not logged in. If I use the prompts to login, the vB welcome screen briefly displays then shows the login prompts again.

Billspaintball 12-04-2005 12:18 AM

1st, in the file login_inc.php ensure that you have changed the 4 paths so that "www.yoursite.com" refers to your domain.

Then on the page you want to include the login use this code:
Code:


    <?php
    chdir('/home/racett56/public_html/forums');
    require_once('/home/racett56/public_html/forums/global.php'); 
    require_once('/home/racett56/public_html/login_inc.php');
    ?>

Note: This assumes on the 4th line that you have placed the file login_inc.php in your websites root directory (that is where you would have index.html or index.php)

Hope this helps.

AutoXer 12-04-2005 01:12 AM

Quote:

Originally Posted by Billspaintball
1st, in the file login_inc.php ensure that you have changed the 4 paths so that "www.yoursite.com" refers to your domain.

Then on the page you want to include the login use this code:
Code:


    <?php
    chdir('/home/racett56/public_html/forums');
    require_once('/home/racett56/public_html/forums/global.php'); 
    require_once('/home/racett56/public_html/login_inc.php');
    ?>

Note: This assumes on the 4th line that you have placed the file login_inc.php in your websites root directory (that is where you would have index.html or index.php)

The file with the access control code in it is located in '/home/racett56/public_html/rtdb'. I simply added the three lines to the begining of an existing non-forum related .php file.

The login_inc.php is located in '/home/racett56/public_html'.

The forums are located in '/home/racett56/public_html/forums'.

I changed everything to what you suggested and I still get the same thing as before. The login prompts appear at the top of the screen when accessing the .php file. If I fill in the prompts and hit 'Log in', the vBulletin welcome screen appears for a second or two. Then it takes me back to the exact same screen with the login prompts at the top. It seems like this $vbulletin->userinfo['userid']!=0 is false even after I login.

BTW... thanks for the fast response!

AutoXer 12-04-2005 01:50 AM

If I move the access controled file to the forums directory, it works fine. What do I need to change to get it to work from another directory?

AutoXer 12-04-2005 03:08 AM

Quote:

Originally Posted by AutoXer
If I move the access controled file to the forums directory, it works fine. What do I need to change to get it to work from another directory?

I fixed it. Here's how:

AdminCP -> vBulletin Options -> Cookies and HTTP Header Options -> Path to Save Cookies

I changed the 'Suggested Settings' dropdown from '/forums/' to '/'

Espionix 12-15-2005 04:24 PM

I keep getting

Unable to add cookies, header already sent.
File: /home/shadowl/public_html/v3/index.php
Line: 17

I've tried clearing cookies, cache etc, nothing changed, any ideas?

Billspaintball 12-15-2005 07:10 PM

You need to remove all lines or spaces before these block of code.
It must go at the very top of the page.

PHP Code:

<?php
    chdir
('/path/to/your/forums'); 
    require_once(
'/path/to/your/forums/global.php');  
    require_once(
'/path/to/login_inc.php');
?>


Espionix 12-15-2005 08:18 PM

Thanks alot! That fixed it, but how do I display the form wherever I want on the page? It's now above the banner :S

EDIT: Nvm got it


All times are GMT. The time now is 03:35 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.01268 seconds
  • Memory Usage 1,750KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete