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 08-02-2006 01:19 AM

Quote:

Originally Posted by lightwave
How do I make this work across different subdomains?

Tried step 4 yet?
https://vborg.vbsupport.ru/showpost....98&postcount=2

Evoir 08-02-2006 10:02 PM

Hi, I baaaack :)

I have another question: I'd like to lock up an entire page based on vB usergroup, and it seems like there is a problem doing this... here is the error I get:
Quote:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /big/dom/xc5children/www/private/aboutus/index.php on line 30
I'm using your second suggestion under USAGE:
Quote:

You can use a simple variation of this to restrict entire pages to a certain usergroup.
For example,
PHP Code:
<?php
if ($vbulletin->userinfo['usergroupid'] == '6' )
{
echo "Have stuff for here";
} else {
echo "You do not have permission for this page"; }
?>
Can you help me understand how to protect a whole page (including the navigation etc)? I simply wrapped my html inside of the quotes "Have stuff for here" in above example. It includes html and php calls (includes for the navigation etc). Basically, everything between <body> and </body>

soletrader 08-03-2006 12:12 AM

Quote:

Q. Now that I've installed this script I'm having problems logging in/out!

A. Try clearing your cookies. If you're still having problems afterwards, go to your Admin CP, click on vBulletin Options, and edit your Cookie Domain (listed under Cookies and HTTP Header Options). Change that option to ".yoursite.com" (note the two dots!). Also make sure that your Cookie Path option is set to "/".
Once you change that, close all browser windows, clear your cookies again, and then try to log in/out again.

Once I do this, I can no longer login to the control panel. Are there any solutions to this?

Billspaintball 08-03-2006 04:32 AM

Quote:

Originally Posted by Evoir
I simply wrapped my html inside of the quotes "Have stuff for here" in above example. It includes html and php calls (includes for the navigation etc). Basically, everything between <body> and </body>

Ok, thats were the problem is.

Wrapping the HTML in those tags is fine, however when you wrapped the PHP inside the echo tags everything breaks as you have found out.

If your wrapping a mix of HTML and PHO you need it in a format like this.

PHP Code:

<?php
if ($vbulletin->userinfo['usergroupid'] == '6' )
{
echo 
"Have stuff for here";
// put some PHP code here
echo "Now some more HTML goes here";
// and some more PHP stuff cos I can
echo "and the final HTML stuff here";
} else {
echo 
"You do not have permission for this page"; }
?>

Ive just used comments // in the above example where you would add your straight PHP code.

Hope thats a bit more clear.
If your still having problems just post the first dozen lines or so of your page or so.

Billspaintball 08-03-2006 04:57 AM

Quote:

Originally Posted by soletrader
Once I do this, I can no longer login to the control panel. Are there any solutions to this?

Did you flush the cookies in your browsers cache and force a page reload? (CTRL+F5 (I think) )

boske 08-04-2006 02:42 AM

Quote:

Originally Posted by Billspaintball
Did you flush the cookies in your browsers cache and force a page reload? (CTRL+F5 (I think) )

Yeah make sure you do this when you have changed Cookies and HTTP headers, I had the same problem as you.

quadude 08-13-2006 08:02 PM

Something maybe worth mentioning is that to prevent script issues from happenning(due to path changes) You can do something like this:
Code:

$cwd = getcwd();
chdir('/path/to/your/forums');
require_once('/path/to/your/forums/global.php');
chdir($cwd);


Evoir 08-13-2006 08:26 PM

Ok, now I am having trouble with any quotes being used within the document. Is there a way around this? I am using this code on a template, and my client is using quotes, which is causing an error.

Quote:

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /big/dom/xc5children/www/private/learning_areas/dramatic_play.php on line 38

grayloon 08-15-2006 08:32 PM

Since the chdir code must be first on the page, how do you handle the sending of headers (like cookies)?

Bahawolf2 08-15-2006 09:45 PM

I have a question...

I am using the script in other folders, and it wont then login... For example:

Main directory: public_html/
Forum Directory: public_html/forums/

Say I have a page in public_html/support/

The script doesnt login, or logout properly, but If I login to a page before the /support/ directory it works okay. Otherwise only pages in the public_html folder works.

Any help? I have changed the codes inserted in the page to reflect the change, (ie. ../forums/login_inc.php) like that.


All times are GMT. The time now is 10:50 AM.

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.01654 seconds
  • Memory Usage 1,751KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (8)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