<commit_before><?
// The source code packaged with this file is Free Software, Copyright (C) 2007 by
// <NAME> :: Suki_ :: <david at sukiweb dot net>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// 		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".

include('../config.php');
include(mnminclude.'html1.php');
include(mnminclude.'link.php');

$globals['ads'] = false;

do_header(_('Administración de bans'));

$page_size = 40;
$offset=(get_current_page()-1)*$page_size;
$ban_text_length=64; // Cambiar también en checkfield.php
$ban_comment_length=120;

if ($current_user->user_level=="god" || $current_user->user_level=="admin") {
	if (!$_REQUEST["admin"]) {
		$_REQUEST["admin"] = 'hostname';
	} else {
		$_REQUEST["admin"] = clean_input_string($_REQUEST["admin"]);;
	}
	// Delete expired bans
	$db->query("delete from bans where ban_expire is not null and ban_expire < date_sub(now(), interval 60 day)");
	admin_tabs($_REQUEST["admin"]);
	echo '<div id="singlewrap">' . "\n";
	admin_bans($_REQUEST["admin"]);
} else {
	echo '<div id="singlewrap">' . "\n";
	echo '<div class="topheading"><h2>'._('Esta página es sólo para administradores').'</h2>';
}
echo "</div>";
echo "</div>"; // singlewrap
do_footer();


function admin_tabs($tab_selected = false) {
	global $globals;

	$active = ' class="tabsub-this"';
	
	echo '<ul class="tabsub">' . "\n";

	// url with parameters?
	if (!empty($_SERVER['QUERY_STRING']))
		$query = "?".htmlentities($_SERVER['QUERY_STRING']);

	// START STANDARD TABS
	// First the standard and always present tabs
	$tabs=array("hostname", "punished_hostname", "email", "ip", "words", "proxy");
		foreach($tabs as $tab) {
		if ($tab_selected == $tab) {
			echo '<li'.$active.'><a href="'.$globals['base_url'].'admin/bans.php?admin='.$tab.'" title="'.$reload_text.'">'._($tab).'&nbsp;&nbsp;&nbsp;'.$reload_icon.'</a></li>' . "\n";
		} else {
			echo '<li><a  href="'.$globals['base_url'].'admin/bans.php?admin='.$tab.'">'._($tab).'</a></li>' . "\n";
		}
	}
	echo '</ul>' . "\n";
}


function admin_bans($ban_type) {
	global $db, $globals, $offset, $page_size, $ban_text_length, $ban_comment_length, $current_user;
	require_once(mnminclude.'ban.php');

	$key = get_security_key();
	if ($current_user->user_level=="god" && $_REQUEST["key"] == $key) {
		if (!empty($_REQUEST["new_ban"])) {
			insert_ban($ban_type, $_POST["ban_text"], $_POST["ban_comment"], $_POST["ban_expire"]);
		} elseif (!empty($_REQUEST["edit_ban"])) {
			insert_ban($ban_type, $_POST["ban_text"], $_POST["ban_comment"], $_POST["ban_expire"], $_POST["ban_id"]);
		} elseif (!empty($_REQUEST["new_bans"])) {
			$array = preg_split ("/\s+/", $_POST["ban_text"]);
			$size = count($array);
			for($i=0; $i < $size; $i++) {
				insert_ban($ban_type, $array[$i], $_POST["ban_comment"], $_POST["ban_expire"]);
			}
		} elseif (!empty($_REQUEST["del_ban"])) {
			del_ban($_REQUEST["del_ban"]);
		}
	}
	<commit_msg>modificación de emergencia<commit_after><?
// The source code packaged with this file is Free Software, Copyright (C) 2007 by
// <NAME> :: Suki_ :: <david at sukiweb dot net>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// 		http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".

include('../config.php');
include(mnminclude.'html1.php');
include(mnminclude.'link.php');

$globals['ads'] = false;

do_header(_('Administración de bans'));

$page_size = 40;
$offset=(get_current_page()-1)*$page_size;
$ban_text_length=64; // Cambiar también en checkfield.php
$ban_comment_length=120;

if ($current_user->user_level=="god" || $current_user->user_level=="admin") {
	if (!$_REQUEST["admin"]) {
		$_REQUEST["admin"] = 'hostname';
	} else {
		$_REQUEST["admin"] = clean_input_string($_REQUEST["admin"]);;
	}
	// Delete expired bans
	$db->query("delete from bans where ban_expire is not null and ban_expire < date_sub(now(), interval 60 day)");
	admin_tabs($_REQUEST["admin"]);
	echo '<div id="singlewrap">' . "\n";
	admin_bans($_REQUEST["admin"]);
} else {
	echo '<div id="singlewrap">' . "\n";
	echo '<div class="topheading"><h2>'._('Esta página es sólo para administradores').'</h2>';
}
echo "</div>";
echo "</div>"; // singlewrap
do_footer();


function admin_tabs($tab_selected = false) {
	global $globals;

	$active = ' class="tabsub-this"';
	
	echo '<ul class="tabsub">' . "\n";

	// url with parameters?
	if (!empty($_SERVER['QUERY_STRING']))
		$query = "?".htmlentities($_SERVER['QUERY_STRING']);

	// START STANDARD TABS
	// First the standard and always present tabs
	$tabs=array("hostname", "punished_hostname", "email", "ip", "words", "proxy");
		foreach($tabs as $tab) {
		if ($tab_selected == $tab) {
			echo '<li'.$active.'><a href="'.$globals['base_url'].'admin/bans.php?admin='.$tab.'" title="'.$reload_text.'">'._($tab).'&nbsp;&nbsp;&nbsp;'.$reload_icon.'</a></li>' . "\n";
		} else {
			echo '<li><a  href="'.$globals['base_url'].'admin/bans.php?admin='.$tab.'">'._($tab).'</a></li>' . "\n";
		}
	}
	echo '</ul>' . "\n";
}


function admin_bans($ban_type) {
	global $db, $globals, $offset, $page_size, $ban_text_length, $ban_comment_length, $current_user;
	require_once(mnminclude.'ban.php');

	if (!empty($key)) $key = get_security_key();
	if ($current_user->user_level=="god" && $_REQUEST["key"] == $key) {
		if (!empty($_REQUEST["new_ban"])) {
			insert_ban($ban_type, $_POST["ban_text"], $_POST["ban_comment"], $_POST["ban_expire"]);
		} elseif (!empty($_REQUEST["edit_ban"])) {
			insert_ban($ban_type, $_POST["ban_text"], $_POST["ban_comment"], $_POST["ban_expire"], $_POST["ban_id"]);
		} elseif (!empty($_REQUEST["new_bans"])) {
			$array = preg_split ("/\s+/", $_POST["ban_text"]);
			$size = count($array);
			for($i=0; $i < $size; $i++) {
				insert_ban($ban_type, $array[$i], $_POST["ban_comment"], $_POST["ban_expire"]);
			}
		} elseif (!empty($_REQUEST["del_ban"])) {
			del_ban($_REQUEST["del_ban"]);
		}
	}
	
{'fraction_non_alphanumeric': 0.22628571428571428, 'fraction_numerical': 0.005877551020408163, 'mean_word_length': 5.244648318042813, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5269055', 'n_tokens_mistral': 2322, 'n_tokens_neox': 2206, 'n_words': 454}