= UC_ADMINISTRATOR) { $first = trim($_POST["first"]); $last = trim($_POST["last"]); $comment = trim($_POST["comment"]); $hostname = trim($_POST["hostname"]); if (!$first || !$last || !$comment) stderr( _("Error"), "Missing form data."); $first = ip2long($first); $last = ip2long($last); if( ($first == -1 || $last == -1) || ($first === false || $last === false) ) stderr( _("Error"), _("Bad IP address.") ); $comment = sqlesc($comment); $add_ban = sprintf("INSERT INTO bans (added, addedby, first, last, comment) VALUES (NOW(), %u, %u, %u, '%s')", $first, $last, $comment); do_mysql_query($add_ban) or sqlerr(__FILE__, __LINE__); header("Location: ".$BASEURL.$_SERVER['REQUEST_URI']); die; } ob_start("ob_gzhandler"); stdhead("Bans2"); print("

Current Bans

\n"); if (get_user_class() >= UC_ADMINISTRATOR) { print("

Add ban

\n"); print("\n"); print("\n"); print("\n"); print("\n"); print("\n"); print("\n"); print("\n"); print("\n
First IP
Last IP
Comment
Hostname
\n"); } stdfoot(); ?>