Пример #1
0
define('IN_ADMIN', true);
$ugamela_root_path = './../';
include $ugamela_root_path . 'extension.inc';
include $ugamela_root_path . 'common.' . $phpEx;
include $ugamela_root_path . 'includes/functions/func.ban.' . $phpEx;
includeLang('admin/banned');
if ($user['authlevel'] >= 2) {
    if ($_GET['x'] == 'add') {
        // si agregamos una direccion mostraremos el formulario
        // y en caso de que el formulario haya sido enviado crearemos el registro
        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']);
        }
    }
Пример #2
0
        $tpl = new templates();
        $error = $tpl->javascript_parse_text("{ERROR_NO_PRIVS}");
        echo "alert('{$error}')";
        die;
    }
}
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;