![]() |
Using Usergroup ID's to allow/deny Permisson question
I'm making a seperate PHP based page, what code can I use to allow/deny access to the page based on a usergroup ID?
|
Hi once calling /global.php try using the following code:
PHP Code:
PHP Code:
|
PHP Code:
|
Thanks guys, all fixed ;)
|
Hello, please help, not working for me:
PHP Code:
|
And what is happening instead?
You should do a chdir before including global instead of the way you did it. |
Quote:
And the page breaks and doesn't work.. Please help.. |
PHP Code:
|
PHP Code:
|
Quote:
|
Post your code and please use the code/html/php tags when you do so it's easy to read.
|
Err can't really post the code..but I'm using it exactly as above?
I have more PHP scripting going on to pull info out of the database as well because that's what the script is for...premium usergroups...and this is a script only they should be able to see. Please help |
Sorry, all I can suggest then is that you have something wrong in your code. I've used those same lines in my homemade pages and they work just fine as long as the rest of the page is coded correctly and all the paths to the files are correct. Did you do your page using one of these articles as a template? How to create your own vBulletin-powered page! (uses vB templates) or [How-To] vBulletin API Basics: Creating Custom Pages & Misc.
|
No..this page is in the root directory of my site...not the forum directory... :) :\
|
So? I don't understand why that changes anything? You do exactly what the article says only do the chdir before requiring the globals (like we did above).
|
Quote:
|
The PHP code should be in the <body> tag right?
I'm putting it in the PHP code just above the script, which pulls info out of the database.. The PHP code that you gave me makes the script break and the HTML code break as well..without he PHP code you gave me, the script works though. :o |
php code should be in the php file, not in any html area.
|
What?..
It's in a .php file if that's what you mean?.. Are you saying this script should have it's own file ??.. |
But you said you put it in the <body> tag - in the html area of your page. It has to be within the php tag part of your page. Like at the top after you do a require of the global.php page.
|
Quote:
|
Yes the person above me works within my company and his statement is true. :)
Please assist. Also, PHP Safe Mode is on I believe..if that has anything to do with it. |
I'm sorry, but since you won't post the code, I'm not sure what else to suggest.
|
Quote:
|
Dismounted, this page is not in vB...it's not in the forum directory at all, and isn't a vB template. :o It's just a page on the root directory of the site...that we want to protect so that only certain usergroups we specify can see it.
|
OK, I'll repeat what I said before. Those lines of code should go just after you include global.php - before you start spitting out any html.
|
Let me try (I'm another admin on the site)
We're using a CMS. We have a page that I wrote using PHP to pull out vB's ban info. When we try and include('./forum/global.php'), it breaks. The page stops executing and no output past the include() is printed. No error message is printed, as well. I *think* it's either a file perm issue or open_basedir. Neg on open_basedir. Chdir'ing to our forums dir and requiring from there produces the same results. I'm begining to lean toward a safe mode issue... |
My guess is that vBulletin is conflicting with the CMS. There is probably some variables that are named the same, and therefore, it breaks.
|
All times are GMT. The time now is 03:37 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|