|
isAdmin( $_SESSION['user_id'] );
if ( $isAdmin )
$server_homes = $db->getIpPorts();
else
$server_homes = $db->getIpPortsForUser($_SESSION['user_id']);
$supported_games = array( "Counter Strike Global Offensive",
"Counter Strike Source",
"Day of Defeat: Source",
"Dystopia",
"Garrys Mod",
"Half-Life 2: Deathmatch",
"Hidden: Source",
"Pirates, Vikings and Knights II",
"Team Fortress 2",
"Team Fortress 2 Beta",
"Left 4 Dead",
"Left 4 Dead 2" );
$admin_flags = array( "a" => "Reserved slot access.",
"b" => "Generic admin; required for admins.",
"c" => "Kick other players.",
"d" => "Ban other players.",
"e" => "Remove bans.",
"f" => "Slay/harm other players.",
"g" => "Change the map or major gameplay features.",
"h" => "Change most cvars.",
"i" => "Execute config files.",
"j" => "Special chat privileges.",
"k" => "Start or create votes.",
"l" => "Set a password on the server.",
"m" => "Use RCON commands.",
"n" => "Change sv_cheats or use cheating commands." );
$i = 0;
foreach ($server_homes as $server_home)
{
if ( in_array( $server_home['game_name'], $supported_games ) )
$sm_admin_server_homes[$i] = $server_home;
$i++;
}
if( !isset( $_GET['sm_admin']) )
{
$select = $_GET['home_id-mod_id-ip-port'];
unset( $_GET['home_id-mod_id-ip-port'] );
}
create_home_selector_address("util","",$sm_admin_server_homes);
?>
|
getGameHome($home_id);
else
$server_home = $db->getUserGameHome($_SESSION['user_id'],$home_id);
$_SESSION['inmunityLvl'] = $_POST['ainmunity'];
if(isset($_POST['sm_admin']))
{
if($_POST['asteamid'])
print_failure('A steam_id is needed!');
$flagsStr = "";
foreach($_POST as $key => $val)
{
if(preg_match('/flag_/',$key))
$flagsStr .= $val;
}
$inmunityLvl = $_POST['ainmunity'] != '0' ? $_POST['ainmunity'].':' : "";
if($_POST['steamid'] == "" or $flagsStr == "")
{
if($_POST['steamid'] == "")
print_failure('A steam_id is needed!');
if($flagsStr == "")
print_failure('Must select at least 1 flag!');
}
else
{
$admins_simple_location = $server_home['home_path']."/".$server_home['mods'][$mod_id]['mod_key']."/addons/sourcemod/configs/admins_simple.ini";
require_once('includes/lib_remote.php');
$remote = new OGPRemoteLibrary($server_home['agent_ip'], $server_home['agent_port'], $server_home['encryption_key'], $server_home['timeout']);
if($remote->rfile_exists($admins_simple_location) != 1)
print_failure("SourceMod is not properly installed in your server,