<?php
header("Content-type: text/xml; charset=UTF-8");
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

require("config.php");
require("includes/debug.php");
require("includes/functions.php");
//conexão ao banco de dados
$conn = @mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error());
mysql_select_db($dbname);
$opc = $_GET['opc'];
$SQL = "";
if ($opc == 1) {
    $SQL = "SELECT ips_bloq FROM cmum_settings WHERE id=1";
}
if ($opc == 2) {
    $SQL = "SELECT ips_perm FROM cmum_settings WHERE id=1";
}
$rs = mysql_query($SQL);
$row = mysql_fetch_assoc($rs);
$tag_ini = "";
$tag_fin = "";

if ($opc == 1) {
    $tag_ini = "<ips-bloqueados>";
    $tag_fin = "</ips-bloqueados>";
    $ips = $row['ips_bloq'];
}
if ($opc == 2) {
    $tag_ini = "<ips-permitidos>";
    $tag_fin = "</ips-permitidos>";
    $ips = $row['ips_perm'];
}
$aux_ips = explode(';', $ips);
echo $tag_ini;
foreach ($aux_ips as $ip) {
    echo "<ip>{$ip}</ip>";
}
echo $tag_fin;






