Exemplo n.º 1
0
 function ban($serverId, $ip, $bits = 32)
 {
     if (!is_int($ip)) {
         $ip = HelperFunctions::ip2int($ip);
     }
     $srv = $this->getServer(intval($serverId));
     $bans = $srv->getBans();
     $ban = new Murmur_Ban();
     $ban->address = $ip;
     $ban->bits = $bits;
     $bans[] = $ban;
     $srv->setBans($bans);
 }
Exemplo n.º 2
0
 public static function server_ban()
 {
     $serverId = intval($_POST['serverId']);
     $ip = strip_tags($_POST['ipmask']);
     $bits = intval($_POST['bits']);
     if (strpos($ip, '.') === false) {
         $ip = intval($ip);
     } else {
         $ip = HelperFunctions::ip2int($ip);
     }
     ServerInterface::getInstance()->ban($serverId, $ip, $bits);
 }