View Full Version : Controlling a non VB page
stuuu
03-25-2003, 02:59 PM
Hi!
I currently use this code to prevent non registered users from viewing a page on my web site:
include ("global.php");
if ($bbuserinfo[userid]==0) {
show_nopermission();
}
How could I improve that code so it doesnt allow users that have registered BUT have not confirmed their email address to view the page. So if they try to access the page, it displays the message saying they need to activate their account first.
Thanks :banana:
filburt1
03-25-2003, 03:40 PM
Compare the usergroupid instead. Also use require instead of include for better security.
stuuu
03-26-2003, 12:34 AM
Yesterday at 05:40 PM filburt1 said this in Post #2 (https://vborg.vbsupport.ru/showthread.php?postid=373108#post373108)
Compare the usergroupid instead. Also use require instead of include for better security.
Is the user group .. $bbuserinfo[usergroup] ????
How do you find out these variables, are they listed anywhere?
Thanks for letting me know about the require, Ive changed that.
colicab-d
03-26-2003, 08:36 AM
im actually starting on hack to make pages that are protected in this way :P. Im gonna llow thwm to be added edited and viewed via the admincp and users wil be able to use plain html or php :D
filburt1
03-26-2003, 02:15 PM
$bbuserinfo['usergroupid'] (USE THE QUOTES!).
mysql> select usergroupid,title from usergroup;
+-------------+-----------------------------------+
| usergroupid | title |
+-------------+-----------------------------------+
| 1 | Unregistered / Not Logged In |
| 2 | Registered |
| 3 | Users Awaiting Email Confirmation |
| 4 | (COPPA) Users Awaiting Moderation |
| 5 | Super Moderators |
| 6 | Administrators |
| 7 | Moderators |
| 8 | Banned by Moderators |
| 9 | newforum Developers |
| 10 | WDF Project Designers |
+-------------+-----------------------------------+
10 rows in set (0.19 sec)
stuuu
03-26-2003, 09:18 PM
Nice one guys, got that one sorted.
Last thing :lick:
I use..
show_nopermission();
When they are not logged in. Because Im now also checking to see if they have authorised their email address, does vBulletin have a template to says that they need to authorise their email?
show_emailauthorise(); or something!
Thanks again :bandit: :bandit:
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.