Last active
October 11, 2016 09:59
-
-
Save fr34kyn01535/d0da2fd65ccbf0b21bed to your computer and use it in GitHub Desktop.
WebPermissions Example (phpBB backend)
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 header("Content-Type: application/xml; charset=utf-8"); | |
function getPlayersFromGroup($group){ | |
$db = new mysqli("localhost", "unturned", "test", "unturned"); | |
$players = array(); | |
$query = "select g.user_id,d.pf_user_steam_id csteamid from phpbb_users g | |
inner join phpbb_profile_fields_data d on g.user_id = d.user_id | |
where pf_user_steam_id != '' and g.group_id = $group"; | |
if($result = $db->query($query)){ | |
while ($row = $result->fetch_assoc()) { | |
if($row["csteamid"]) | |
$players[] = $row["csteamid"]; | |
} | |
$result->free(); | |
} | |
return $players; | |
} | |
$connections = json_decode(file_get_contents("servers.json")); | |
$s = null; | |
foreach($connections->servers as $server){ | |
$instance = $server->machine.(($server->port - 27012) / 3); | |
if($_GET["instance"] == $instance){ | |
$s = $server; | |
break; | |
} | |
} | |
if($s == null) die(); | |
echo("<?")?>xml version="1.0" encoding="utf-8"<?php echo("?>")?> | |
<RocketPermissions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | |
<DefaultGroupId>default</DefaultGroupId> | |
<ReservedSlotsGroups> | |
<ReservedSlotsGroup>moderator</ReservedSlotsGroup> | |
<ReservedSlotsGroup>vip</ReservedSlotsGroup> | |
<ReservedSlotsGroup>administrator</ReservedSlotsGroup> | |
<ReservedSlotsGroup>hoster</ReservedSlotsGroup> | |
<ReservedSlotsGroup>supervip</ReservedSlotsGroup> | |
</ReservedSlotsGroups> | |
<ReservedSlots>4</ReservedSlots> | |
<Groups> | |
<Group> | |
<Id>default</Id> | |
<DisplayName>Guest</DisplayName> | |
<Color>eaeff2</Color> | |
<Commands> | |
<Command>reward</Command> | |
<Command>balance</Command> | |
<Command>pay</Command> | |
<Command>vault.2</Command> | |
<Command>rules</Command> | |
<Command>rocket</Command> | |
<Command>compass</Command> | |
<Command>msg</Command> | |
<Command>message</Command> | |
<Command>r</Command> | |
<Command>reply</Command> | |
<Command>p</Command> | |
<?php if($s->mode == "Creative") {?> | |
<Command>i</Command> | |
<Command>bonusxp.x5</Command> | |
<?php } ?> | |
</Commands> | |
</Group> | |
<Group> | |
<Id>registered</Id> | |
<DisplayName>Registered</DisplayName> | |
<Members> | |
<? | |
foreach(getPlayersFromGroup(2) as $player){ | |
echo("<Member>$player</Member>\n"); | |
} | |
?> | |
</Members> | |
<Commands> | |
<Command>reward</Command> | |
<Command>balance</Command> | |
<Command>pay</Command> | |
<Command>vault.3</Command> | |
<Command>rules</Command> | |
<Command>rocket</Command> | |
<Command>compass</Command> | |
<Command>color.white</Command> | |
<Command>msg</Command> | |
<Command>message</Command> | |
<Command>r</Command> | |
<Command>reply</Command> | |
<Command>p</Command> | |
<?php if($s->mode == "Creative") {?> | |
<Command>i</Command> | |
<Command>bonusxp.x5</Command> | |
<?php } ?> | |
</Commands> | |
</Group> | |
<Group> | |
<Id>administrator</Id> | |
<Color>df3f23</Color> | |
<DisplayName>Administrator</DisplayName> | |
<Members> | |
<? | |
foreach(getPlayersFromGroup(5) as $player){ | |
echo("<Member>$player</Member>\n"); | |
} | |
foreach(getPlayersFromGroup(11) as $player){ | |
echo("<Member>$player</Member>\n"); | |
} | |
?> | |
</Members> | |
<Commands> | |
<Command>*</Command> | |
<Command>vault.6</Command> | |
</Commands> | |
</Group> | |
<Group> | |
<Id>moderator</Id> | |
<Color>108afb</Color> | |
<DisplayName>Moderator</DisplayName> | |
<Members> | |
<? | |
foreach(getPlayersFromGroup(9) as $player){ | |
echo("<Member>$player</Member>\n"); | |
} | |
?> | |
</Members> | |
<Commands> | |
<Command>vault.6</Command> | |
<Command>bonusxp.x2</Command> | |
<Command>*</Command> | |
</Commands> | |
</Group> | |
<Group> | |
<Id>sponsor</Id> | |
<DisplayName>Sponsor</DisplayName> | |
<Members> | |
<?php if($s->machine == "foxfire" && $s->port==27021) {?> | |
<Member>76561198173302670</Member> | |
<? } //JizzForDayz ?> | |
</Members> | |
<Color>cc8534</Color> | |
<Commands> | |
<Command>vault.6</Command> | |
<Command>*</Command> | |
</Commands> | |
</Group> | |
<Group> | |
<Id>vip</Id> | |
<DisplayName>VIP</DisplayName> | |
<Color>ffdb01</Color> | |
<Members> | |
<? | |
foreach(getPlayersFromGroup(8) as $player){ | |
echo("<Member>$player</Member>\n"); | |
} | |
?> | |
</Members> | |
<Commands> | |
<Command>p</Command> | |
<?php if($s->mode == "Creative"){ | |
echo ("<Command>v</Command>"); | |
echo ("<Command>experience</Command>"); | |
}else{ | |
echo ("<Command>bonusxp.x2</Command>"); | |
}?> | |
<Command>vault.6</Command> | |
<Command>home</Command> | |
<Command>reward</Command> | |
<Command>balance</Command> | |
<Command>pay</Command> | |
<Command>rules</Command> | |
<Command>rocket</Command> | |
<Command>compass</Command> | |
<Command>msg</Command> | |
<Command>message</Command> | |
<Command>r</Command> | |
<Command>reply</Command> | |
<Command>p</Command> | |
</Commands> | |
</Group> | |
<Group> | |
<Id>supervip</Id> | |
<DisplayName>Super VIP</DisplayName> | |
<Members> | |
<? | |
foreach(getPlayersFromGroup(13) as $player){ | |
echo("<Member>$player</Member>\n"); | |
} | |
?> | |
</Members> | |
<Color>FF9900</Color> | |
<Commands> | |
<Command>p</Command> | |
<?php if($s->mode == "Creative"){ | |
echo ("<Command>experience</Command>"); | |
}else{ | |
echo ("<Command>bonusxp.x3</Command>"); | |
}?> | |
<Command>vault.9</Command> | |
<Command>v</Command> | |
<Command>home</Command> | |
<Command>reward</Command> | |
<Command>balance</Command> | |
<Command>pay</Command> | |
<Command>rules</Command> | |
<Command>rocket</Command> | |
<Command>compass</Command> | |
<Command>msg</Command> | |
<Command>message</Command> | |
<Command>r</Command> | |
<Command>reply</Command> | |
<Command>p</Command> | |
</Commands> | |
</Group> | |
<Group> | |
<Id>ultravip</Id> | |
<DisplayName>Ultra VIP</DisplayName> | |
<Members> | |
<? | |
foreach(getPlayersFromGroup(14) as $player){ | |
echo("<Member>$player</Member>\n"); | |
} | |
?> | |
</Members> | |
<Color>7e16df</Color> | |
<Commands> | |
<Command>p</Command> | |
<?php if($s->mode == "Creative"){ | |
echo ("<Command>experience</Command>"); | |
}else{ | |
echo ("<Command>bonusxp.x5</Command>"); | |
}?> | |
<Command>vault.30</Command> | |
<Command>v</Command> | |
<Command>kick</Command> | |
<Command>home</Command> | |
<Command>reward</Command> | |
<Command>balance</Command> | |
<Command>pay</Command> | |
<Command>rules</Command> | |
<Command>rocket</Command> | |
<Command>compass</Command> | |
<Command>msg</Command> | |
<Command>message</Command> | |
<Command>r</Command> | |
<Command>reply</Command> | |
<Command>p</Command> | |
</Commands> | |
</Group> | |
</Groups> | |
</RocketPermissions> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment