Created
August 31, 2014 10:25
-
-
Save JordanMussi/dc2b85ebbc76d4d67a14 to your computer and use it in GitHub Desktop.
Work out what permissions a user has in MyBB.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define("IN_MYBB", 1); | |
define('THIS_SCRIPT', 'what_are_my_perms.php'); | |
require_once "./global.php"; | |
if($mybb->user['uid'] == 0) | |
{ | |
// User is a guest | |
echo "You are a guest"; | |
} | |
elseif($mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['issupermod'] != 1) | |
{ | |
// User is a normal moderator | |
echo "You are a normal moderator"; | |
} | |
elseif($mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['issupermod'] == 1) | |
{ | |
// User is a super moderator | |
echo "You are a super moderator"; | |
} | |
elseif($mybb->usergroup['cancp']) | |
{ | |
// User is an administrator | |
echo "You are an administrator"; | |
} | |
else | |
{ | |
// User is a normal user | |
echo "You are a normal user"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment