PDA

View Full Version : How to ban an external page?


bymny
08-08-2014, 11:41 PM
I do not have much knowledge of php please help
my code:
<body bgcolor="#ffffff">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<center>
<?php
define("IN_vbulletin", 1);

require_once "../global.php";
if(!in_array($vbulletin->userinfo['usergroupid'], array(1,4,8))){
$a = "Welcome";
echo $a;
}
else{
if(!$vbulletin->userinfo['usergroupid']) error_no_permission();
$b = "No Permission!";
echo $b;
die();
}

//my php code

?>
</center>
</body>

final kaoss
08-09-2014, 01:14 AM
Please describe in more details what your goal is.

bymny
08-09-2014, 01:18 AM
extra php page to hide the guest :(

ozzy47
08-09-2014, 01:25 AM
Try this:
define("IN_vbulletin", 1);

require_once "../global.php";

if (in_array($vbulletin->userinfo['usergroupid'], array(1,4,8)))
{
print_no_permission();
}

if(!in_array($vbulletin->userinfo['usergroupid'], array(1,4,8))){
$a = "Welcome";
echo $a;
}

bymny
08-09-2014, 02:21 AM
@ozzy47 unfortunately does not hide an extra page :confused:

ozzy47
08-09-2014, 02:25 AM
Are you sure you are trying to view the page as a member of either usergroup, 1,4,8 ?

Also add this above the line define("IN_vbulletin", 1);

global $vbulletin;

bymny
08-09-2014, 03:05 PM
yes, I'm sure, but it did not work :(

kh99
08-09-2014, 03:39 PM
Try:
chdir('..');
require_once "global.php";

bymny
08-09-2014, 04:07 PM
It was now, thanks

--------------- Added 1407628085 at 1407628085 ---------------

How do I get the user name that appears ?
Welcome $bbuserinfo[username]