Index: trunk/web/punbb/admin_permissions.php
===================================================================
--- trunk/web/punbb/admin_permissions.php	(revision 10)
+++ trunk/web/punbb/admin_permissions.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)
+if ($pun_user['g_id'] > PUN_ADMIN)
 	message($lang_common['No permission']);
 
-// Load the admin_permissions.php language file
-require PUN_ROOT.'lang/'.$admin_language.'/admin_permissions.php';
 
 if (isset($_POST['form_sent']))
@@ -27,145 +42,181 @@
 	$form = array_map('intval', $_POST['form']);
 
-	foreach ($form as $key => $input)
+	while (list($key, $input) = @each($form))
 	{
 		// Only update values that have changed
 		if (array_key_exists('p_'.$key, $pun_config) && $pun_config['p_'.$key] != $input)
-			$db->query('UPDATE '.$db->prefix.'config SET conf_value='.$input.' WHERE conf_name=\'p_'.$db->escape($key).'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error());
+			$db->query('UPDATE '.$db->prefix.'config SET conf_value='.$input.' WHERE conf_name=\'p_'.$db->escape($key).'\'') or error('Impossible de mettre Ã  jour la configuration des forums', __FILE__, __LINE__, $db->error());
 	}
 
 	// Regenerate the config cache
-	if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
-		require PUN_ROOT.'include/cache.php';
-
+	require_once PUN_ROOT.'include/cache.php';
 	generate_config_cache();
 
-	redirect('admin_permissions.php', $lang_admin_permissions['Perms updated redirect']);
+	redirect('admin_permissions.php', 'Permissions modifiÃ©es. Redirection ...');
 }
 
-$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Permissions']);
-define('PUN_ACTIVE_PAGE', 'admin');
+
+$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Permissions';
 require PUN_ROOT.'header.php';
-
 generate_admin_menu('permissions');
 
 ?>
 	<div class="blockform">
-		<h2><span><?php echo $lang_admin_permissions['Permissions head'] ?></span></h2>
+		<h2><span>Permissions</span></h2>
 		<div class="box">
 			<form method="post" action="admin_permissions.php">
