OK, need some help here guys. Below is my current basic_command_handler.php file. I have modified it to allow me to change maps in game (which works - amazingly, lol) but when I try to add the kick, switch and server command bits I break it

Could someone please add in the switch command so everyone can use it, and the kick and server commands so that only admin can use them? Cause I am fecked if I can get it to work, and I really do not want to start learning PHP as it will end in tears, lol.
Code:
#!/usr/bin/php -q
<?php
include_once("internal/tracker.php");
include_once("internal/helpers.php");
include_once("internal/admin.php");
// --------------------------------------------
class BasicCommandHandler extends Tracker {
protected $metagame = NULL;
// --------------------------------------------
function __construct($metagame) {
$this->metagame = $metagame;
}
// ----------------------------------------------------
protected function handle_chat_event($doc) {
// player_id
// player_name
// message
// global
$event = $doc->firstChild;
$message = $event->getAttribute("message");
// for the most part, chat events aren't commands, so check that first
if (!starts_with($message, "/")) {
return;
}
$sender = $event->getAttribute("player_name");
// admin only from here on
if (!is_admin($sender)) {
return;
}
// it's a silent server command, check which one
if (check_command($message, "test")) {
$this->metagame->comms->send("say test yourself");
} else if (check_command($message, "defend")) {
// make ai defend only, both sides
for ($i = 0; $i < 2; ++$i) {
$command =
"<command class='commander_ai'" .
" faction='" . $i . "'" .
" base_defense='1.0'" .
" border_defense='0.0'>" .
"</command>";
$this->metagame->comms->send($command);
}
$this->metagame->comms->send("say defensive ai set");
} else if (check_command($message, "grey_win")) {
$this->metagame->comms->send("declare_winner 1");
} else if (check_command($message, "map1")) {
$this->metagame->comms->send("map1") ;
} else if (check_command($message, "map2")) {
$this->metagame->comms->send("map2") ;
} else if (check_command($message, "map3")) {
$this->metagame->comms->send("map3") ;
} else if (check_command($message, "map4")) {
$this->metagame->comms->send("map4") ;
} else if (check_command($message, "map5")) {
$this->metagame->comms->send("map5") ;
}
}
// --------------------------------------------
function has_ended() {
// always on
return false;
}
// --------------------------------------------
function has_started() {
// always on
return true;
}
}
?>
Cheers!