Index: trunk/web/punbb/admin_bans.php
===================================================================
--- trunk/web/punbb/admin_bans.php	(revision 10)
+++ trunk/web/punbb/admin_bans.php	(revision 1)
@@ -1,23 +1,38 @@
 <?php
-
-/**
- * Copyright (C) 2008-2011 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
+/***********************************************************************
+
+  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
+
+  This file is part of PunBB.
+
+  PunBB is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License as published
+  by the Free Software Foundation; either version 2 of the License,
+  or (at your option) any later version.
+
+  PunBB is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+  MA  02111-1307  USA
+
+************************************************************************/
+
 
 // Tell header.php to use the admin template
 define('PUN_ADMIN_CONSOLE', 1);
 
-define('PUN_ROOT', dirname(__FILE__).'/');
+define('PUN_ROOT', './');
 require PUN_ROOT.'include/common.php';
 require PUN_ROOT.'include/common_admin.php';
 
 
-if ($pun_user['g_id'] != PUN_ADMIN && ($pun_user['g_moderator'] != '1' || $pun_user['g_mod_ban_users'] == '0'))
+if ($pun_user['g_id'] > PUN_MOD || ($pun_user['g_id'] == PUN_MOD && $pun_config['p_mod_ban_users'] == '0'))
 	message($lang_common['No permission']);
 
-// Load the admin_bans.php language file
-require PUN_ROOT.'lang/'.$admin_language.'/admin_bans.php';
 
 // Add/edit a ban (stage 1)