-				<p class="submittop"><input type="submit" name="save" value="<?php echo $lang_admin_common['Save changes'] ?>" /></p>
-				<div class="inform">
-					<input type="hidden" name="form_sent" value="1" />
-					<fieldset>
-						<legend><?php echo $lang_admin_permissions['Posting subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['BBCode label'] ?></th>
-									<td>
-										<input type="radio" name="form[message_bbcode]" value="1"<?php if ($pun_config['p_message_bbcode'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[message_bbcode]" value="0"<?php if ($pun_config['p_message_bbcode'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['BBCode help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['Image tag label'] ?></th>
-									<td>
-										<input type="radio" name="form[message_img_tag]" value="1"<?php if ($pun_config['p_message_img_tag'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[message_img_tag]" value="0"<?php if ($pun_config['p_message_img_tag'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['Image tag help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['All caps message label'] ?></th>
-									<td>
-										<input type="radio" name="form[message_all_caps]" value="1"<?php if ($pun_config['p_message_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[message_all_caps]" value="0"<?php if ($pun_config['p_message_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['All caps message help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['All caps subject label'] ?></th>
-									<td>
-										<input type="radio" name="form[subject_all_caps]" value="1"<?php if ($pun_config['p_subject_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[subject_all_caps]" value="0"<?php if ($pun_config['p_subject_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['All caps subject help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['Require e-mail label'] ?></th>
-									<td>
-										<input type="radio" name="form[force_guest_email]" value="1"<?php if ($pun_config['p_force_guest_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[force_guest_email]" value="0"<?php if ($pun_config['p_force_guest_email'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['Require e-mail help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_permissions['Signatures subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['BBCode sigs label'] ?></th>
-									<td>
-										<input type="radio" name="form[sig_bbcode]" value="1"<?php if ($pun_config['p_sig_bbcode'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[sig_bbcode]" value="0"<?php if ($pun_config['p_sig_bbcode'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['BBCode sigs help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['Image tag sigs label'] ?></th>
-									<td>
-										<input type="radio" name="form[sig_img_tag]" value="1"<?php if ($pun_config['p_sig_img_tag'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[sig_img_tag]" value="0"<?php if ($pun_config['p_sig_img_tag'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['Image tag sigs help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['All caps sigs label'] ?></th>
-									<td>
-										<input type="radio" name="form[sig_all_caps]" value="1"<?php if ($pun_config['p_sig_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[sig_all_caps]" value="0"<?php if ($pun_config['p_sig_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['All caps sigs help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['Max sig length label'] ?></th>
+				<p class="submittop"><input type="submit" name="save" value=" Enregistrer " /></p>
+				<div class="inform">
+				<input type="hidden" name="form_sent" value="1" />
+					<fieldset>
+						<legend>Ãcriture</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">BBCode</th>
+									<td>
+										<input type="radio" name="form[message_bbcode]" value="1"<?php if ($pun_config['p_message_bbcode'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[message_bbcode]" value="0"<?php if ($pun_config['p_message_bbcode'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser l'utilisaton du BBCode dans les messages (recommandÃ©).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Balise Image</th>
+									<td>
+										<input type="radio" name="form[message_img_tag]" value="1"<?php if ($pun_config['p_message_img_tag'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[message_img_tag]" value="0"<?php if ($pun_config['p_message_img_tag'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser l'utilisation de la balise BBCode [img][/img] dans les messages.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Message tout en majuscules</th>
+									<td>
+										<input type="radio" name="form[message_all_caps]" value="1"<?php if ($pun_config['p_message_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[message_all_caps]" value="0"<?php if ($pun_config['p_message_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les messages qui ne contiennent que des lettres en majuscules.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Sujet tout en majuscules</th>
+									<td>
+										<input type="radio" name="form[subject_all_caps]" value="1"<?php if ($pun_config['p_subject_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[subject_all_caps]" value="0"<?php if ($pun_config['p_subject_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les sujets qui ne contiennent que des lettres en majuscules.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">E-mail invitÃ© obligatoire</th>
+									<td>
+										<input type="radio" name="form[force_guest_email]" value="1"<?php if ($pun_config['p_force_guest_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[force_guest_email]" value="0"<?php if ($pun_config['p_force_guest_email'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Obliger les invitÃ©s Ã  donner une adresse e-mail pour Ã©crire un message.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Signatures</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">BBCode dans les signatures</th>
+									<td>
+										<input type="radio" name="form[sig_bbcode]" value="1"<?php if ($pun_config['p_sig_bbcode'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[sig_bbcode]" value="0"<?php if ($pun_config['p_sig_bbcode'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser l'utilisation du BBCodes dans les signatures des utilisateurs.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Balise image dans les signatures</th>
+									<td>
+										<input type="radio" name="form[sig_img_tag]" value="1"<?php if ($pun_config['p_sig_img_tag'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[sig_img_tag]" value="0"<?php if ($pun_config['p_sig_img_tag'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser l'utilisation de la balise BBCode [img][/img] dans la signature des utilisateurs (non recommandÃ©).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Signature tout en majuscules</th>
+									<td>
+										<input type="radio" name="form[sig_all_caps]" value="1"<?php if ($pun_config['p_sig_all_caps'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[sig_all_caps]" value="0"<?php if ($pun_config['p_sig_all_caps'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les signatures qui ne contiennent que des lettres en majuscules.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Longueur maximum des signatures</th>
 									<td>
 										<input type="text" name="form[sig_length]" size="5" maxlength="5" value="<?php echo $pun_config['p_sig_length'] ?>" />
-										<span><?php echo $lang_admin_permissions['Max sig length help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['Max sig lines label'] ?></th>
+										<span>Le nombre maximum de caractÃšres qu'une signature d'utilisateur puisse contenir.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Nombre maximum de lignes dans les signatures</th>
 									<td>
 										<input type="text" name="form[sig_lines]" size="3" maxlength="3" value="<?php echo $pun_config['p_sig_lines'] ?>" />
-										<span><?php echo $lang_admin_permissions['Max sig lines help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<div class="inform">
-					<fieldset>
-						<legend><?php echo $lang_admin_permissions['Registration subhead'] ?></legend>
-						<div class="infldset">
-							<table class="aligntop" cellspacing="0">
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['Banned e-mail label'] ?></th>
-									<td>
-										<input type="radio" name="form[allow_banned_email]" value="1"<?php if ($pun_config['p_allow_banned_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[allow_banned_email]" value="0"<?php if ($pun_config['p_allow_banned_email'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['Banned e-mail help'] ?></span>
-									</td>
-								</tr>
-								<tr>
-									<th scope="row"><?php echo $lang_admin_permissions['Duplicate e-mail label'] ?></th>
-									<td>
-										<input type="radio" name="form[allow_dupe_email]" value="1"<?php if ($pun_config['p_allow_dupe_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['Yes'] ?></strong>&#160;&#160;&#160;<input type="radio" name="form[allow_dupe_email]" value="0"<?php if ($pun_config['p_allow_dupe_email'] == '0') echo ' checked="checked"' ?> />&#160;<strong><?php echo $lang_admin_common['No'] ?></strong>
-										<span><?php echo $lang_admin_permissions['Duplicate e-mail help'] ?></span>
-									</td>
-								</tr>
-							</table>
-						</div>
-					</fieldset>
-				</div>
-				<p class="submitend"><input type="submit" name="save" value="<?php echo $lang_admin_common['Save changes'] ?>" /></p>
+										<span>Le nombre maximum de lignes qu'une signature d'utilisateur puisse contenir.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>ModÃ©rateurs</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Modifier les profils utilisateurs</th>
+									<td>
+										<input type="radio" name="form[mod_edit_users]" value="1"<?php if ($pun_config['p_mod_edit_users'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[mod_edit_users]" value="0"<?php if ($pun_config['p_mod_edit_users'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les modÃ©rateurs Ã  modifier les profils des utilisateurs.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Renommer utilisateurs</th>
+									<td>
+										<input type="radio" name="form[mod_rename_users]" value="1"<?php if ($pun_config['p_mod_rename_users'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[mod_rename_users]" value="0"<?php if ($pun_config['p_mod_rename_users'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les modÃ©rateurs Ã  renommer les utilisateurs. A l'exception des autres modÃ©rateurs et des administrateurs.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Changer les mots de passe des utilisateurs</th>
+									<td>
+										<input type="radio" name="form[mod_change_passwords]" value="1"<?php if ($pun_config['p_mod_change_passwords'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[mod_change_passwords]" value="0"<?php if ($pun_config['p_mod_change_passwords'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les modÃ©rateurs Ã  changer les mots de passe des utilisateurs. A l'exception des autres modÃ©rateurs et des administrateurs.</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Bannir utilisateurs</th>
+									<td>
+										<input type="radio" name="form[mod_ban_users]" value="1"<?php if ($pun_config['p_mod_ban_users'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[mod_ban_users]" value="0"<?php if ($pun_config['p_mod_ban_users'] == '0') echo ' checked="checked"' ?> />&#160;<strong>Non</strong>
+										<span>Autoriser les modÃ©rateurs Ã  bannir les utilisateurs (et modifier/supprimer les bannissements en cours).</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<div class="inform">
+					<fieldset>
+						<legend>Inscriptions</legend>
+						<div class="infldset">
+							<table class="aligntop" cellspacing="0">
+								<tr>
+									<th scope="row">Autoriser les adresses e-mail bannies</th>
+									<td>
+										<input type="radio" name="form[allow_banned_email]" value="1"<?php if ($pun_config['p_allow_banned_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[allow_banned_email]" value="0"<?php if ($pun_config['p_allow_banned_email'] == '0') echo ' checked="checked"' ?> />
+										&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs Ã  s'inscrire (ou changer d'adresse) avec une adresse/un domaine e-mail bannis. Si vous laissez cette option Ã  son rÃ©glage par dÃ©faut (oui) ceci sera possible mais une alerte par e-mail sera envoyÃ©e Ã  la liste d'adresses e-mail des forums (une maniÃšre efficace pour dÃ©tecter les inscriptions multiples).</span>
+									</td>
+								</tr>
+								<tr>
+									<th scope="row">Autoriser les adresses e-mail en double</th>
+									<td>
+										<input type="radio" name="form[allow_dupe_email]" value="1"<?php if ($pun_config['p_allow_dupe_email'] == '1') echo ' checked="checked"' ?> />&#160;<strong>Oui</strong>&#160;&#160;&#160;<input type="radio" name="form[allow_dupe_email]" value="0"<?php if ($pun_config['p_allow_dupe_email'] == '0') echo ' checked="checked"' ?> />
+										&#160;<strong>Non</strong>
+										<span>Autoriser les utilisateurs Ã  s'inscrire avec une adresse e-mail dÃ©jÃ  utilisÃ©e par un autre nom d'utilisateur. Si autorisÃ© une alerte e-mail sera envoyÃ©e Ã  la liste d'adresses e-mail des forums lorsqu'un doublon sera dÃ©tectÃ©.</span>
+									</td>
+								</tr>
+							</table>
+						</div>
+					</fieldset>
+				</div>
+				<p class="submitend"><input type="submit" name="save" value=" Enregistrer " /></p>
 			</form>
 		</div>
