Ejemplo n.º 1
0
     if ($_POST['add']) {
         $ip = $_POST['ip'];
         if (!$ip) {
             message($lang['add_no_ip'], $lang['error']);
         }
         addban($ip, $_POST[reason], $_POST[legnth]);
     } else {
         // otra manera de mostrar el formulario
         $page1 .= parsetemplate(gettemplate('admin/bannedipform'), $lang);
         display($page1, $lang['ip_ban_sys'], false, '', true);
     }
 }
 // eliminar una direccion
 if ($_GET['x'] == 'delete') {
     if ($_GET['id']) {
         delban($_GET['id']);
     } else {
         // show error
         message($lang['rem_no_ip'], $lang['error']);
     }
 }
 //sección principal
 $listbanned = doquery("SELECT * FROM {{table}}", 'bannedip');
 $i = 0;
 $banned_list = '';
 while ($r = mysql_fetch_array($listbanned)) {
     $i++;
     $r['i'] = $i;
     $r['razon'] = $r['reason'];
     $r['borrar'] = "<a href=\"./banadmin.php?x=delete&id={$r[id]}\">Eliminar</a>";
     $banned_list .= parsetemplate(gettemplate('admin/bannedip_row'), $r);
Ejemplo n.º 2
0
    }
}
if (isset($_GET["popup"])) {
    popup();
    exit;
}
if (isset($_GET["list"])) {
    listban();
    exit;
}
if (isset($_POST["plusdeny"])) {
    addban();
    exit;
}
if (isset($_POST["delete"])) {
    delban();
    exit;
}
js();
function js()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $title = "{ban_addresses_for_interfaces}";
    $title = $tpl->_ENGINE_parse_body($title);
    $html = "RTMMail('375','{$page}?popup=yes','{$title}');";
    echo $html;
}
function popup()
{
    $tpl = new templates();