@@ -26,60 +41,47 @@
 	if (isset($_GET['add_ban']) || isset($_POST['add_ban']))
 	{
-		// If the ID of the user to ban was provided through GET (a link from profile.php)
+		// If the id of the user to ban was provided through GET (a link from profile.php)
 		if (isset($_GET['add_ban']))
 		{
-			$user_id = intval($_GET['add_ban']);
-			if ($user_id < 2)
+			$add_ban = intval($_GET['add_ban']);
+			if ($add_ban < 2)
 				message($lang_common['Bad request']);
 
-			$result = $db->query('SELECT group_id, username, email FROM '.$db->prefix.'users WHERE id='.$user_id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+			$user_id = $add_ban;
+
+			$result = $db->query('SELECT group_id, username, email FROM '.$db->prefix.'users WHERE id='.$user_id) or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
 			if ($db->num_rows($result))
 				list($group_id, $ban_user, $ban_email) = $db->fetch_row($result);
 			else
-				message($lang_admin_bans['No user ID message']);
+				message('Aucun utilisateur enregistrÃ© sous cet identifiant (ID).');
 		}
-		else // Otherwise the username is in POST
+		else	// Otherwise the username is in POST
 		{
-			$ban_user = pun_trim($_POST['new_ban_user']);
+			$ban_user = trim($_POST['new_ban_user']);
 
 			if ($ban_user != '')
 			{
-				$result = $db->query('SELECT id, group_id, username, email FROM '.$db->prefix.'users WHERE username=\''.$db->escape($ban_user).'\' AND id>1') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
+				$result = $db->query('SELECT id, group_id, username, email FROM '.$db->prefix.'users WHERE username=\''.$db->escape($ban_user).'\' AND id>1') or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
 				if ($db->num_rows($result))
 					list($user_id, $group_id, $ban_user, $ban_email) = $db->fetch_row($result);
 				else
-					message($lang_admin_bans['No user message']);
+					message('Aucun utilisateur enregistrÃ© sous ce nom d\'utilisateur. Si vous souhaitez ajouter un bannissement qui ne soit pas liÃ© Ã  un nom d\'utilisateur particulier, laissez la case vide.');
 			}
 		}
 
-		// Make sure we're not banning an admin or moderator
-		if (isset($group_id))
-		{
-			if ($group_id == PUN_ADMIN)
-				message(sprintf($lang_admin_bans['User is admin message'], pun_htmlspecialchars($ban_user)));
-
-			$result = $db->query('SELECT g_moderator FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to fetch group info', __FILE__, __LINE__, $db->error());
-			$is_moderator_group = $db->result($result);
-
-			if ($is_moderator_group)
-				message(sprintf($lang_admin_bans['User is mod message'], pun_htmlspecialchars($ban_user)));
-		}
+		// Make sure we're not banning an admin
+		if (isset($group_id) && $group_id == PUN_ADMIN)
+			message('L\'utilisateur '.pun_htmlspecialchars($ban_user).' est un administrateur, il ne peut Ãªtre bannis. Si vous souhaitez bannir un administrateur, vous devez d\'abord le rÃ©trograder soit modÃ©rateur soit utilisateur.');
 
 		// If we have a $user_id, we can try to find the last known IP of that user
 		if (isset($user_id))
 		{
-			$result = $db->query('SELECT poster_ip FROM '.$db->prefix.'posts WHERE poster_id='.$user_id.' ORDER BY posted DESC LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
+			$result = $db->query('SELECT poster_ip FROM '.$db->prefix.'posts WHERE poster_id='.$user_id.' ORDER BY posted DESC LIMIT 1') or error('Impossible de retrouver les informations des messages', __FILE__, __LINE__, $db->error());
 			$ban_ip = ($db->num_rows($result)) ? $db->result($result) : '';
-
-			if ($ban_ip == '')
-			{
-				$result = $db->query('SELECT registration_ip FROM '.$db->prefix.'users WHERE id='.$user_id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
-				$ban_ip = ($db->num_rows($result)) ? $db->result($result) : '';
-			}
 		}
 
 		$mode = 'add';
 	}
-	else // We are editing a ban
+	else	// We are editing a ban
 	{
 		$ban_id = intval($_GET['edit_ban']);
@@ -87,5 +89,5 @@
 			message($lang_common['Bad request']);
 
-		$result = $db->query('SELECT username, ip, email, message, expire FROM '.$db->prefix.'bans WHERE id='.$ban_id) or error('Unable to fetch ban info', __FILE__, __LINE__, $db->error());
+		$result = $db->query('SELECT username, ip, email, message, expire FROM '.$db->prefix.'bans WHERE id='.$ban_id) or error('Impossible de retrouver les informations de bannissement', __FILE__, __LINE__, $db->error());
 		if ($db->num_rows($result))
 			list($ban_user, $ban_ip, $ban_email, $ban_message, $ban_expire) = $db->fetch_row($result);
@@ -93,20 +95,19 @@
 			message($lang_common['Bad request']);
 
-		$diff = ($pun_user['timezone'] + $pun_user['dst']) * 3600;
-		$ban_expire = ($ban_expire != '') ? gmdate('Y-m-d', $ban_expire + $diff) : '';
+		$ban_expire = ($ban_expire != '') ? date('Y-m-d', $ban_expire) : '';
 
 		$mode = 'edit';
 	}
 
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Bans']);
+	$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Bannissements';
 	$focus_element = array('bans2', 'ban_user');
-	define('PUN_ACTIVE_PAGE', 'admin');
 	require PUN_ROOT.'header.php';
 
 	generate_admin_menu('bans');
+
 
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_bans['Ban advanced head'] ?></span></h2>
+		<h2><span>RÃ©glages de bannissement avancÃ©s</span></h2>
 		<div class="box">
 			<form id="bans2" method="post" action="admin_bans.php">
@@ -115,30 +116,30 @@
 <?php if ($mode == 'edit'): ?>				<input type="hidden" name="ban_id" value="<?php echo $ban_id ?>" />
 <?php endif; ?>				<fieldset>
-						<legend><?php echo $lang_admin_bans['Ban advanced subhead'] ?></legend>
+						<legend>Bannissement supplÃ©mentaire avec <acronym title="Internet Protocol" lang="en">IP</acronym> est adresse e-mail</legend>
 						<div class="infldset">
 							<table class="aligntop" cellspacing="0">
 								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Username label'] ?></th>
+									<th scope="row">Nom d'utilisateur</th>
 									<td>
 										<input type="text" name="ban_user" size="25" maxlength="25" value="<?php if (isset($ban_user)) echo pun_htmlspecialchars($ban_user); ?>" tabindex="1" />
-										<span><?php echo $lang_admin_bans['Username help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['IP label'] ?></th>
+										<span>Le nom d'utilisateur Ã  bannir.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Adresses <acronym title="Internet Protocol" lang="en">IP</acronym></th>
 									<td>
 										<input type="text" name="ban_ip" size="45" maxlength="255" value="<?php if (isset($ban_ip)) echo $ban_ip; ?>" tabindex="2" />
-										<span><?php echo $lang_admin_bans['IP help'] ?><?php if ($ban_user != '' && isset($user_id)) printf(' '.$lang_admin_bans['IP help link'], '<a href="admin_users.php?ip_stats='.$user_id.'">'.$lang_admin_common['here'].'</a>') ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['E-mail label'] ?></th>
-									<td>
-										<input type="text" name="ban_email" size="40" maxlength="80" value="<?php if (isset($ban_email)) echo $ban_email; ?>" tabindex="3" />
-										<span><?php echo $lang_admin_bans['E-mail help'] ?></span>
+										<span>Une adresse <acronym title="Internet Protocol" lang="en">IP</acronym> ou une plage d'adresses <acronym title="Internet Protocol" lang="en">IP</acronym> que vous souhaitez bannir (<abbr title="exemple">ex.</abbr> 150.11.110.1 ou 150.11.110). SÃ©parez les adresses par des espaces. Si une adresse <acronym title="Internet Protocol" lang="en">IP</acronym> apparaÃ®t dÃ©jÃ , il s'agit de la derniÃšre adresse IP connue de l'utilisateur dans la base de donnÃ©es.<?php if ($ban_user != '' && isset($user_id)) echo ' <a href="admin_users.php?ip_stats='.$user_id.'">Cliquez ici</a> pour voir les statistiques <acronym title="Internet Protocol" lang="en">IP</acronym> de cet utilisateur.' ?></span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">E-mail/domaine</th>
+									<td>
+										<input type="text" name="ban_email" size="40" maxlength="50" value="<?php if (isset($ban_email)) echo strtolower($ban_email); ?>" tabindex="3" />
+										<span>L'adresse e-mail ou le domaine e-mail que vous souhaitez bannir (<abbr title="exemple">ex.</abbr> utilisateur@domaine.com ou domaine.com). Pour plus d'informations, voir "Autoriser les adresses e-mail bannies" Ã  la page des Permissions.</span>
 									</td>
 								</tr>
 							</table>
-							<p class="topspace"><strong class="warntext"><?php echo $lang_admin_bans['Ban IP range info'] ?></strong></p>
+							<p class="topspace"><strong class="warntext">Vous devez Ãªtres trÃšs vigilant lorsque vous bannissez une plage d'<acronym title="Internet Protocol" lang="en">IP</acronym> car il y a fort probablement plusieurs utilisateurs qui correspondent Ã  la mÃªme <acronym title="Internet Protocol" lang="en">IP</acronym> partielle.</strong></p>
 						</div>
 					</fieldset>
@@ -146,19 +147,19 @@
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_bans['Message expiry subhead'] ?></legend>
+						<legend>Message et Ã©chÃ©ance d'interdiction</legend>
 						<div class="infldset">
 							<table class="aligntop" cellspacing="0">
 								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Ban message label'] ?></th>
+									<th scope="row">Message d'interdiction</th>
 									<td>
 										<input type="text" name="ban_message" size="50" maxlength="255" value="<?php if (isset($ban_message)) echo pun_htmlspecialchars($ban_message); ?>" tabindex="4" />
-										<span><?php echo $lang_admin_bans['Ban message help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Expire date label'] ?></th>
+										<span>Le  message qui sera affichÃ© Ã  l'utilisateur banni lorsqu'il visitera les forums.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">ÃchÃ©ance d'interdiction</th>
 									<td>
 										<input type="text" name="ban_expire" size="17" maxlength="10" value="<?php if (isset($ban_expire)) echo $ban_expire; ?>" tabindex="5" />
-										<span><?php echo $lang_admin_bans['Expire date help'] ?></span>
+										<span>La date Ã  laquelle ce bannissement sera automatiquement supprimÃ© (format: AAAA-MM-JJ). Pour supprimer manuellement, laissez ce champ vide.</span>
 									</td>
 								</tr>
@@ -167,5 +168,5 @@
 					</fieldset>
 				</div>
-				<p class="submitend"><input type="submit" name="add_edit_ban" value="<?php echo $lang_admin_common['Save'] ?>" tabindex="6" /></p>
+				<p class="submitend"><input type="submit" name="add_edit_ban" value=" Enregistrer " tabindex="6" /></p>
 			</form>
 		</div>
@@ -178,4 +179,5 @@
 }
 
+
 // Add/edit a ban (stage 2)
 else if (isset($_POST['add_edit_ban']))
@@ -183,73 +185,34 @@
 	confirm_referrer('admin_bans.php');
 
-	$ban_user = pun_trim($_POST['ban_user']);
+	$ban_user = trim($_POST['ban_user']);
 	$ban_ip = trim($_POST['ban_ip']);
 	$ban_email = strtolower(trim($_POST['ban_email']));
-	$ban_message = pun_trim($_POST['ban_message']);
+	$ban_message = trim($_POST['ban_message']);
 	$ban_expire = trim($_POST['ban_expire']);
 
 	if ($ban_user == '' && $ban_ip == '' && $ban_email == '')
-		message($lang_admin_bans['Must enter message']);
-	else if (strtolower($ban_user) == 'guest')
-		message($lang_admin_bans['Cannot ban guest message']);
-
-	// Make sure we're not banning an admin or moderator
-	if (!empty($ban_user))
-	{
-		$result = $db->query('SELECT group_id FROM '.$db->prefix.'users WHERE username=\''.$db->escape($ban_user).'\' AND id>1') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
-		if ($db->num_rows($result))
-		{
-			$group_id = $db->result($result);
-
-			if ($group_id == PUN_ADMIN)
-				message(sprintf($lang_admin_bans['User is admin message'], pun_htmlspecialchars($ban_user)));
-
-			$result = $db->query('SELECT g_moderator FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to fetch group info', __FILE__, __LINE__, $db->error());
-			$is_moderator_group = $db->result($result);
-
-			if ($is_moderator_group)
-				message(sprintf($lang_admin_bans['User is mod message'], pun_htmlspecialchars($ban_user)));
-		}
-	}
+		message('Vous devez saisir au moins soit un nom d\'utilisateur, soit une adresse <acronym title="Internet Protocol" lang="en">IP</acronym> ou une adresse e-mail.');
 
 	// Validate IP/IP range (it's overkill, I know)
 	if ($ban_ip != '')
 	{
-		$ban_ip = preg_replace('%\s{2,}%S', ' ', $ban_ip);
+		$ban_ip = preg_replace('/[\s]{2,}/', ' ', $ban_ip);
 		$addresses = explode(' ', $ban_ip);
-		$addresses = array_map('pun_trim', $addresses);
+		$addresses = array_map('trim', $addresses);
 
 		for ($i = 0; $i < count($addresses); ++$i)
 		{
-			if (strpos($addresses[$i], ':') !== false)
+			$octets = explode('.', $addresses[$i]);
+
+			for ($c = 0; $c < count($octets); ++$c)
 			{
-				$octets = explode(':', $addresses[$i]);
-
-				for ($c = 0; $c < count($octets); ++$c)
-				{
-					$octets[$c] = ltrim($octets[$c], "0");
-
-					if ($c > 7 || (!empty($octets[$c]) && !ctype_xdigit($octets[$c])) || intval($octets[$c], 16) > 65535)
-						message($lang_admin_bans['Invalid IP message']);
-				}
-
-				$cur_address = implode(':', $octets);
-				$addresses[$i] = $cur_address;
+				$octets[$c] = (strlen($octets[$c]) > 1) ? ltrim($octets[$c], "0") : $octets[$c];
+
+				if ($c > 3 || preg_match('/[^0-9]/', $octets[$c]) || intval($octets[$c]) > 255)
+					message('Vous avez saisi une <acronym title="Internet Protocol" lang="en">IP</acronym>/plage d\'<acronym title="Internet Protocol" lang="en">IP</acronym> incorrecte.');
 			}
-			else
-			{
-				$octets = explode('.', $addresses[$i]);
-
-				for ($c = 0; $c < count($octets); ++$c)
-				{
-					$octets[$c] = (strlen($octets[$c]) > 1) ? ltrim($octets[$c], "0") : $octets[$c];
-
-					if ($c > 3 || preg_match('%[^0-9]%', $octets[$c]) || intval($octets[$c]) > 255)
-						message($lang_admin_bans['Invalid IP message']);
-				}
-
-				$cur_address = implode('.', $octets);
-				$addresses[$i] = $cur_address;
-			}
+
+			$cur_address = implode('.', $octets);
+			$addresses[$i] = $cur_address;
 		}
 
@@ -260,20 +223,14 @@
 	if ($ban_email != '' && !is_valid_email($ban_email))
 	{
-		if (!preg_match('%^[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$%', $ban_email))
-			message($lang_admin_bans['Invalid e-mail message']);
+		if (!preg_match('/^[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/', $ban_email))
+			message('L\'adresse e-mail (<abbr title="exemple">ex.</abbr> utilisateur@domaine.com) ou le domaine d\'adresse e-mail (<abbr title="exemple">ex.</abbr> domaine.com) que vous avez saisi est incorrect.');
 	}
 
 	if ($ban_expire != '' && $ban_expire != 'Never')
 	{
-		$ban_expire = strtotime($ban_expire.' GMT');
-
-		if ($ban_expire == -1 || !$ban_expire)
-			message($lang_admin_bans['Invalid date message'].' '.$lang_admin_bans['Invalid date reasons']);
-
-		$diff = ($pun_user['timezone'] + $pun_user['dst']) * 3600;
-		$ban_expire -= $diff;
-
-		if ($ban_expire <= time())
-			message($lang_admin_bans['Invalid date message'].' '.$lang_admin_bans['Invalid date reasons']);
+		$ban_expire = strtotime($ban_expire);
+
+		if ($ban_expire == -1 || $ban_expire <= time())
+			message('Vous avez saisi une date d\'Ã©chÃ©ance incorrecte. Le format doit Ãªtre AAAA-MM-JJ et la date doit-Ãªtre d\'au moins un jour dans le futur.');
 	}
 	else
@@ -286,19 +243,15 @@
 
 	if ($_POST['mode'] == 'add')
-		$db->query('INSERT INTO '.$db->prefix.'bans (username, ip, email, message, expire, ban_creator) VALUES('.$ban_user.', '.$ban_ip.', '.$ban_email.', '.$ban_message.', '.$ban_expire.', '.$pun_user['id'].')') or error('Unable to add ban', __FILE__, __LINE__, $db->error());
+		$db->query('INSERT INTO '.$db->prefix.'bans (username, ip, email, message, expire) VALUES('.$ban_user.', '.$ban_ip.', '.$ban_email.', '.$ban_message.', '.$ban_expire.')') or error('Impossible d\'ajouter le bannissement', __FILE__, __LINE__, $db->error());
 	else
-		$db->query('UPDATE '.$db->prefix.'bans SET username='.$ban_user.', ip='.$ban_ip.', email='.$ban_email.', message='.$ban_message.', expire='.$ban_expire.' WHERE id='.intval($_POST['ban_id'])) or error('Unable to update ban', __FILE__, __LINE__, $db->error());
+		$db->query('UPDATE '.$db->prefix.'bans SET username='.$ban_user.', ip='.$ban_ip.', email='.$ban_email.', message='.$ban_message.', expire='.$ban_expire.' WHERE id='.intval($_POST['ban_id'])) or error('Impossible de modifier le bannissement', __FILE__, __LINE__, $db->error());
 
 	// Regenerate the bans cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
+	require_once PUN_ROOT.'include/cache.php';
 	generate_bans_cache();
 
-	if ($_POST['mode'] == 'edit')
-		redirect('admin_bans.php', $lang_admin_bans['Ban edited redirect']);
-	else
-		redirect('admin_bans.php', $lang_admin_bans['Ban added redirect']);
+	redirect('admin_bans.php', 'Bannissement '.(($_POST['mode'] == 'edit') ? 'modifiÃ©' : 'ajoutÃ©').'. Redirection ...');
 }
+
 
 // Remove a ban
@@ -311,170 +264,16 @@
 		message($lang_common['Bad request']);
 
-	$db->query('DELETE FROM '.$db->prefix.'bans WHERE id='.$ban_id) or error('Unable to delete ban', __FILE__, __LINE__, $db->error());
+	$db->query('DELETE FROM '.$db->prefix.'bans WHERE id='.$ban_id) or error('Impossible de supprimer le bannissement', __FILE__, __LINE__, $db->error());
 
 	// Regenerate the bans cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
+	require_once PUN_ROOT.'include/cache.php';
 	generate_bans_cache();
 
-	redirect('admin_bans.php', $lang_admin_bans['Ban removed redirect']);
+	redirect('admin_bans.php', 'Bannissement supprimÃ©. Redirection ...');
 }
 
-// Find bans
-else if (isset($_GET['find_ban']))
-{
-	$form = isset($_GET['form']) ? $_GET['form'] : array();
-
-	// trim() all elements in $form
-	$form = array_map('pun_trim', $form);
-	$conditions = $query_str = array();
-
-	$expire_after = isset($_GET['expire_after']) ? trim($_GET['expire_after']) : '';
-	$expire_before = isset($_GET['expire_before']) ? trim($_GET['expire_before']) : '';
-	$order_by = isset($_GET['order_by']) && in_array($_GET['order_by'], array('username', 'ip', 'email', 'expire')) ? 'b.'.$_GET['order_by'] : 'b.username';
-	$direction = isset($_GET['direction']) && $_GET['direction'] == 'DESC' ? 'DESC' : 'ASC';
-
-	$query_str[] = 'order_by='.$order_by;
-	$query_str[] = 'direction='.$direction;
-
-	// Try to convert date/time to timestamps
-	if ($expire_after != '')
-	{
-		$query_str[] = 'expire_after='.$expire_after;
-
-		$expire_after = strtotime($expire_after);
-		if ($expire_after === false || $expire_after == -1)
-			message($lang_admin_bans['Invalid date message']);
-
-		$conditions[] = 'b.expire>'.$expire_after;
-	}
-	if ($expire_before != '')
-	{
-		$query_str[] = 'expire_before='.$expire_before;
-
-		$expire_before = strtotime($expire_before);
-		if ($expire_before === false || $expire_before == -1)
-			message($lang_admin_bans['Invalid date message']);
-
-		$conditions[] = 'b.expire<'.$expire_before;
-	}
-
-	$like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE';
-	foreach ($form as $key => $input)
-	{
-		if ($input != '' && in_array($key, array('username', 'ip', 'email', 'message')))
-		{
-			$conditions[] = 'b.'.$db->escape($key).' '.$like_command.' \''.$db->escape(str_replace('*', '%', $input)).'\'';
-			$query_str[] = 'form%5B'.$key.'%5D='.urlencode($input);
-		}
-	}
-
-	// Fetch ban count
-	$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'bans as b WHERE b.id>0'.(!empty($conditions) ? ' AND '.implode(' AND ', $conditions) : '')) or error('Unable to fetch ban list', __FILE__, __LINE__, $db->error());
-	$num_bans = $db->result($result);
-
-	// Determine the ban offset (based on $_GET['p'])
-	$num_pages = ceil($num_bans / 50);
-
-	$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : intval($_GET['p']);
-	$start_from = 50 * ($p - 1);
-
-	// Generate paging links
-	$paging_links = '<span class="pages-label">'.$lang_common['Pages'].' </span>'.paginate($num_pages, $p, 'admin_bans.php?find_ban=&amp;'.implode('&amp;', $query_str));
-
-	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Bans'], $lang_admin_bans['Results head']);
-	define('PUN_ACTIVE_PAGE', 'admin');
-	require PUN_ROOT.'header.php';
-
-?>
-<div class="linkst">
-	<div class="inbox crumbsplus">
-		<ul class="crumbs">
-			<li><a href="admin_index.php"><?php echo $lang_admin_common['Admin'].' '.$lang_admin_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="admin_bans.php"><?php echo $lang_admin_common['Bans'] ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $lang_admin_bans['Results head'] ?></strong></li>
-		</ul>
-		<div class="pagepost">
-			<p class="pagelink"><?php echo $paging_links ?></p>
-		</div>
-		<div class="clearer"></div>
-	</div>
-</div>
-
-
-<div id="bans1" class="blocktable">
-	<h2><span><?php echo $lang_admin_bans['Results head'] ?></span></h2>
-	<div class="box">
-		<div class="inbox">
-			<table cellspacing="0">
-			<thead>
-				<tr>
-					<th class="tcl" scope="col"><?php echo $lang_admin_bans['Results username head'] ?></th>
-					<th class="tc2" scope="col"><?php echo $lang_admin_bans['Results e-mail head'] ?></th>
-					<th class="tc3" scope="col"><?php echo $lang_admin_bans['Results IP address head'] ?></th>
-					<th class="tc4" scope="col"><?php echo $lang_admin_bans['Results expire head'] ?></th>
-					<th class="tc5" scope="col"><?php echo $lang_admin_bans['Results message head'] ?></th>
-					<th class="tc6" scope="col"><?php echo $lang_admin_bans['Results banned by head'] ?></th>
-					<th class="tcr" scope="col"><?php echo $lang_admin_bans['Results actions head'] ?></th>
-				</tr>
-			</thead>
-			<tbody>
-<?php
-
-	$result = $db->query('SELECT b.id, b.username, b.ip, b.email, b.message, b.expire, b.ban_creator, u.username AS ban_creator_username FROM '.$db->prefix.'bans AS b LEFT JOIN '.$db->prefix.'users AS u ON b.ban_creator=u.id WHERE b.id>0'.(!empty($conditions) ? ' AND '.implode(' AND ', $conditions) : '').' ORDER BY '.$db->escape($order_by).' '.$db->escape($direction).' LIMIT '.$start_from.', 50') or error('Unable to fetch ban list', __FILE__, __LINE__, $db->error());
-	if ($db->num_rows($result))
-	{
-		while ($ban_data = $db->fetch_assoc($result))
-		{
-
-			$actions = '<a href="admin_bans.php?edit_ban='.$ban_data['id'].'">'.$lang_admin_common['Edit'].'</a> | <a href="admin_bans.php?del_ban='.$ban_data['id'].'">'.$lang_admin_common['Remove'].'</a>';
-			$expire = format_time($ban_data['expire'], true);
-
-?>
-				<tr>
-					<td class="tcl"><?php echo ($ban_data['username'] != '') ? pun_htmlspecialchars($ban_data['username']) : '&#160;' ?></td>
-					<td class="tc2"><?php echo ($ban_data['email'] != '') ? $ban_data['email'] : '&#160;' ?></td>
-					<td class="tc3"><?php echo ($ban_data['ip'] != '') ? $ban_data['ip'] : '&#160;' ?></td>
-					<td class="tc4"><?php echo $expire ?></td>
-					<td class="tc5"><?php echo ($ban_data['message'] != '') ? pun_htmlspecialchars($ban_data['message']) : '&#160;' ?></td>
-					<td class="tc6"><?php echo ($ban_data['ban_creator_username'] != '') ? '<a href="profile.php?id='.$ban_data['ban_creator'].'">'.pun_htmlspecialchars($ban_data['ban_creator_username']).'</a>' : $lang_admin_bans['Unknown'] ?></td>
-					<td class="tcr"><?php echo $actions ?></td>
-				</tr>
-<?php
-
-		}
-	}
-	else
-		echo "\t\t\t\t".'<tr><td class="tcl" colspan="7">'.$lang_admin_bans['No match'].'</td></tr>'."\n";
-
-?>
-			</tbody>
-			</table>
-		</div>
-	</div>
-</div>
-
-<div class="linksb">
-	<div class="inbox crumbsplus">
-		<div class="pagepost">
-			<p class="pagelink"><?php echo $paging_links ?></p>
-		</div>
-		<ul class="crumbs">
-			<li><a href="admin_index.php"><?php echo $lang_admin_common['Admin'].' '.$lang_admin_common['Index'] ?></a></li>
-			<li><span>Â»&#160;</span><a href="admin_bans.php"><?php echo $lang_admin_common['Bans'] ?></a></li>
-			<li><span>Â»&#160;</span><strong><?php echo $lang_admin_bans['Results head'] ?></strong></li>
-		</ul>
-		<div class="clearer"></div>
-	</div>
-</div>
-<?php
-
-	require PUN_ROOT.'footer.php';
-}
-
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Bans']);
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Bannissement';
 $focus_element = array('bans', 'new_ban_user');
-define('PUN_ACTIVE_PAGE', 'admin');
 require PUN_ROOT.'header.php';
 
@@ -483,17 +282,17 @@
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_bans['New ban head'] ?></span></h2>
+		<h2><span>Nouveau bannissement</span></h2>
 		<div class="box">
 			<form id="bans" method="post" action="admin_bans.php?action=more">
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_bans['Add ban subhead'] ?></legend>
+						<legend>Ajouter un bannissement</legend>
 						<div class="infldset">
 							<table class="aligntop" cellspacing="0">
 								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Username label'] ?><div><input type="submit" name="add_ban" value="<?php echo $lang_admin_common['Add'] ?>" tabindex="2" /></div></th>
+									<th scope="row">Nom d'utilisateur<div><input type="submit" name="add_ban" value=" Ajouter " tabindex="2" /></div></th>
 									<td>
 										<input type="text" name="new_ban_user" size="25" maxlength="25" tabindex="1" />
-										<span><?php echo $lang_admin_bans['Username advanced help'] ?></span>
+										<span>Le nom d'utilisateur Ã  bannir (insensible Ã  la casse). La page suivante vous permettra d'entrer une adresse <acronym title="Internet Protocol" lang="en">IP</acronym> et/ou une adresse e-mail de votre choix. Si vous souhaitez bannir une adresse <acronym title="Internet Protocol" lang="en">IP</acronym>, une plage d'adresses <acronym title="Internet Protocol" lang="en">IP</acronym> ou une adresse e-mail, laissez simplement ce champ vide.</span>
 									</td>
 								</tr>
@@ -505,60 +304,52 @@
 		</div>
 
-		<h2 class="block2"><span><?php echo $lang_admin_bans['Ban search head'] ?></span></h2>
+		<h2 class="block2"><span>Bannissements actuels</span></h2>
 		<div class="box">
-			<form id="find_band" method="get" action="admin_bans.php">
-				<p class="submittop"><input type="submit" name="find_ban" value="<?php echo $lang_admin_bans['Submit search'] ?>" tabindex="3" /></p>
+			<div class="fakeform">
+<?php
+
+$result = $db->query('SELECT id, username, ip, email, message, expire FROM '.$db->prefix.'bans ORDER BY id') or error('Impossible de retrouver la liste des bannissements', __FILE__, __LINE__, $db->error());
+if ($db->num_rows($result))
+{
+	while ($cur_ban = $db->fetch_assoc($result))
+	{
+		$expire = format_time($cur_ban['expire'], true);
+
+?>
 				<div class="inform">
 					<fieldset>
-						<legend><?php echo $lang_admin_bans['Ban search subhead'] ?></legend>
+						<legend>Date d'Ã©chÃ©ance&#160;: <?php echo $expire ?></legend>
 						<div class="infldset">
-							<p><?php echo $lang_admin_bans['Ban search info'] ?></p>
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Username label'] ?></th>
-									<td><input type="text" name="form[username]" size="25" maxlength="25" tabindex="4" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['IP label'] ?></th>
-									<td><input type="text" name="form[ip]" size="30" maxlength="255" tabindex="5" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['E-mail label'] ?></th>
-									<td><input type="text" name="form[email]" size="30" maxlength="80" tabindex="6" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Message label'] ?></th>
-									<td><input type="text" name="form[message]" size="30" maxlength="255" tabindex="7" /></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Expire after label'] ?></th>
-									<td><input type="text" name="expire_after" size="10" maxlength="10" tabindex="8" />
-									<span><?php echo $lang_admin_bans['Date help'] ?></span></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Expire before label'] ?></th>
-									<td><input type="text" name="expire_before" size="10" maxlength="10" tabindex="9" />
-									<span><?php echo $lang_admin_bans['Date help'] ?></span></td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_bans['Order by label'] ?></th>
-									<td>
-										<select name="order_by" tabindex="10">
-											<option value="username" selected="selected"><?php echo $lang_admin_bans['Order by username'] ?></option>
-											<option value="ip"><?php echo $lang_admin_bans['Order by ip'] ?></option>
-											<option value="email"><?php echo $lang_admin_bans['Order by e-mail'] ?></option>
-											<option value="expire"><?php echo $lang_admin_bans['Order by expire'] ?></option>
-										</select>&#160;&#160;&#160;<select name="direction" tabindex="11">
-											<option value="ASC" selected="selected"><?php echo $lang_admin_bans['Ascending'] ?></option>
-											<option value="DESC"><?php echo $lang_admin_bans['Descending'] ?></option>
-										</select>
-									</td>
-								</tr>
-							</table>
+							<table cellspacing="0">
+<?php if ($cur_ban['username'] != ''): ?>								<tr>
+									<th>Nom d'utilisateur</th>
+									<td><?php echo pun_htmlspecialchars($cur_ban['username']) ?></td>
+								</tr>
+<?php endif; ?><?php if ($cur_ban['email'] != ''): ?>								<tr>
+									<th>E-mail</th>
+									<td><?php echo $cur_ban['email'] ?></td>
+								</tr>
+<?php endif; ?><?php if ($cur_ban['ip'] != ''): ?>								<tr>
+									<th><acronym title="Internet Protocol" lang="en">IP</acronym>/plage d'<acronym title="Internet Protocol" lang="en">IP</acronym></th>
+									<td><?php echo $cur_ban['ip'] ?></td>
+								</tr>
+<?php endif; ?><?php if ($cur_ban['message'] != ''): ?>								<tr>
+									<th>Motif</th>
+									<td><?php echo pun_htmlspecialchars($cur_ban['message']) ?></td>
+								</tr>
+<?php endif; ?>							</table>
+							<p class="linkactions"><a href="admin_bans.php?edit_ban=<?php echo $cur_ban['id'] ?>">Modifier</a> - <a href="admin_bans.php?del_ban=<?php echo $cur_ban['id'] ?>">Supprimer</a></p>
 						</div>
 					</fieldset>
 				</div>
-				<p class="submitend"><input type="submit" name="find_ban" value="<?php echo $lang_admin_bans['Submit search'] ?>" tabindex="12" /></p>
-			</form>
+<?php
+
+	}
+}
+else
+	echo "\t\t\t\t".'<p>Aucun bannissement Ã  lister.</p>'."\n";
+
+?>
+			</div>
 		</div>
 	</div>
