Index: /extensions/event_cats/admin/autolog_entries.inc.php
===================================================================
--- /extensions/event_cats/admin/autolog_entries.inc.php	(revision 4328)
+++ /extensions/event_cats/admin/autolog_entries.inc.php	(revision 4329)
@@ -38,17 +38,5 @@
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-global $template, $conf, $page,
- $ec_lists,   // array of following arrays :
-              //   $ec_lists['ec_table'] :
-              //     Event Cats table, in function of each entry id
-              //   $ec_lists['ec_codes'] : // Used ?
-              //     array of useful data, in function of entries codes
-              //   $ec_lists['add_pages'] :
-              //     array of Add. Pages names in function of their id
-              //   $ec_lists['categories'] :
-              //     array of category names in function of their id
-              //   $ec_lists['user_ids'] :
-              //     array of usernames in function of their id
- $ec_ap_ok;   // whether Additional Pages is installed and activated
+global $template, $conf, $page, $ec_lists;
 
 /****************************************************************************/
@@ -94,16 +82,12 @@
       switch ($a) {
         case 0: // Home
-          $dspl = l10n('ec_dspl_ok_home');
+          $dspl = l10n('Home');
         break;
         case 1: // Category
         case 3: // Image
           $url_end = ($ec_entry['forced'] == 'true') ? '' : '&amp;cat='.$arg1;
-          $dspl =
-           l10n('ec_dspl_ok_cat_pre').
-           $arg1.
-           l10n('ec_dspl_ok_cat_mid').
-           $ec_lists['categories'][$arg1_int].
-           l10n('ec_dspl_ok_cat_end')
-          ;
+          $dspl = sprintf(
+            l10n('ec_dspl_ok_cat'), $arg1, $ec_lists['categories'][$arg1_int]
+          );
           if (is_in($ec_entry['action'], '_img_pb')) {
             $url_end.= ($url_end == '') ? '' : '&amp;img='.$arg2;
@@ -112,9 +96,5 @@
             $dspl.=
              '<br>'.$span_err_pre.
-             l10n('ec_dspl_nok_img2_pre').
-             $arg2.
-             l10n('ec_dspl_nok_img2_mid').
-             $arg1.
-             l10n('ec_dspl_nok_img2_end').
+             sprintf(l10n('ec_dspl_nok_img2'), $arg2, $arg1).
              $span_err_end
             ;
@@ -122,32 +102,19 @@
           elseif ($a == 3) { // Image
             $url_end.= ($url_end == '') ? '' : '&amp;img='.$arg2;
-            $t = mysql_fetch_row(pwg_query('
+            $t = mysql_fetch_row(pwg_query("
              SELECT `name`, `file`
-             FROM `'.IMAGES_TABLE.'`
-             WHERE `id` = "'.$arg2.'"
-            '));
-            $dspl.=
-             '<br>'.
-             l10n('ec_dspl_ok_img2_pre').
-             $arg2.
-             l10n('ec_dspl_ok_img2_mid1').
-             $t[0].
-             l10n('ec_dspl_ok_img2_mid2').
-             $t[1].
-             l10n('ec_dspl_ok_img2_end')
-            ;
+             FROM `".IMAGES_TABLE."`
+             WHERE `id` = $arg2
+            "));
+            $dspl.= '<br>'.
+             sprintf(l10n('ec_dspl_ok_img2'), $arg2, $t[0], $t[1]);
           }
         break;
         case 2: // Additional Page
           $url_end = ($ec_entry['forced'] == 'true') ? '' : '&amp;ap='.$arg2;
-          $dspl = ($ec_ap_ok) ?
-           l10n('ec_dspl_ok_ap_pre').
-           $arg2.
-           l10n('ec_dspl_ok_ap_mid').
-           $ec_lists['add_pages'][$arg2_int].
-           l10n('ec_dspl_ok_ap_end')
-          :
-           l10n('ec_dspl_ok_home')
-          ;
+          $dspl = (EC_AP_OK) ? sprintf(
+            l10n('ec_dspl_ok_ap'),
+            $arg2, $ec_lists['add_pages'][$arg2_int]
+          ) : l10n('Home');
         break;
       }
@@ -156,16 +123,11 @@
     case 'ec_nok' :
       if (empty($ec_entry['arg2'])) {
-        $dspl = l10n('ec_dspl_nok_acc_denied');
+        $dspl = l10n('Access denied');
       }
       else {
-        $dspl = ($ec_ap_ok) ?
-         l10n('ec_dspl_ok_ap_pre').
-         $arg2.
-         l10n('ec_dspl_ok_ap_mid').
-         $ec_lists['add_pages'][$arg2_int].
-         l10n('ec_dspl_ok_ap_end')
-        :
-         l10n('ec_dspl_nok_acc_denied')
-        ;
+        $dspl = (EC_AP_OK) ? sprintf(
+            l10n('ec_dspl_ok_ap'),
+            $arg2, $ec_lists['add_pages'][$arg2_int]
+          ) : l10n('Access denied');
       }
     break;
@@ -177,14 +139,12 @@
       if (is_in($ec_entry['action'], 'ec_ok')) {
         $url_end = ($ec_entry['forced'] == 'true') ? '' : '&amp;ap='.$arg2;
-        $dspl = l10n('ec_dspl_ok_home');
+        $dspl = l10n('Home');
       }
       else {
-        $dspl = l10n('ec_dspl_nok_acc_denied');
+        $dspl = l10n('Access denied');
       }
       $dspl.=
        $span_err_pre.
-       l10n('ec_dspl_nok_ap_pre').
-       $arg2.
-       l10n('ec_dspl_nok_ap_end').
+       sprintf(l10n('ec_dspl_nok_ap'), $arg2).
        $span_err_end
       ;
@@ -196,9 +156,7 @@
        $ec_entry['code'].' : '.l10n('ec_category_miss');
       $dspl =
-       l10n('ec_dspl_nok_home').
-       $span_err_pre.
-       l10n('ec_dspl_nok_img1_pre').
-       $arg1.
-       l10n('ec_dspl_nok_img1_end').
+       l10n('Home').
+       $span_err_pre.
+       sprintf(l10n('ec_dspl_nok_cat'), $arg1).
        $span_err_end
       ;
@@ -213,5 +171,5 @@
        $span_err_end
       ;
-      $dspl = l10n('ec_dspl_ok_home');
+      $dspl = l10n('Home');
     break;
     
@@ -224,5 +182,5 @@
        $span_err_end
       ;
-      $dspl = l10n('ec_dspl_ok_home');
+      $dspl = l10n('Home');
     break;
     
@@ -232,10 +190,8 @@
       $username =
        $span_err_pre.
-       l10n('ec_dspl_nok_usr_pre').
-       $ec_entry['user_id'].
-       l10n('ec_dspl_nok_usr_end').
-       $span_err_end
-      ;
-      $dspl = l10n('ec_dspl_ok_home');
+       sprintf(l10n('ec_dspl_nok_usr'), $ec_entry['user_id']).
+       $span_err_end
+      ;
+      $dspl = l10n('Home');
     break;
   }
@@ -264,6 +220,7 @@
 }
 
-$template->assign('ec_ap_ok',$ec_ap_ok);
-$template->assign('code_list',$code_list);
+$template->assign('ec_ap_ok',  EC_AP_OK);
+$template->assign('ec_ap_ok2', (count($ec_lists['add_pages']) > 0));
+$template->assign('code_list', $code_list);
 
 ?>
Index: /extensions/event_cats/admin/autolog_new.inc.php
===================================================================
--- /extensions/event_cats/admin/autolog_new.inc.php	(revision 4328)
+++ /extensions/event_cats/admin/autolog_new.inc.php	(revision 4329)
@@ -38,17 +38,5 @@
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-global $template, $conf, $page,
- $ec_lists,   // array of following arrays :
-              //   $ec_lists['ec_table'] :
-              //     Event Cats table, in function of each entry id
-              //   $ec_lists['ec_codes'] : // Used ?
-              //     array of useful data, in function of entries codes
-              //   $ec_lists['add_pages'] :
-              //     array of Add. Pages names in function of their id
-              //   $ec_lists['categories'] :
-              //     array of category names in function of their id
-              //   $ec_lists['user_ids'] :
-              //     array of usernames in function of their id
- $ec_ap_ok;   // whether Additional Pages is installed and activated
+global $template, $conf, $page, $ec_lists, $ec_conf_possible_values;
 
 /****************************************************************************/
@@ -79,12 +67,15 @@
       case 'create':
         $ec_default_action = $_POST['ec_act1'];
-        $ec_default_entry = $_POST['ec_entry_sel'];
+        $ec_default_entry =  $_POST['ec_entry_sel'];
       break;
       default:
-        $page['errors'][] = 'Demande inconnue : $_POST[\'ec_act1\'] = '.$_POST['ec_act1'];
+        $page['errors'][] =
+         'Bad argument : $_POST[\'ec_act1\'] = '.$_POST['ec_act1'];
     }
   }
   else
-   $page['errors'][] = 'Tentative d\'utilisation d\'une entrée inexistante ($_POST[\'ec_entry_sel\'] = '.$_POST['ec_entry_sel'].')';
+   $page['errors'][] =
+    'Entry doesn\'t exist ($_POST[\'ec_entry_sel\'] = '.
+    $_POST['ec_entry_sel'].')';
 }
 
@@ -97,8 +88,8 @@
   (count($ec_lists['user_ids']) == 0) ? 'style = "display:none;"' : ''
 );
-$template->assign('ec_no_assoc', ((mysql_num_rows(pwg_query('
+$template->assign('ec_no_assoc', ((mysql_num_rows(pwg_query("
   SELECT *
-  FROM `'.IMAGE_CATEGORY_TABLE.'`
-'))) == 0));
+  FROM `".IMAGE_CATEGORY_TABLE."`
+"))) == 0));
 $template->assign('ec_is_creation', (
     $ec_default_action == 'duplicate_entry_submit' or
@@ -108,9 +99,11 @@
   )
 );
-$template->assign('ec_ap_ok',               $ec_ap_ok);
+$template->assign('ec_ap_ok',               EC_AP_OK);
 $template->assign('ec_lists',               $ec_lists);
 $template->assign('ec_default_entry',       $ec_default_entry);
 $template->assign('ec_default_action',      $ec_default_action);
 $template->assign('ec_def_auto_code_dg_nb', $ec_def_auto_code_dg_nb);
+$template->assign('ec_auto_code_dg_nb',
+ $ec_conf_possible_values['auto_code_dg_nb']);
 
 ?>
Index: /extensions/event_cats/admin/config.inc.php
===================================================================
--- /extensions/event_cats/admin/config.inc.php	(revision 4328)
+++ /extensions/event_cats/admin/config.inc.php	(revision 4329)
@@ -1,3 +1,72 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | Plugin Name : Event Cats                                              |
+// | Plugin Version : 1.0                                                  |
+// | File Version : 1.0                                                    |
+// | Plugin Version author : LucMorizur                                    |
+// | Plugin description : (plugin for Piwigo, http://piwigo.org )          |
+// | This plugin allows an account to be automatically logged in ; and to  |
+// | let users duplicate the account they are logged with, to get benefits |
+// | of the groups of the previous account, immediately on their new acc.  |
+// | Ce plugin permet d'identifier automatiquement un compte ; et permet à |
+// | un utilisateur de dupliquer un compte, pour que le nouveau compte     |
+// | bénéficie immédiatement de l'affectation aux groupes de l'ancien cpte |
+// +-----------------------------------------------------------------------+
+
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program 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                                          |
+// |                                                                       |
+// | This program 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $ec_conf_default, $ec_conf;
+
+// +-----------------------------------------------------------------------+
+// | Global configuration management                                       |
+// +-----------------------------------------------------------------------+
+
+// Gets $lang['Register'] and $lang['Duplicate']
+load_language('common.lang');
+load_language('duplic.lang', EVNTCATS_PATH);
+
+$template->assign(
+  'ec_dup_link_conf',
+  sprintf(
+    l10n('Register replacement'),
+    '&nbsp;&nbsp;<br />', // nicer line feed
+    $lang['Register'],
+    $lang['Duplicate']
+  )
+);
+
+// In case some $lang have the same index, overwrites them to have the ones
+// needed here
+load_language('plugin.lang', EVNTCATS_PATH);
+
+$template->assign('ec_ap_ok', EC_AP_OK);
+$template->assign('add_pages', $ec_lists['add_pages']);
+
+// Sends configuration values to the template, described per key
+$ec_conf2 = array(); $i = 0;
+foreach ($ec_conf_default as $k => $v) { $ec_conf2[$k] = $ec_conf[$i]; $i++; }
+$template->assign('ec_conf', $ec_conf2);
 
 ?>
Index: /extensions/event_cats/admin/duplication.inc.php
===================================================================
--- /extensions/event_cats/admin/duplication.inc.php	(revision 4328)
+++ /extensions/event_cats/admin/duplication.inc.php	(revision 4329)
@@ -1,30 +1,73 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | Plugin Name : Event Cats                                              |
+// | Plugin Version : 1.0                                                  |
+// | File Version : 1.0                                                    |
+// | Plugin Version author : LucMorizur                                    |
+// | Plugin description : (plugin for Piwigo, http://piwigo.org )          |
+// | This plugin allows an account to be automatically logged in ; and to  |
+// | let users duplicate the account they are logged with, to get benefits |
+// | of the groups of the previous account, immediately on their new acc.  |
+// | Ce plugin permet d'identifier automatiquement un compte ; et permet à |
+// | un utilisateur de dupliquer un compte, pour que le nouveau compte     |
+// | bénéficie immédiatement de l'affectation aux groupes de l'ancien cpte |
+// +-----------------------------------------------------------------------+
 
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program 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                                          |
+// |                                                                       |
+// | This program 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.                                                                  |
+// +-----------------------------------------------------------------------+
 
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
+global $ec_conf_default;
 
+// +-----------------------------------------------------------------------+
+// | Duplication granted per groups/types/users management                 |
+// +-----------------------------------------------------------------------+
 
-
-/* */
-
-
-
-
-
-
-
-
+// In evntcats_main_funcs.inc.php ; determines all granted groups/types/users
+// Thanks to "true" parameter, assigns to the template all needed variables
 build_dup_arrays(true);
 
+// Gets $lang['Register'] and $lang['Duplicate']
+load_language('common.lang');
+load_language('duplic.lang', EVNTCATS_PATH);
 
+$template->assign(
+  'ec_dup_link_conf',
+  sprintf(
+    l10n('Register replacement'),
+    '&nbsp;&nbsp;<br />', // nicer line feed
+    $lang['Register'],
+    $lang['Duplicate']
+  )
+);
 
+// In case some $lang have the same index, overwrites them to have the ones
+// needed here
+load_language('plugin.lang', EVNTCATS_PATH);
 
-
-
-
-
-
-
-
+$ec_conf2 = array();
+$ec_conf2['dup_allow'] = read_ec_conf('dup_allow');
+$ec_conf2['duplic_display'] = read_ec_conf('duplic_display');
+$template->assign('ec_conf', $ec_conf2);
 
 ?>
Index: /extensions/event_cats/admin/evntcats_admin.php
===================================================================
--- /extensions/event_cats/admin/evntcats_admin.php	(revision 4328)
+++ /extensions/event_cats/admin/evntcats_admin.php	(revision 4329)
@@ -38,17 +38,6 @@
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-global $template, $conf, $lang, $prefixeTable, $ec_conf, $page, $ec_debug,
- $ec_lists,   // array of following arrays :
-              //   $ec_lists['ec_table'] :
-              //     Event Cats table, in function of each entry id
-              //   $ec_lists['ec_codes'] : // Used ?
-              //     array of useful data, in function of entries codes
-              //   $ec_lists['add_pages'] :
-              //     array of Add. Pages names in function of their id
-              //   $ec_lists['categories'] :
-              //     array of category names in function of their id
-              //   $ec_lists['user_ids'] :
-              //     array of usernames in function of their id
- $ec_ap_ok;   // whether Additional Pages is installed and activated
+global $template, $conf, $lang, $prefixeTable,
+       $ec_conf, $page, $ec_debug, $ec_lists;
 
 load_language('plugin.lang', EVNTCATS_PATH);
@@ -88,5 +77,5 @@
 build_ec_lists(); // in evntcats_main_funcs.php
 
-// If no entry exist, default page is 'autolog_new'.
+// If no entry exist, default tab is 'autolog_new'.
 $page['tab'] = (!($ec_exist_entries = (mysql_num_rows(pwg_query("
   SELECT * FROM `".EVNTCATS_TABLE."`
@@ -94,55 +83,169 @@
 ")) != 0))) ? 'autolog_new' : 'autolog_entries';
 
-$ec_exist_duplic = ((mysql_num_rows(pwg_query("
-  SELECT * FROM `".EVNTCATS_TABLE."`
-  WHERE `code` IS NULL
-  AND `arg1` IS NOT NULL
-  AND `arg2` IS NOT NULL ;
-  ")) != 0) or
-  (read_ec_conf('duplic_gen') != 0) or
-  (read_ec_conf('duplic_type') != 0)
-);
-
-// If no entry exist, but some duplication management entries exist, default tab is 'duplication'.
-if (!$ec_exist_entries and $ec_exist_duplic) $page['tab'] = 'duplication';
-
-
-/* 
-
-if (isset($_POST[''])) {
-}
-
-
-if (isset($_POST['ec_duplic_conf_submit'])) {
-}
-
-if (isset($_POST['deny_groups_submit'])) {
-}
-
-if (isset($_POST['grant_groups_submit'])) {
-}
-
-if (isset($_POST['deny_types_submit'])) {
-}
-
-if (isset($_POST['grant_types_submit'])) {
-}
-
-if (isset($_POST['deny_users_submit'])) {
-}
-
-if (isset($_POST['grant_users_submit'])) {
-}
-
-
-
-
-*/
-
-
-
-
-
-if (isset($_POST['ec_act1'])) {
+// If no entry exist, but some duplication management entries exist, default
+// tab is 'duplication'.
+if (!$ec_exist_entries and read_ec_conf('dup_allow') == '2') $page['tab'] = 'duplication';
+
+// If a modification of duplication management has been posted, default tab
+// is 'duplication'.
+if (
+  count($_POST) > 0 and
+  count(array_intersect(array(
+    'ec_duplic_conf_submit',
+    'deny_groups_submit',
+    'grant_groups_submit',
+    'deny_types_submit',
+    'grant_types_submit',
+    'deny_users_submit',
+    'grant_users_submit',
+  ),
+  array_keys($_POST))) > 0
+) $page['tab'] = 'duplication';
+
+if (isset($_POST['ec_conf_submit'])) {
+  if (isset($_POST['ec_dup_conf']))
+   if (!change_ec_conf('dup_allow', $_POST['ec_dup_conf']))
+    ec_end2(7);
+  if (isset($_POST['ec_dup_disp']))
+   if (!change_ec_conf('duplic_display', $_POST['ec_dup_disp']))
+    ec_end2(8);
+  if (isset($_POST['ec_unknown']))
+   if (!change_ec_conf('unknown_code', $_POST['ec_unknown']))
+    ec_end2(9);
+  if (isset($_POST['ec_in_up_aps']))
+   if (!change_ec_conf('unknown_code_ap_id', $_POST['ec_in_up_aps']))
+    ec_end2(10);
+  $page['tab'] = 'config';
+  $page['infos'][] = l10n('ec_config_saved');
+}
+elseif (isset($_POST['ec_duplic_conf_submit'])) {
+  if (isset($_POST['ec_dup_conf'])) {
+    if (
+      read_ec_conf('dup_allow') == '2' and
+      $_POST['ec_dup_conf'] != '2'
+    ) $page['tab'] = 'config';
+    if (!change_ec_conf('dup_allow', $_POST['ec_dup_conf']))
+     ec_end2(5);
+  }
+  if (isset($_POST['ec_dup_disp']))
+   if (!change_ec_conf('duplic_display', $_POST['ec_dup_disp']))
+    ec_end2(6);
+  $page['infos'][] = l10n('ec_config_saved');
+}
+elseif (
+  isset($_POST['deny_groups_submit']) and
+  isset($_POST['deny_groups']) and
+  count($_POST['deny_groups']) > 0
+) {
+  if (pwg_query("
+    DELETE
+    FROM `".EVNTCATS_TABLE."`
+    WHERE `arg1` = 1
+      AND `arg2` IN (".implode(',', $_POST['deny_groups']).");
+  ") === false) ec_end2(1);
+  else $page['infos'][] = l10n('ec_config_saved');
+}
+elseif (
+  isset($_POST['grant_groups_submit']) and
+  isset($_POST['grant_groups']) and
+  count($_POST['grant_groups']) > 0
+) {
+  $inserts = array();
+  foreach ($_POST['grant_groups'] as $v) $inserts[] = array(
+    'arg1' => 1,
+    'arg2' => intval($v)
+  );
+  mass_inserts(EVNTCATS_TABLE, array('arg1', 'arg2'), $inserts);
+  $page['infos'][] = l10n('ec_config_saved');
+}
+elseif (
+  isset($_POST['deny_types_submit']) and (
+    isset($_POST['deny_types']) and
+    count($_POST['deny_types']) > 0 or
+    isset($_POST['deny_generic'])
+  )
+) {
+  $c = ($no_previous = (count($t = mysql_fetch_row(pwg_query("
+    SELECT `arg2`
+    FROM `".EVNTCATS_TABLE."`
+    WHERE `code` IS NULL
+      AND `arg1` = 3
+      AND `arg2` IS NOT NULL
+    LIMIT 1;
+  "))) == 0)) ? 0 : intval($t[0]);
+  if (isset($_POST['deny_types']))
+   foreach ($_POST['deny_types'] as $v) $c = $c & ~$v;
+  if (isset($_POST['deny_generic'])) $c = $c & 7;
+  $q = ($no_previous) ? "
+    INSERT INTO `".EVNTCATS_TABLE."`
+    (`arg1`, `arg2`)
+    VALUES (3, $c);
+  " : "
+    UPDATE `".EVNTCATS_TABLE."`
+    SET `arg2` = $c
+    WHERE `arg1` = 3
+    LIMIT 1 ;
+  ";
+  if (pwg_query($q) === false) ec_end2(3);
+  else $page['infos'][] = l10n('ec_config_saved');
+}
+elseif (
+  isset($_POST['grant_types_submit']) and (
+    isset($_POST['grant_types']) and
+    count($_POST['grant_types']) > 0 or
+    isset($_POST['grant_generic'])
+  )
+) {
+  $c = ($no_previous = (count($t = mysql_fetch_row(pwg_query("
+    SELECT `arg2`
+    FROM `".EVNTCATS_TABLE."`
+    WHERE `code` IS NULL
+      AND `arg1` = 3
+      AND `arg2` IS NOT NULL
+    LIMIT 1;
+  "))) == 0)) ? 0 : intval($t[0]);
+  if (isset($_POST['grant_types']))
+   foreach ($_POST['grant_types'] as $v) $c = $c | $v;
+  if (isset($_POST['grant_generic'])) $c = $c | 8;
+  $q = ($no_previous) ? "
+    INSERT INTO `".EVNTCATS_TABLE."`
+    (`arg1`, `arg2`)
+    VALUES (3, $c);
+  " : "
+    UPDATE `".EVNTCATS_TABLE."`
+    SET `arg2` = $c
+    WHERE `arg1` = 3
+    LIMIT 1 ;
+  ";
+  if (pwg_query($q) === false) ec_end2(4);
+  else $page['infos'][] = l10n('ec_config_saved');
+}
+elseif (
+  isset($_POST['deny_users_submit']) and
+  isset($_POST['deny_users']) and
+  count($_POST['deny_users']) > 0
+) {
+  if (pwg_query("
+    DELETE
+    FROM `".EVNTCATS_TABLE."`
+    WHERE `arg1` = 2
+      AND `arg2` IN (".implode(',', $_POST['deny_users']).");
+  ") === false) ec_end2(2);
+  else $page['infos'][] = l10n('ec_config_saved');
+}
+elseif (
+  isset($_POST['grant_users_submit']) and
+  isset($_POST['grant_users']) and
+  count($_POST['grant_users']) > 0
+) {
+  $inserts = array();
+  foreach ($_POST['grant_users'] as $v) $inserts[] = array(
+    'arg1' => 2,
+    'arg2' => intval($v)
+  );
+  mass_inserts(EVNTCATS_TABLE, array('arg1', 'arg2'), $inserts);
+  $page['infos'][] = l10n('ec_config_saved');
+}
+elseif (isset($_POST['ec_act1'])) {
   if (
     $_POST['ec_act1'] == 'disable' and
@@ -180,5 +283,5 @@
           build_ec_table();
         }
-        else ec_end1('ec_entry_sel', 'ec_bad_argument1');
+        else ec_end1('ec_entry_sel', 'Bad argument : ');
       }
       else if ($_POST['ec_act1'] == 'toggle_forced')
@@ -193,5 +296,5 @@
     break;
     case 'duplication':
-      if ($ec_exist_duplic) $page['tab'] = $_GET['tab'];
+      if (read_ec_conf('dup_allow') == '2') $page['tab'] = $_GET['tab'];
     break;
     case 'autolog_new':
@@ -211,13 +314,8 @@
 ")) != 0);
 
-$ec_exist_duplic = ((mysql_num_rows(pwg_query("
-  SELECT * FROM `".EVNTCATS_TABLE."`
-  WHERE `code` IS NULL
-  AND `arg1` IS NOT NULL
-  AND `arg2` IS NOT NULL ;
-  ")) != 0) or
-  (read_ec_conf('duplic_gen') != 0) or
-  (read_ec_conf('duplic_type') != 0)
-);
+if (
+  $page['tab'] == 'duplication' and
+  read_ec_conf('dup_allow') != '2'
+) $page['tab'] = 'config';
 
 $tabsheet = new tabsheet();
@@ -233,5 +331,5 @@
                l10n('ec_tab_autoid_new'),
                $my_base_url.'&amp;tab=autolog_new');
-if ($ec_exist_duplic) $tabsheet->add('duplication',
+if (read_ec_conf('dup_allow') == '2') $tabsheet->add('duplication',
                l10n('ec_tab_duplication'),
                $my_base_url.'&amp;tab=duplication');
Index: /extensions/event_cats/admin/evntcats_theme.css
===================================================================
--- /extensions/event_cats/admin/evntcats_theme.css	(revision 4328)
+++ /extensions/event_cats/admin/evntcats_theme.css	(revision 4329)
@@ -72,2 +72,6 @@
   vertical-align:middle;
 }
+
+.content h4 {
+  text-align:center;
+}
Index: /extensions/event_cats/admin/template/autolog_entries.tpl
===================================================================
--- /extensions/event_cats/admin/template/autolog_entries.tpl	(revision 4328)
+++ /extensions/event_cats/admin/template/autolog_entries.tpl	(revision 4329)
@@ -6,10 +6,10 @@
 <div style = "text-align:right; font-style:italic;">
   {if $ec_ap_ok}
-    {'ec_plugin_ap_ok'|@translate}
+    {'Additional Pages active'|@translate}
     <script type = "text/javascript">
-      var ec_ap_ok = true;
+      var ec_ap_ok = {if $ec_ap_ok2}true{else}false{/if};
     </script>
   {else}
-    {'ec_plugin_ap_nok'|@translate}
+    {'Additional Pages inactive'|@translate}
     <script type = "text/javascript">
       var ec_ap_ok = false;
@@ -24,22 +24,22 @@
   
   <div style = "text-align:center; font-weight:bold; font-size:120%;">
-    <a href = "#ec_top" name = "ec_top" title = "{'ec_top_title'|@translate}">
+    <a href = "#ec_top" name = "ec_top" title = "{'Place title on top ttip'|@translate}">
       <!--[if !IE]> <--> <label> <!--> <![endif]-->
-        {'ec_entry_table_title'|@translate}
+        {'Autolog entries'|@translate}
       <!--[if !IE]> <--> </label> <!--> <![endif]-->
       <!-- What we're able to do for our "prefered" browser |-( ...!  -->
-    </a><br>
-  </div><br>
+    </a><br />
+  </div><br />
   
   {* <!-- Table to show codes present in MySQL table --> *}
-  <table class = "table2" width = "97%" {* id = "" *}>
+  <table class = "table2" width = "97%">
     <thead>
       <tr class = "throw">
-        <td>{'ec_col_name_entry'|@translate}</td>
-        <td>{'ec_col_name_code'|@translate}</td>
-        <td>{'ec_col_name_user'|@translate}</td>
-        <td>{'ec_col_name_bhvr'|@translate}</td>
-        <td>{'ec_col_name_dspl'|@translate}</td>
-        <td>{'ec_col_name_actn'|@translate}</td>
+        <td>{'Entry'|@translate}</td>
+        <td>{'Code'|@translate}</td>
+        <td>{'Username'|@translate}</td>
+        <td>{'Identification'|@translate}</td>
+        <td>{'Displayed page'|@translate}</td>
+        <td>{'Tools'|@translate}</td>
       </tr>
     </thead>
@@ -62,20 +62,20 @@
             <a href = "javascript:void(0);" onclick = "ec_check_ds({$code_line.id});">
               <img src = "{$EVNTCATS_URLS.ROOT}icon/disable.png" class = "button"
-               alt = "{'ec_url_disable'|@translate}" title = "{'ec_url_disable'|@translate}" />
+               alt = "{'Outdate entry ttip'|@translate}" title = "{'Outdate entry ttip'|@translate}" />
             </a>
             {if $code_line.Forced == 'true'}
-              <a href = "javascript:void(0);" title = "{'ec_url_forced'|@translate}" onclick = "ec_toggle_forced({$code_line.id}, false);">
+              <a href = "javascript:void(0);" title = "{'Unforce display ttip'|@translate}" onclick = "ec_toggle_forced({$code_line.id}, false);">
                 <img class = "button" src = "{$EVNTCATS_URLS.ROOT}icon/forced.png"
-                 alt = "{'ec_url_forced'|@translate}" title = "{'ec_url_forced'|@translate}"
+                 alt = "{'Unforce display ttip'|@translate}" title = "{'Unforce display ttip'|@translate}"
                 />
               </a>
             {else}
-              <a href = "javascript:void(0);" title = "{'ec_url_nforced'|@translate}" onclick = "ec_toggle_forced({$code_line.id}, true);">
+              <a href = "javascript:void(0);" title = "{'Force display ttip'|@translate}" onclick = "ec_toggle_forced({$code_line.id}, true);">
                 <img class = "button" src = "{$EVNTCATS_URLS.ROOT}icon/nforced.png"
-                 alt = "{'ec_url_nforced'|@translate}" title = "{'ec_url_nforced'|@translate}"/>
+                 alt = "{'Force display ttip'|@translate}" title = "{'Force display ttip'|@translate}"/>
               </a>
-              <a href = "javascript:void(0);" title = "{'ec_url_duplicate'|@translate}" onclick = "ec_duplicate_entry({$code_line.id});">
+              <a href = "javascript:void(0);" title = "{'Duplicate entry ttip'|@translate}" onclick = "ec_duplicate_entry({$code_line.id});">
                 <img src = "{$EVNTCATS_URLS.ROOT}icon/duplicate.png" class = "button" style = "border:none"
-                 alt = "{'ec_url_duplicate'|@translate}" title = "{'ec_url_duplicate'|@translate}" />
+                 alt = "{'Duplicate entry ttip'|@translate}" title = "{'Duplicate entry ttip'|@translate}" />
               </a>
             {/if}
@@ -91,36 +91,36 @@
     <tr class = "row2">
       <td style = "padding-top:5px; padding-bottom:5px; font-weight:bold;">
-        {'ec_lower_tools_desc'|@translate}
+        {'Selected entry'|@translate}
       </td>
-      <td style = "{* text-align:center; *}padding-top:5px; padding-bottom:5px;">
-        <label title = "{'ec_url_tooltip'|@translate}">
-          {'ec_show_URL'|@translate}
-          <input type = "text" id = "ec_show_URL" size = "100%" title = "{'ec_url_tooltip'|@translate}" readonly = "readonly" />
-        </label><br>
-        <br>
+      <td style = "padding-top:5px; padding-bottom:5px;">
+        <label title = "{'Copy URL ttip'|@translate}">
+          {'URL'|@translate}
+          <input type = "text" id = "ec_show_URL" size = "100%" title = "{'Copy URL ttip'|@translate}" readonly = "readonly" />
+        </label><br />
+        <br />
         <a
-         href = "javascript:void(0);" title = "{'ec_test_tooltip'|@translate}" alt = "{'ec_test_tooltip'|@translate}"
+         href = "javascript:void(0);" title = "{'Test URL ttip'|@translate}" alt = "{'Test URL ttip'|@translate}"
          id = "ec_table_URL" onclick = "return ec_check_tst();" class = "ec_lower_tools"
         />
           <img src = "{$EVNTCATS_URLS.ROOT}icon/url2.png" class = "button"/>
-          {'ec_test_text'|@translate}
+          {'Test'|@translate}
         </a>
         &nbsp;&nbsp;
         <a href = "javascript:void(0);" onclick = "ec_check_dl();" id = "ec_del_link_id" class = "ec_lower_tools"
-         alt = "{'ec_url_delete'|@translate}" title = "{'ec_url_delete'|@translate}"
+         alt = "{'Delete entry ttip'|@translate}" title = "{'Delete entry ttip'|@translate}"
         >
           <img src = "{$EVNTCATS_URLS.ROOT}icon/delete.png" class = "button"/>
-          {'ec_delete_text'|@translate}
+          {'Delete'|@translate}
         </a>
         &nbsp;&nbsp;
         <a href = "javascript:void(0);" onclick = "ec_check_m();" id = "ec_mod_link_id" class = "ec_lower_tools"
-         alt = "{'ec_modify_tooltip'|@translate}" title = "{'ec_modify_tooltip'|@translate}"
+         alt = "{'Modify entry ttip'|@translate}" title = "{'Modify entry ttip'|@translate}"
         >
           <img src = "{$EVNTCATS_URLS.ROOT}icon/modify.png" class = "button"/>
-          {'ec_modify_text'|@translate}
+          {'Modify'|@translate}
         </a>
       </td>
     </tr>
-  </table><br>
+  </table><br />
 </form>
 
@@ -137,5 +137,2 @@
 
 {include file='../../../plugins/event_cats/admin/template/footer.inc.tpl'}
-
-{* <!--
---> *}
Index: /extensions/event_cats/admin/template/autolog_new.js
===================================================================
--- /extensions/event_cats/admin/template/autolog_new.js	(revision 4328)
+++ /extensions/event_cats/admin/template/autolog_new.js	(revision 4329)
@@ -1,4 +1,8 @@
 /* Event Cats Javascript functions LucMorizur June - ... 2009 */
 
+// All variables declarations
+// Once this entire file has been read, some JS code is executed at the end
+// of .tpl file, thus some values below are modified during the HTML page
+// "reading and displaying"
 var ec_avoid_infinite_loop      = true;
 var ec_is_creation              = true;
@@ -446,8 +450,5 @@
             d.ec_new_code.ec_in_up_cat.selectedIndex
            ].label;
-          /* if (cat_display) ec_new_user_text =
-           (ec_reg_cat2.test(ec_cat_sel)) ?
-            ec_reg_cat1.exec(ec_cat_sel)[1] : ec_cat_sel;
-          else */ ec_new_user_text = ec_reg_cat3.exec(ec_cat_sel)[1];
+          ec_new_user_text = ec_reg_cat3.exec(ec_cat_sel)[1];
           ec_new_user_text = ec_new_user_text.replace(/\s/g, '_');
           ec_new_user_text = ec_new_user_text.substr(0, 50);
@@ -464,5 +465,5 @@
             return false;
           }
-          t2 = ec_JS_message['ec_up_code_lbl_home'];
+          t2 = ec_JS_message['Home'];
           ec_new_user_text = t2 + '_' + t1;
         break;
Index: /extensions/event_cats/admin/template/autolog_new.tpl
===================================================================
--- /extensions/event_cats/admin/template/autolog_new.tpl	(revision 4328)
+++ /extensions/event_cats/admin/template/autolog_new.tpl	(revision 4329)
@@ -6,12 +6,12 @@
 <div style = "text-align:right; font-style:italic;">
   {if $ec_ap_ok}
-    {'ec_plugin_ap_ok'|@translate}
-    <script type = "text/javascript"><!--
-      var ec_ap_ok = true; //-->
+    {'Additional Pages active'|@translate}
+    <script type = "text/javascript">
+      var ec_ap_ok = {if count($ec_lists.add_pages) == 0}false{else}true{/if};
     </script>
   {else}
-    {'ec_plugin_ap_nok'|@translate}
-    <script type = "text/javascript"><!--
-      var ec_ap_ok = false; //-->
+    {'Additional Pages inactive'|@translate}
+    <script type = "text/javascript">
+      var ec_ap_ok = false;
     </script>
   {/if}
@@ -25,10 +25,10 @@
   {* <!-- Page title. Can be "New entry" or "Entry modification" --> *}
   <div style = "text-align:center;">
-    <a style = "font-weight:bold; font-size:120%;" href = "#ec_top" name = "ec_top" title = "{'ec_top_title'|@translate}">
+    <a style = "font-weight:bold; font-size:120%;" href = "#ec_top" name = "ec_top" title = "{'Place title on top ttip'|@translate}">
       <!--[if !IE]> <--> <label> <!--> <![endif]-->
         {if $ec_is_creation}
-          {'ec_new_entry_title'|@translate}
+          {'New entry title'|@translate}
         {else}
-          {'ec_modify_entry_title'|@translate}
+          {'Modify entry title'|@translate}
         {/if}
       <!--[if !IE]> <--> </label> <!--> <![endif]-->
@@ -36,9 +36,9 @@
     </a>
     {if $ec_is_creation}
-      <br><br>
-      <input class = "submit" type = "button" name = "ec_submit_gen_full_auto" value = "{'ec_new_full_auto'|@translate}"
+      <br /><br />
+      <input class = "submit" type = "button" name = "ec_submit_gen_full_auto" value = "{'Full auto'|@translate}"
        id = "ec_submit_gen_full_auto_id" onclick = "ec_gen_full_auto();" style = "margin-top:0;"/>
     {/if}
-  </div><br>
+  </div><br />
   
   {* <!-- Table (borders not visible) with 3 rows for parameters adjustment --> *}
@@ -50,7 +50,7 @@
       <td style = "vertical-align:top; font-weight:bold;">
         {if $ec_is_creation}
-          {'ec_new_entry'|@translate}
+          {'Code'|@translate}
         {else}
-          {'ec_sel_entry'|@translate}
+          {'Selected entry'|@translate}
         {/if}
       </td>
@@ -61,28 +61,27 @@
             <label for = "ec_in_up_code_id" onclick = "ec_mark_code('ec_sel_code_new');" {$ec_hidden_when_no_code} >
               <input type = "radio" name = "ec_sel_code" for = "ec_in_up_code_id" value = "new" id = "ec_sel_code_new"/>
-              {'ec_up_code_lbl_code_new'|@translate}
+              {'New code'|@translate}
             </label>
             <span {$ec_hidden_when_no_code} >&nbsp;</span>
             <label for = "ec_in_up_code_id" style = "margin:0;">
-              <input class = "submit" type = "button" name = "ec_submit_gen_code" value = "{'ec_new_entry_button'|@translate}"
+              <input class = "submit" type = "button" name = "ec_submit_gen_code" value = "{'Auto code button'|@translate}"
                id = "ec_submit_gen_code_id" onclick = "ec_gen_code();" style = "margin:0;"
               />
             </label>
-            {'ec_gen_code_nb_pre'|@translate}
+            {'Auto code mid'|@translate}
             <select name = "ec_in_up_auto_code_length" id = "ec_in_up_auto_code_length_id" onchange = "ec_auto_code_digits_nb = this.value;">
-              <option value =  "4" >4{'ec_gen_code_nb_min'|@translate}</option>
-              <option value =  "5" >5</option>
-              <option value =  "8" >8</option>
-              <option value = "10">10</option>
-              <option value = "12">12</option>
-              <option value = "15">15</option>
-              <option value = "16">16</option>
-              <option value = "20">20</option>
-              <option value = "24">24</option>
-              <option value = "25">25</option>
-              <option value = "30">30</option>
-              <option value = "32">32{'ec_gen_code_nb_max'|@translate}</option>
+              {foreach from=$ec_auto_code_dg_nb item=ec_item name=listloop}
+                <option value = "{$ec_item}">
+                  {$ec_item}
+                  {if $smarty.foreach.listloop.index == 0}
+                    {'Auto code min'|@translate}
+                  {/if}
+                  {if $smarty.foreach.listloop.index == count($ec_auto_code_dg_nb) - 1}
+                    {'Auto code max'|@translate}
+                  {/if}
+                </option>
+              {/foreach}
             </select>
-            {'ec_gen_code_nb_end'|@translate}<br>
+            {'Auto code end'|@translate}<br />
             <ul><li>
               <input type = "text" name = "ec_in_up_code" maxlength = "32" size = "40"
@@ -96,5 +95,5 @@
             <label for = "ec_in_up_code_list_id" onclick = "ec_mark_code('ec_sel_code_old');" {$ec_hidden_when_no_code}>
               <input type = "radio" name = "ec_sel_code" for = "ec_in_up_code_list_id" {$ec_hidden_when_no_code} value = "old" id = "ec_sel_code_old" />
-              {'ec_up_code_lbl_code_old'|@translate}
+              {'Existing code'|@translate}
             </label>
             <select name = "ec_in_up_code_list" id = "ec_in_up_code_list_id" onchange = "ec_change_code_list(this.value);" {$ec_hidden_when_no_code} >
@@ -102,5 +101,5 @@
                 <option value = "{$ec_val.id}">{$ec_key}</option>
               {/foreach}
-            </select><br>
+            </select><br />
           </li>
           
@@ -124,7 +123,7 @@
     <tr>
       <td style = "vertical-align:top; font-weight:bold;">
-        {'ec_up_code_lbl_user'|@translate}<br>
-        <br>
-        <span style = "font-weight:bold; color:red;" id = "ec_in_up_pwd_warn">&nbsp;</span><br>
+        {'Identified user'|@translate}<br />
+        <br />
+        <span style = "font-weight:bold; color:red;" id = "ec_in_up_pwd_warn">&nbsp;</span><br />
       </td>
       <td>
@@ -134,6 +133,6 @@
             <label onclick = "return ec_mark_user('ec_sel_user_none');">
               <input type = "radio" name = "ec_sel_user" value = "none" id = "ec_sel_user_none" />
-              {'ec_up_code_lbl_user_none'|@translate}
-            </label><br>
+              {'No user'|@translate}
+            </label><br />
           </li>
         {/if}
@@ -143,24 +142,24 @@
           <label for = "ec_in_up_usr_txt_id" onclick = "return ec_mark_user('ec_sel_user_new');" {$ec_hidden_when_no_user} >
             <input type = "radio" name = "ec_sel_user" for = "ec_in_up_usr_txt_id" value = "new" id = "ec_sel_user_new" {$ec_hidden_when_no_user} />
-            {'ec_up_code_lbl_user_new'|@translate}
+            {'New generic user'|@translate}
           </label>
           <span {$ec_hidden_when_no_user} >&nbsp;</span>
           <label for = "ec_in_up_usr_txt_id" style = "margin:0;">
-            <input class = "submit" type = "button" name = "ec_submit_gen_user" value = "{'ec_up_code_lbl_gen_user'|@translate}"
+            <input class = "submit" type = "button" name = "ec_submit_gen_user" value = "{'Generate username'|@translate}"
              id = "ec_submit_gen_user_id" onclick = "ec_gen_user();"
             />
-          </label><br>
+          </label><br />
           <ul><li>
-            <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'ec_new_user_name'|@translate}<br>
+            <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'New username'|@translate}<br />
               <input type = "text" name = "login" id = "ec_in_up_usr_txt_id" maxlength = "50"
                size = "20" onblur = "ec_new_user_text = this.value; ec_check_user_text();"
               />
             </label>
-            <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'ec_new_user_pswd'|@translate}<br>
+            <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'New password'|@translate}<br />
               <input type = "text" name = "password" id = "ec_in_up_psd_txt_id" maxlength = "32"
                size = "20" onblur = "ec_new_psd_text = this.value; ec_check_pwd_text();"
               />
             </label>
-            <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'ec_confirm_pswd'|@translate}<br>
+            <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'Confirm password'|@translate}<br />
               <input type = "password" id = "ec_confirm_psd_txt_id" maxlength = "32" size = "20"/>
             </label>
@@ -170,11 +169,11 @@
               />
               <span onMouseover = "ec_chk_over_grp = true;" onMouseout = "ec_chk_over_grp = false;">
-                {'ec_new_user_group'|@translate}
-              </span><br>
+                {'New group'|@translate}
+              </span><br />
               <input type = "text" name = "groupname" id = "ec_in_up_grp_txt_id" maxlength = "32"
                size = "20" onblur = "ec_new_grp_text = this.value; if (this.value != '') ec_selected_old_group = true;"
               />
             </label>
-          </li></ul><br>
+          </li></ul><br />
         </li>
         
@@ -183,5 +182,5 @@
           <label for = "ec_in_up_usr_list_id" onclick = "return ec_mark_user('ec_sel_user_old');" {$ec_hidden_when_no_user} >
             <input type = "radio" name = "ec_sel_user" for = "ec_in_up_usr_list_id" {$ec_hidden_when_no_user} value = "old" id = "ec_sel_user_old" />
-            {'ec_up_code_lbl_user_old'|@translate}
+            {'Existing user'|@translate}
           </label>
           <select name = "ec_in_up_usr_list" id = "ec_in_up_usr_list_id" onchange = "ec_change_user_list(this.value);" {$ec_hidden_when_no_user} >
@@ -189,5 +188,5 @@
               <option label = "{$ec_val}" value = "{$ec_key}" >{$ec_val}</option>
             {/foreach}
-          </select><br>
+          </select><br />
         </li>
       </td>
@@ -197,5 +196,5 @@
     <tr>
       <td style = "vertical-align:top;">
-        <span style = "font-weight:bold;">{'ec_up_code_lbl_action'|@translate}</span><br>
+        <span style = "font-weight:bold;">{'Displayed page'|@translate}</span><br />
         <label class = "ec_block" for = "ec_in_up_forced_id" style = "margin-top:5px;" onclick = "ec_mark_forced();">
           <input type = "checkbox" name = "ec_in_up_forced" id = "ec_in_up_forced_id">
@@ -209,5 +208,5 @@
           <label class = "ec_block" onclick = "return ec_mark_action('ec_input_action_home');">
             <input type = "radio" name = "ec_input_action" value = "home" id = "ec_input_action_home" />
-            {'ec_up_code_lbl_home'|@translate}
+            {'Home'|@translate}
           </label>
           
@@ -216,5 +215,5 @@
             <label class = "ec_block" onclick = "return ec_mark_action('ec_input_action_refused');">
               <input type = "radio" name = "ec_input_action" value = "refused" id = "ec_input_action_refused" />
-              {'ec_up_code_lbl_refused'|@translate}
+              {'Access denied'|@translate}
             </label>
           {/if}
@@ -225,5 +224,5 @@
           >
             <input type = "radio" name = "ec_input_action" value = "img" id = "ec_input_action_img" for = "ec_in_up_imgs_id" />
-            {'ec_up_code_lbl_img'|@translate}<br>
+            {'Image id'|@translate}<br />
             <input type = "text" name = "ec_in_up_img" id = "ec_in_up_imgs_id" maxlength = "6"
              size = "10" onblur = "ec_selected_img = this.value; ec_check_img_text();" onfocus = "return ec_mark_action('ec_input_action_img');"
@@ -239,5 +238,5 @@
           >
             <input type = "radio" name = "ec_input_action" value = "add_p" id = "ec_input_action_add_p" for = "ec_in_up_aps_id" />
-            {'ec_up_code_lbl_aps'|@translate}<br>
+            {'Additional Page'|@translate}<br />
             <select class = "categoryList" name = "ec_in_up_aps" size="30" id = "ec_in_up_aps_id" onchange = "ec_selected_AP = this.value;" >
               {html_options options=$ec_lists.add_pages}
@@ -252,5 +251,5 @@
               onMouseover = "ec_chk_nover_cat = false;" onMouseout = "ec_chk_nover_cat = true;"
             />
-            <span onMouseover = "ec_chk_nover_cat = false;" onMouseout = "ec_chk_nover_cat = true;">{'ec_up_code_lbl_cats'|@translate}</span><br>
+            <span onMouseover = "ec_chk_nover_cat = false;" onMouseout = "ec_chk_nover_cat = true;">{'Category'|@translate}</span><br />
             <select class = "categoryList" name = "ec_in_up_cat" size = "30" id = "ec_in_up_cats_id" onchange = "ec_selected_cat = this.value;">
               {html_options options=$ec_lists.categories}
@@ -271,5 +270,5 @@
 <script type = "text/javascript"><!--
   ec_is_creation                          = {if $ec_is_creation}true{else}false{/if};
-  ec_up_code_lbl_forced_txt               = "{'ec_up_code_lbl_forced'|@translate}";
+  ec_up_code_lbl_forced_txt               = "{'Forced'|@translate}";
   ec_JS_message['ec_gen_user_act_miss']   = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
   ec_JS_message['ec_act_cat_miss']        = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
@@ -283,5 +282,5 @@
   ec_JS_message['ec_conf_pwd_dont_match'] = "{'ec_conf_pwd_dont_match'|@translate|@escape:javascript}";
   ec_JS_message['ec_confirm_change_user'] = "{'ec_confirm_change_user'|@translate|@escape:javascript}";
-  ec_JS_message['ec_up_code_lbl_home']    = "{'ec_up_code_lbl_home'|@translate}";
+  ec_JS_message['Home']                   = "{'Home'|@translate}";
   ec_JS_message['ec_submit_code_miss']    = "{'ec_submit_code_miss'|@translate}";
   ec_JS_message['ec_submit_user_miss']    = "{'ec_submit_user_miss'|@translate}";
@@ -304,5 +303,2 @@
 
 {include file='../../../plugins/event_cats/admin/template/footer.inc.tpl'}
-
-{* <!--
---> *}
Index: /extensions/event_cats/admin/template/config.js
===================================================================
--- /extensions/event_cats/admin/template/config.js	(revision 4329)
+++ /extensions/event_cats/admin/template/config.js	(revision 4329)
@@ -0,0 +1,45 @@
+/* Event Cats Javascript functions LucMorizur June - ... 2009 */
+
+// All variables declarations
+// Once this entire file has been read, some JS code is executed at the end
+// of .tpl file, thus some values below are modified during the HTML page
+// "reading and displaying"
+var ec_JS_message      = '';
+var ec_selected_AP     = '-1';
+var ec_selected_action = '-1';
+
+function de(ec_id) {
+  return document.getElementById(ec_id);
+}
+
+function ec_check_exist_value(ec_id, ec_val) {
+  var e = document.getElementById(ec_id);
+  for (var i = 0; i < e.length; i++) {
+    if (e.options[i].value == ec_val) return true;
+  }
+  return false;
+}
+
+function ec_mark_action(ec_id) {
+  de(ec_id).checked = 'checked';
+  if (de('ec_unknown_2_id').checked == '')
+   de('ec_in_up_aps_id').selectedIndex = '-1';
+  else {
+    if (!ec_check_exist_value('ec_in_up_aps_id', ec_selected_AP)) {
+      de('ec_in_up_aps_id').selectedIndex = '-1';
+      ec_selected_AP = '-1';
+    }
+    else de('ec_in_up_aps_id').value = ec_selected_AP;
+  }
+}
+
+function ec_check_submit() {
+  if (
+    document.getElementById('ec_unknown_2_id').checked != '' &&
+    document.getElementById('ec_in_up_aps_id').selectedIndex == '-1'
+  ) {
+    alert(ec_JS_message);
+    return false;
+  }
+}
+
Index: /extensions/event_cats/admin/template/config.tpl
===================================================================
--- /extensions/event_cats/admin/template/config.tpl	(revision 4328)
+++ /extensions/event_cats/admin/template/config.tpl	(revision 4329)
@@ -3,22 +3,130 @@
 {include file='../../../plugins/event_cats/admin/template/header.inc.tpl'}
 
-{* <!-- Available soon... --> *}
+{* <!-- Whether plugin Additionnal Pages is active or not --> *}
+<div style = "text-align:right; font-style:italic;">
+  {if $ec_ap_ok}
+    {'Additional Pages active'|@translate}
+    <script type = "text/javascript">
+      var ec_ap_ok = {if count($add_pages) == 0}false{else}true{/if};
+    </script>
+  {else}
+    {'Additional Pages inactive'|@translate}
+    <script type = "text/javascript">
+      var ec_ap_ok = false;
+    </script>
+  {/if}
+</div>
 
-<p>Bientôt disponible :-] !</p>
+<form action = "" method = "post" class = "titrePage" name = "ec_gen_conf" onsubmit = "return ec_check_submit();">
+  
+  {* <!-- Duplication configuration parameters --> *}
+  <h4>{'Duplication'|@translate}</h4>
+  <table>
+    <tr>
+      <td style = "text-align:right; font-weight:bold;">
+        {'Duplication allowance'|@translate}&nbsp;&nbsp;
+      </td>
+      <td>
+        <label for = "ec_dup_conf_none_id">
+          <input
+            type = "radio" name = "ec_dup_conf" value = "0" id = "ec_dup_conf_none_id"
+            {if $ec_conf.dup_allow == '0'} checked = "checked" {/if}
+          />
+          {'No account'|@translate}
+        </label><br />
+        <label for = "ec_dup_conf_group_id">
+          <input
+            type = "radio" name = "ec_dup_conf" value = "2" id = "ec_dup_conf_group_id"
+            {if $ec_conf.dup_allow == '2'} checked = "checked" {/if}
+          />
+          {'Selection per group'|@translate}
+        </label><br />
+        <label for = "ec_dup_conf_all_id">
+          <input
+            type = "radio" name = "ec_dup_conf" value = "1" id = "ec_dup_conf_all_id"
+            {if $ec_conf.dup_allow == '1'} checked = "checked" {/if}
+          />
+          {'All accounts'|@translate}
+        </label>
+      </td>
+      <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td> {* <!-- sorry :-\ --> *}
+      <td style = "text-align:right; font-weight:bold;">
+        {* <!-- Replace "Register" link ? --> *}
+        {$ec_dup_link_conf}&nbsp;&nbsp;
+      </td>
+      <td>
+        <label for = "ec_dup_disp_normal_id">
+          <input
+            type = "radio" name = "ec_dup_disp" value = "0" id = "ec_dup_disp_normal_id"
+            {if $ec_conf.duplic_display == '0'} checked = "checked" {/if}
+          />
+          {'No account'|@translate}
+        </label><br />
+        <label for = "ec_dup_disp_but_gen_id">
+          <input
+            type = "radio" name = "ec_dup_disp" value = "2" id = "ec_dup_disp_but_gen_id"
+            {if $ec_conf.duplic_display == '2'} checked = "checked" {/if}
+          />
+          {'All but generics'|@translate}
+        </label><br />
+        <label for = "ec_dup_disp_dup_id">
+          <input
+            type = "radio" name = "ec_dup_disp" value = "1" id = "ec_dup_disp_dup_id"
+            {if $ec_conf.duplic_display == '1'} checked = "checked" {/if}
+          />
+          {'All accounts'|@translate}
+        </label><br />
+      </td>
+    </tr>
+    <tr><td>&nbsp;</td><td>&nbsp;</td></tr>
+  </table>
+  
+  {* <!-- What to do if an unknown code is used --> *}
+  <h4>{'Unknown code'|@translate}</h4>
+  <table>
+    <tr>
+      <td style = "text-align:right; vertical-align:top; font-weight:bold;">
+        {'Page for unknown code'|@translate}&nbsp;&nbsp;
+      </td>
+      <td>
+        <label for = "ec_unknown_0_id" onclick = "ec_mark_action('ec_unknown_0_id');">
+          <input type = "radio" name = "ec_unknown" value = "0" id = "ec_unknown_0_id" />
+          {'Home'|@translate}
+        </label><br />
+        <label for = "ec_unknown_1_id" onclick = "ec_mark_action('ec_unknown_1_id');">
+          <input type = "radio" name = "ec_unknown" value = "1" id = "ec_unknown_1_id" />
+          {'Access denied'|@translate}
+        </label><br />
+        {* <!-- Additionnal Page, provided the plugin is activated and at least one Add. P. is available --> *}
+        <label class = "ec_block" for = "ec_in_up_aps_id" {if !$ec_ap_ok or count($add_pages) == 0} style = "display:none;" {/if}
+         onclick = "ec_mark_action('ec_unknown_2_id');"
+        >
+          <input type = "radio" name = "ec_unknown" value = "2" id = "ec_unknown_2_id" for = "ec_in_up_aps_id" />
+          {'Additional Page'|@translate}<br />
+          <select class = "categoryList" name = "ec_in_up_aps" size="30" id = "ec_in_up_aps_id" onchange = "ec_selected_AP = this.value;" >
+            {html_options options=$add_pages}
+          </select>
+        </label>
+      </td>
+    </tr>
+    <tr><td>&nbsp;</td><td>&nbsp;</td></tr>
+  </table>
+  
+  <div style = "text-align:center;">
+    <input class = "submit" type = "submit" name = "ec_conf_submit" value = "{'Submit'|@translate}" />
+  </div>
+  
+</form>
+
 
 {* <!-- JavaScript functions --> *}
-{* <!--
-<script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/template/autolog_new.js"></script>
+<script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/template/config.js"></script>
 <script type = "text/javascript"><!--
-  ec_JS_message['ec_gen_user_act_miss'] = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
-  ec_JS_message['ec_act_cat_miss']      = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
-  ec_JS_message['ec_new_pwd_gen']       = "{'ec_new_pwd_gen'|@translate|@escape:javascript}";
-  ec_JS_message['ec_up_code_lbl_home']  = "{'ec_up_code_lbl_home'|@translate}";
-  ec_init();
+  ec_JS_message                                               = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
+  ec_selected_action                                          = "{$ec_conf.unknown_code}";
+  ec_selected_AP                                              = "{$ec_conf.unknown_code_ap_id}";
+  document.ec_gen_conf.ec_unknown[ec_selected_action].checked = 'checked';
+  if (de('ec_unknown_2_id').checked != '') ec_mark_action('ec_unknown_2_id');
 //--></script>
---> *}
 
 {include file='../../../plugins/event_cats/admin/template/footer.inc.tpl'}
-
-{* <!--
---> *}
Index: /extensions/event_cats/admin/template/duplication.tpl
===================================================================
--- /extensions/event_cats/admin/template/duplication.tpl	(revision 4328)
+++ /extensions/event_cats/admin/template/duplication.tpl	(revision 4329)
@@ -2,7 +2,4 @@
 
 {include file='../../../plugins/event_cats/admin/template/header.inc.tpl'}
-
-{* <!-- Available soon... --> *}
-<p>Bientôt disponible :-] !</p>
 
 <!-- Aknowledgement ----------------------------------------------------------
@@ -14,27 +11,63 @@
 <form action = "" method = "post" class = "titrePage" name = "ec_duplic_conf">
   <fieldset>
-    <legend>{'ec_duplication_config'|@translate}</legend>
+    <legend>{'Configuration'|@translate}</legend>
     <table>
       <tr>
-        <td>
-          <span style = "font-weight:bold;">{'ec_duplication_allowance'|@translate}&nbsp;&nbsp;</span>
+        <td style = "text-align:right; font-weight:bold;">
+          {'Duplication allowance'|@translate}&nbsp;&nbsp;
         </td>
         <td>
           <label for = "ec_dup_conf_none_id">
-            <input type = "radio" name = "ec_dup_conf[]" value = "none" id = "ec_dup_conf_none_id" />
-            {'ec_dup_allowance_none'|@translate}
-          </label><br>
+            <input
+              type = "radio" name = "ec_dup_conf" value = "0" id = "ec_dup_conf_none_id"
+              {if $ec_conf.dup_allow == '0'} checked = "checked" {/if}
+            />
+            {'No account'|@translate}
+          </label><br />
           <label for = "ec_dup_conf_group_id">
-            <input type = "radio" name = "ec_dup_conf[]" value = "group" id = "ec_dup_conf_group_id" />
-            {'ec_dup_allowance_group'|@translate}
-          </label><br>
+            <input
+              type = "radio" name = "ec_dup_conf" value = "2" id = "ec_dup_conf_group_id"
+              {if $ec_conf.dup_allow == '2'} checked = "checked" {/if}
+            />
+            {'Selection per group'|@translate}
+          </label><br />
           <label for = "ec_dup_conf_all_id">
-            <input type = "radio" name = "ec_dup_conf[]" value = "all" id = "ec_dup_conf_all_id" />
-            {'ec_dup_allowance_all'|@translate}
+            <input
+              type = "radio" name = "ec_dup_conf" value = "1" id = "ec_dup_conf_all_id"
+              {if $ec_conf.dup_allow == '1'} checked = "checked" {/if}
+            />
+            {'All accounts'|@translate}
           </label>
+        </td>
+        <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td> {* <!-- sorry :-\ --> *}
+        <td style = "text-align:right; font-weight:bold;">
+          {$ec_dup_link_conf}&nbsp;&nbsp;
+        </td>
+        <td>
+          <label for = "ec_dup_disp_normal_id">
+            <input
+              type = "radio" name = "ec_dup_disp" value = "0" id = "ec_dup_disp_normal_id"
+              {if $ec_conf.duplic_display == '0'} checked = "checked" {/if}
+            />
+            {'No account'|@translate}
+          </label><br />
+          <label for = "ec_dup_disp_but_gen_id">
+            <input
+              type = "radio" name = "ec_dup_disp" value = "2" id = "ec_dup_disp_but_gen_id"
+              {if $ec_conf.duplic_display == '2'} checked = "checked" {/if}
+            />
+            {'All but generics'|@translate}
+          </label><br />
+          <label for = "ec_dup_disp_dup_id">
+            <input
+              type = "radio" name = "ec_dup_disp" value = "1" id = "ec_dup_disp_dup_id"
+              {if $ec_conf.duplic_display == '1'} checked = "checked" {/if}
+            />
+            {'All accounts'|@translate}
+          </label><br />
         </td>
       </tr>
     </table>
-    <input class = "submit" type = "submit" name = "ec_duplic_conf_submit" value = "{'ec_dup_conf_sbmt_lbl'|@translate}" />
+    <input class = "submit" type = "submit" name = "ec_duplic_conf_submit" value = "{'Save dup. config btn'|@translate}" />
   </fieldset>
 </form>
@@ -46,5 +79,5 @@
   
   <fieldset>
-    <legend>{'ec_duplic_ok'|@translate}</legend>
+    <legend>{'Duplication allowed'|@translate}</legend>
     <ul>
       {foreach from=$groups_granted_ids item=id}
@@ -52,9 +85,9 @@
       {/foreach}
     </ul>
-    <input class = "submit" type = "submit" name = "deny_groups_submit" value = "{'ec_dup_grp_ok_sbmt_lbl'|@translate}" />
+    <input class = "submit" type = "submit" name = "deny_groups_submit" value = "{'Deny to groups btn'|@translate}" />
   </fieldset>
   
   <fieldset>
-    <legend>{'ec_duplic_nok'|@translate}</legend>
+    <legend>{'Duplication denied'|@translate}</legend>
     <ul>
       {foreach from=$groups_denied_ids item=id}
@@ -62,14 +95,14 @@
       {/foreach}
     </ul>
-    <input class = "submit" type = "submit" name = "grant_groups_submit" value = "{'ec_dup_grp_nok_sbmt_lbl'|@translate}" />
+    <input class = "submit" type = "submit" name = "grant_groups_submit" value = "{'Grant to groups btn'|@translate}" />
   </fieldset>
   
-  <h4>{'ec_dup_types'|@translate}</h4>
+  <h4>{'Types'|@translate}</h4>
   
   <fieldset>
-    <legend>{'ec_duplic_ok'|@translate}</legend>
+    <legend>{'Duplication allowed'|@translate}</legend>
     <ul>
       {if $ec_gen_granted}
-      <li><label><input type = "checkbox" name = "deny_generic" {* id = "ec_dup_types_generic_nok_id" *} /> {'user_status_generic'|@translate}</label></li>
+      <li><label><input type = "checkbox" name = "deny_generic" /> {'user_status_generic'|@translate}</label></li>
       <br />
       {/if}
@@ -78,12 +111,12 @@
       {/foreach}
     </ul>
-    <input class = "submit" type = "submit" name = "deny_types_submit" value = "{'ec_dup_typ_sbmt_nok_lbl'|@translate}" />
+    <input class = "submit" type = "submit" name = "deny_types_submit" value = "{'Deny to types btn'|@translate}" />
   </fieldset>
   
   <fieldset>
-    <legend>{'ec_duplic_nok'|@translate}</legend>
+    <legend>{'Duplication denied'|@translate}</legend>
     <ul>
       {if !$ec_gen_granted}
-      <li><label><input type = "checkbox" name = "grant_generic" {* id = "ec_dup_types_generic_ok_id" *} /> {'user_status_generic'|@translate}</label></li>
+      <li><label><input type = "checkbox" name = "grant_generic" /> {'user_status_generic'|@translate}</label></li>
       <br />
       {/if}
@@ -92,5 +125,5 @@
       {/foreach}
     </ul>
-    <input class = "submit" type = "submit" name = "grant_types_submit" value = "{'ec_dup_typ_sbmt_ok_lbl'|@translate}" />
+    <input class = "submit" type = "submit" name = "grant_types_submit" value = "{'Grant to types btn'|@translate}" />
   </fieldset>
   
@@ -98,5 +131,5 @@
   
   <fieldset>
-    <legend>{'ec_duplic_ok'|@translate}</legend>
+    <legend>{'Duplication allowed'|@translate}</legend>
     <ul>
       {foreach from=$users_granted_direct_ids item=id}
@@ -104,9 +137,9 @@
       {/foreach}
     </ul>
-    <input class = "submit" type = "submit" name = "deny_users_submit" value = "{'ec_dup_usr_ok_sbmt_lbl'|@translate}" />
+    <input class = "submit" type = "submit" name = "deny_users_submit" value = "{'Deny to users btn'|@translate}" />
   </fieldset>
   
   <fieldset>
-    <legend>{'ec_duplic_ok_groups'|@translate}</legend>
+    <legend>{'Dup. allowed tks to'|@translate}</legend>
     {if isset($user_granted_indirects) }
     <ul>
@@ -119,5 +152,5 @@
   
   <fieldset>
-    <legend>{'ec_duplic_nok'|@translate}</legend>
+    <legend>{'Duplication denied'|@translate}</legend>
     <ul>
       {foreach from=$users_denied_ids item=id}
@@ -125,27 +158,9 @@
       {/foreach}
     </ul>
-    <input class = "submit" type = "submit" name = "grant_users_submit" value = "{'ec_dup_usr_nok_sbmt_lbl'|@translate}" />
+    <input class = "submit" type = "submit" name = "grant_users_submit" value = "{'Grant to users btn'|@translate}" />
   </fieldset>
   
 </form>
 
-
-
-
-{* <!-- JavaScript functions --> *}
-{* <!--
-<script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/template/autolog_new.js"></script>
-<script type = "text/javascript"><!--
-  ec_JS_message['ec_gen_user_act_miss'] = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
-  ec_JS_message['ec_act_cat_miss']      = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
-  ec_JS_message['ec_new_pwd_gen']       = "{'ec_new_pwd_gen'|@translate|@escape:javascript}";
-  ec_JS_message['ec_up_code_lbl_home']  = "{'ec_up_code_lbl_home'|@translate}";
-  ec_init();
-//--></script>
---> *}
-
 {include file='../../../plugins/event_cats/admin/template/footer.inc.tpl'}
 
-{* <!--
---> *}
-
Index: /extensions/event_cats/admin/template/header.inc.tpl
===================================================================
--- /extensions/event_cats/admin/template/header.inc.tpl	(revision 4328)
+++ /extensions/event_cats/admin/template/header.inc.tpl	(revision 4329)
@@ -5,10 +5,10 @@
 {* <!-- Page title --> *}
 <div class = "titrePage" style = "margin-top: -20px;">
-  <h2>{'ec_admin_page_title'|@translate} {$EVNTCATS_VERSION}</h2>
+  <h2>{'Admin page title'|@translate} {$EVNTCATS_VERSION}</h2>
 </div>
 
 {* <!-- JavaScript warning message --> *}
 <div id = "ec_js_warn">
-  {'ec_javascript_needed'|@translate}<br><br>
+  {'JS needed'|@translate}<br /><br />
 </div>
 <script type = "text/javascript"><!-- // Removes JavaScript warning message
@@ -19,5 +19,5 @@
 {if $ec_howto}
   <div>
-    {'ec_admin_page_howto'|@translate}
+    {'Acknowledgement'|@translate}
   </div>
   <p>
Index: /extensions/event_cats/include/ec_conf.inc.php
===================================================================
--- /extensions/event_cats/include/ec_conf.inc.php	(revision 4328)
+++ /extensions/event_cats/include/ec_conf.inc.php	(revision 4329)
@@ -23,29 +23,48 @@
 // +-----------------------------------------------------------------------+
 
-global $ec_conf, $page, $ec_conf_index;
+global $ec_conf, $page, $ec_conf_index, $ec_conf_default,
+       $ec_conf_possible_values;
 
 // $ec_conf initalization
 
+// $ec_conf has numeric indexes (instead of string keys like 'activated',
+// 'howto'...) because of its first reading, done with the "explode" function.
+// It would be  very easy to build a string keys indexed array, thanks to
+// following instructions :
+/*
+$t = mysql_fetch_row(pwg_query("
+  SELECT `value`
+  FROM `".CONFIG_TABLE."`
+  WHERE `param` = 'event_cats';
+"));
+$ec_conf_temp = explode(',', $t[0]);
+$ec_conf = array(); $i = 0;
+foreach ($ec_conf_default as $k => $v) $ec_conf[$k] = ec_conf_temp[$i++];
+*/
+// Though, I prefer to keep $ec_conf with numeric indexes, so to be compelled
+// to go through function change_ec_conf() to modify ec_conf, and thus update
+// the DB at the same time.
+
 $ec_conf_default = array( // PLUGIN CONFIGURATION ($ec_conf) :
                           // ---------------------------------
-  'activated'             // plugin activated
+  'activated'             // plugin activated, 0 or 1
     => '0',               // 
                           // 
+  'howto'                 // whether the small aknowledgement message has
+    => '0',               // already been displayed, 0 or 1
+                          // 
   'dup_allow'             // duplication allowance :
-    => '0',               //   0 : no account ;
+    => '2',               //   0 : no account ;
                           //   1 : all accounts ;
                           //   2 : specified by group and user ids ;
                           // 
+  'duplic_display'        // duplication link display in the menubar :
+    => '2',               //   0 : "Register" for everybody ;
+                          //   1 : "Duplicate" for everybody ;
+                          //   2 : "Register" only for generic accounts,
+                          //       "Duplicate" for all other accounts ;
+                          // 
   'auto_code_dg_nb'       // number of digits when creating a new code
-    => '10',              // automatically
-                          // 
-  'duplic_gen'            // whether Generic accounts allow to be duplicated
-    => '0',               //
-                          // 
-  'duplic_type'           // the kind of account type (Contacts, Friends,
-    => '0',               // Family) allowed to duplicate account
-                          // 
-  'howto'                 // whether the small aknowledgement message has
-    => '0',               // already been displayed
+    => '10',              // automatically, several values
                           // 
   'unknown_code'          // what to do in case an unknown code is used with
@@ -57,5 +76,16 @@
                           // 
   'unknown_code_ap_id'    // the id of the Additional Page which must be used
-    => '0',               // in case of usage of an unknow code.
+    => '0',               // in case of usage of an unknow code, several vals.
+);
+
+$ec_conf_possible_values = array(
+  'activated'          => array('0', '1'),
+  'howto'              => array('0', '1'),
+  'dup_allow'          => array('0', '1', '2'),
+  'duplic_display'     => array('0', '1', '2'),
+  'auto_code_dg_nb'    => array( '4',  '5',  '8', '10', '12', '15',
+                                '16', '20', '24', '25', '30', '32'),
+  'unknown_code'       => array('0', '1', '2'),
+  'unknown_code_ap_id' => array()
 );
 
@@ -101,15 +131,24 @@
  */
 function change_ec_conf($c, $v) {
-  global $ec_conf, $page, $ec_conf_index;
+  global $ec_conf, $page, $ec_conf_index, $ec_conf_possible_values;
   if (array_key_exists($c, $ec_conf_index)) {
-    $ec_conf[$ec_conf_index[$c]] = $v;
-    return (pwg_query("
-      UPDATE `".CONFIG_TABLE."`
-      SET `value` = \"".implode(',', $ec_conf)."\"
-      WHERE `param` = 'event_cats';
-    ") !== false);
+    if (
+      count($ec_conf_possible_values[$c]) == 0 or
+      in_array($v, $ec_conf_possible_values[$c])
+    ) {
+      $ec_conf[$ec_conf_index[$c]] = $v;
+      return (pwg_query("
+        UPDATE `".CONFIG_TABLE."`
+        SET `value` = \"".implode(',', $ec_conf)."\"
+        WHERE `param` = 'event_cats';
+      ") !== false);
+    }
+    else {
+      $page['errors'][] = 'Bad change_ec_conf value';
+      return false;
+    }
   }
   else {
-    $page['errors'][] = 'Bad change_ec_conf argument';
+    $page['errors'][] = 'Bad change_ec_conf index';
     return false;
   }
@@ -130,5 +169,5 @@
    return $ec_conf[$ec_conf_index[$c]];
   else {
-    $page['errors'][] = 'Bad read_ec_conf argument';
+    $page['errors'][] = 'Bad read_ec_conf index';
     return false;
   }
Index: /extensions/event_cats/include/evntcats_admin_funcs.inc.php
===================================================================
--- /extensions/event_cats/include/evntcats_admin_funcs.inc.php	(revision 4328)
+++ /extensions/event_cats/include/evntcats_admin_funcs.inc.php	(revision 4329)
@@ -63,4 +63,21 @@
 
 /*
+ * ec_end2()
+ * Process repetitive task when error in database modifying functions.
+ *
+ * @param
+ *   $n : number to display
+ * @return
+ *   false as this function is used when there is a problem
+ */
+function ec_end2($n) {
+  global $page;
+  $page['errors'][] =
+   sprintf(l10n('ec_DB_problem'), $n).
+   'MySQL error '.mysql_errno().', "'.mysql_error().'"';
+  return false;
+}
+
+/*
  * ec_create_user_OK()
  * Creates new generic user and eventually new group as described in $_POST.
@@ -92,5 +109,5 @@
   }
   else
-   $page['infos'][] = l10n('ec_user_create_OK').$_POST['login'];
+   $page['infos'][] = sprintf(l10n('ec_user_create_OK'), $_POST['login']);
   if (
     pwg_query("
@@ -100,7 +117,7 @@
     ") !== false
   )
-   $page['infos'][] = l10n('ec_user_generic_OK').$_POST['login'];
+   $page['infos'][] = sprintf(l10n('ec_user_generic_OK'), $_POST['login']);
   else
-   $page['errors'][] =l10n('ec_user_generic_pb').$_POST['login'];
+   $page['errors'][] = sprintf(l10n('ec_user_generic_pb'), $_POST['login']);
   
   // New group creation if required,
@@ -124,8 +141,9 @@
       ");
     if ($t4)
-     $page['infos'][]=l10n('ec_group_create_OK').$_POST['groupname'];
+     $page['infos'][] =
+      sprintf(l10n('ec_group_create_OK'), $_POST['groupname']);
     if (!$t3)
      $page['errors'][] =
-      l10n('ec_group_create_pb').' (1) ; '.
+      sprintf(l10n('ec_group_create_pb'), $_POST['groupname']).' (1) : '.
       'MySQL error '.mysql_errno().', "'.mysql_error().'"';
     if (
@@ -135,12 +153,10 @@
       ") === false
     ) $page['errors'][] =
-     l10n('ec_group_create_pb').' (2) ; '.
+      sprintf(l10n('ec_group_create_pb'), $_POST['groupname']).' (2) : '.
      'MySQL error '.mysql_errno().', "'.mysql_error().'"';
-    else
-     $page['infos'][] =
-      $_POST['login'].
-      l10n('ec_group_create_OK2').
-      $_POST['groupname']
-     ;
+    else $page['infos'][] = sprintf(
+      l10n('ec_group_create_OK2'),
+      $_POST['login'], $_POST['groupname']
+    );
   }
   return $ec_user_id;
@@ -206,10 +222,10 @@
   
   if (!isset($_POST['ec_act1']))
-   return ec_end1('ec_act1', 'ec_bad_argument1');
+   return ec_end1('ec_act1', 'Bad argument : ');
   
   if (
     ($_POST['ec_act1']) != 'toggle_forced' and
     !isset($_POST['ec_input_action'])
-  ) return ec_end1('ec_input_action', 'ec_bad_argument1');
+  ) return ec_end1('ec_input_action', 'Bad argument : ');
   
   $is_creation = true;
@@ -234,10 +250,10 @@
         !isset($_POST['ec_in_up_code']) or
         !ereg('^[a-zA-Z0-9_-]{4,32}$', $_POST['ec_in_up_code'])
-      ) return ec_end1('ec_in_up_code', 'ec_bad_argument7');
+      ) return ec_end1('ec_in_up_code', 'Improper code : ');
       else $ec_code = $_POST['ec_in_up_code'];
       
       foreach ($ec_lists['ec_table'] as $ec_entry)
        if ($ec_code == $ec_entry['code'])
-        return ec_end1('ec_in_up_code', 'ec_bad_argument2');
+        return ec_end1('ec_in_up_code', 'Code already exists : ');
       
       if (
@@ -246,5 +262,5 @@
           $_POST['ec_sel_user'] != 'old'
         )
-      ) return ec_end1('ec_sel_user', 'ec_bad_argument1');
+      ) return ec_end1('ec_sel_user', 'Bad argument : ');
     
     case 'modify_entry_submit':
@@ -256,14 +272,14 @@
             !isset($_POST['login']) or
             $_POST['login'] == ''
-          ) return ec_end1('login', 'ec_bad_argument1');
+          ) return ec_end1('login', 'Bad argument : ');
           if (in_array($_POST['login'], $ec_lists['user_ids']))
-           return ec_end1('login', 'ec_bad_argument3');
+           return ec_end1('login', 'User already exists : ');
         }
         elseif ($_POST['ec_sel_user'] == 'old') {
           if (!isset($_POST['ec_in_up_usr_list']))
-           return ec_end1('login', 'ec_bad_argument1');
+           return ec_end1('login', 'Bad argument : ');
           $ec_user_id = $_POST['ec_in_up_usr_list'];
           if (!array_key_exists($ec_user_id, $ec_lists['user_ids']))
-           return ec_end1('ec_in_up_usr_list', 'ec_bad_argument6');
+           return ec_end1('ec_in_up_usr_list', 'User doesn\'t exist : ');
         }
         else $action = 'ec_nok';
@@ -279,5 +295,7 @@
         !isset($_POST['ec_entry_sel']) or
         !array_key_exists($_POST['ec_entry_sel'], $ec_lists['ec_table'])
-      ) return ec_end1('ec_entry_sel', 'ec_bad_argument5');
+      ) return ec_end1(
+        'ec_entry_sel', 'Code doesn\'t exist or non-duplicable code : '
+      );
       
       // Other checks for user type and value
@@ -324,8 +342,10 @@
       if (!array_key_exists($_POST['ec_entry_sel'],
        $ec_lists['duplicable_codes']['ids'])
-      ) return ec_end1('ec_entry_sel', 'ec_bad_argument5');
+      ) return ec_end1(
+        'ec_entry_sel', 'Code doesn\'t exist or non-duplicable code : '
+      );
       
     break;
-    default: ec_end1('ec_act1', 'ec_bad_argument1');
+    default: ec_end1('ec_act1', 'Bad argument : ');
   }
   // Pfew !
@@ -336,5 +356,5 @@
       case 'add_p': // Additional Page
         if (isset($_POST['ec_in_up_aps'])) $arg2 = $_POST['ec_in_up_aps'];
-        else ec_end1('ec_in_up_aps', 'ec_bad_argument1');
+        else ec_end1('ec_in_up_aps', 'Bad argument : ');
         $arg1 = 'NULL';
       break;
@@ -345,9 +365,9 @@
           if ($_POST['ec_input_action'] == 'img') {
             if (isset($_POST['ec_in_up_img'])) $arg2 = $_POST['ec_in_up_img'];
-            else ec_end1('ec_in_up_img', 'ec_bad_argument1');
+            else ec_end1('ec_in_up_img', 'Bad argument : ');
           }
           else $arg2 = 'NULL';
         }
-        else ec_end1('ec_in_up_cat', 'ec_bad_argument1');
+        else ec_end1('ec_in_up_cat', 'Bad argument : ');
       break;
       case 'home':    // Home : nothing to do : "arg"s are ''
@@ -355,5 +375,5 @@
         $arg1 = 'NULL'; $arg2 = 'NULL';
       break;
-      default: ec_end1('ec_input_action', 'ec_bad_argument1');
+      default: ec_end1('ec_input_action', 'Bad argument : ');
     }
     
@@ -361,5 +381,5 @@
     $forced = (isset($_POST['ec_in_up_forced'])) ? 'true' : 'false';
     if ($_POST['ec_act1'] == 'duplicate_entry_submit' and $forced == 'true')
-     return ec_end1('ec_in_up_forced', 'ec_bad_argument1');
+     return ec_end1('ec_in_up_forced', 'Bad argument : ');
     
     // User and eventually group creation, if needed
@@ -384,5 +404,5 @@
       AND `forced`  = '".$forced."'
   "))) !== false) { // print("<pre>$arg1 $arg2<br>$q</pre>");
-    $page['errors'][] = l10n('ec_entry_already_exists').$t1[0];
+    $page['errors'][] = sprintf(l10n('ec_entry_already_exists'), $t1[0]);
     return false;
   }
@@ -440,5 +460,5 @@
     ) {
       $page['errors'][] =
-       l10n('ec_entry_create_pb').
+       l10n('ec_entry_create_pb').' : '.
        'MySQL error '.mysql_errno().', "'.mysql_error().'"'
       ;
@@ -449,5 +469,5 @@
       $forced = ($forced == 'false') ? '' : l10n('ec_cnfrm_forced');
       $page['infos'][] =
-       l10n('ec_entry_create_OK').mysql_insert_id().' : '.
+       sprintf(l10n('ec_entry_create_OK'), mysql_insert_id()).' : '.
        $ec_code.' => '.
        $ec_lists['user_ids'][$ec_user_id].$forced
@@ -470,10 +490,12 @@
     ) {
       $page['errors'][] =
-       l10n('ec_entry_create_pb').
+       l10n('ec_entry_create_pb').' : '.
        'MySQL error '.mysql_errno().', "'.mysql_error().'"'
       ;
       $ret = false;
     }
-    else $page['infos'][] = l10n('ec_entry_modify_OK').$_POST['ec_entry_sel'];
+    else $page['infos'][] = sprintf(
+      l10n('ec_entry_modify_OK'), $_POST['ec_entry_sel']
+    );
   }
   build_ec_lists();
@@ -492,19 +514,15 @@
 function ec_delete_entry_OK($ec_id) {
   global $page;
-  if (!pwg_query("
+  if (pwg_query("
     DELETE FROM `".EVNTCATS_TABLE."`
     WHERE `id` = ".$ec_id
-  )) {
+  ) === false) {
     $page['errors'][] =
-     l10n('ec_entry_del_nok_pre').
-     $ec_id.
-     l10n('ec_entry_del_nok_end').
+     sprintf(l10n('ec_entry_del_nok'),
+     $ec_id).
      'MySQL error '.mysql_errno().', "'.mysql_error().'"';
     return false;
   }
-  else $page['infos'][] =
-   l10n('ec_entry_del_ok_pre').
-   $ec_id.
-   l10n('ec_entry_del_ok_end');
+  else $page['infos'][] = sprintf(l10n('ec_entry_del_ok'), $ec_id);
   return true;
 }
Index: /extensions/event_cats/include/evntcats_main_funcs.inc.php
===================================================================
--- /extensions/event_cats/include/evntcats_main_funcs.inc.php	(revision 4328)
+++ /extensions/event_cats/include/evntcats_main_funcs.inc.php	(revision 4329)
@@ -180,6 +180,6 @@
  */
 function build_ec_addp() {
-  global $ec_lists, $ec_ap_ok;
-  if ($ec_ap_ok) {
+  global $ec_lists;
+  if (EC_AP_OK) {
     $res = pwg_query("SELECT `id`, `title` FROM `".ADD_PAGES_TABLE."`");
     while ($r = mysql_fetch_assoc($res)) {
@@ -244,5 +244,5 @@
  */
 function build_ec_table() {
-  global $ec_lists, $ec_ap_ok;
+  global $ec_lists;
   
   $q = pwg_query("
@@ -287,5 +287,5 @@
       case 2: // Additional Page
         if (
-          $ec_ap_ok and (
+          EC_AP_OK and (
             is_in($ec_entry['action'], 'ec_ok') or
             $ec_entry['action'] == 'ec_nok'
@@ -322,6 +322,4 @@
 function build_ec_lists() {
   
-  global $ec_ap_ok, $template, $ec_lists, $conf;
-  
   // Construction of $ec_lists['add_pages'] array var
   build_ec_addp();
@@ -373,5 +371,5 @@
         FROM ".EVNTCATS_TABLE."
         WHERE `code` IS NULL
-          AND `arg1` = '1'
+          AND `arg1` = 1
           AND `arg2` IS NOT NULL
       ;",
@@ -385,7 +383,7 @@
     array_from_query("
       SELECT `arg2`
-        FROM ".EVNTCATS_TABLE."
+        FROM `".EVNTCATS_TABLE."`
         WHERE `code` IS NULL
-          AND `arg1` = '2'
+          AND `arg1` = 2
           AND `arg2` IS NOT NULL
       ;",
@@ -400,6 +398,15 @@
   $users_granted_ids = array();
   
+  $c = (count($t = mysql_fetch_row(pwg_query("
+    SELECT `arg2`
+    FROM `".EVNTCATS_TABLE."`
+    WHERE `code` IS NULL
+      AND `arg1` = 3
+      AND `arg2` IS NOT NULL
+    LIMIT 1;
+  "))) == 0) ? 0 : intval($t[0]);
+  
   $users_granted_thks_gen_ids = array();
-  if ($ec_gen_granted = (read_ec_conf('duplic_gen') != '0')) {
+  if ($ec_gen_granted = (($c & 8) != 0)) {
     $users_granted_thks_gen_ids = order_by_name(
       array_diff(
@@ -425,6 +432,5 @@
   $types_granted_ids = array();
   $users_granted_thks_types_ids = array();
-  $c = intval(read_ec_conf('duplic_type'));
-  if ($c != 0) {
+  if (($c & 7) != 0) {
     if (($c & 1) != 0) $types_granted_ids[] = '1';
     if (($c & 2) != 0) $types_granted_ids[] = '2';
@@ -547,5 +553,5 @@
   // Returns an array which values are all the user_ids allowed to display a
   // "duplicate" link. The keys of this array are strange (for direct allowed
-  // users, keys are usernames), but normally not used
+  // users, keys are usernames), but should not used
   return $users_granted_ids;
 }
@@ -561,5 +567,5 @@
  */
 function dup_allowed($user_id) {
-  return true;
+  return in_array($user_id, build_dup_arrays());
 }
 
Index: /extensions/event_cats/language/fr_FR/duplic.lang.php
===================================================================
--- /extensions/event_cats/language/fr_FR/duplic.lang.php	(revision 4328)
+++ /extensions/event_cats/language/fr_FR/duplic.lang.php	(revision 4329)
@@ -7,6 +7,6 @@
 */
 
-$lang['Duplicate']         = 'Dupliquer';
-$lang['Duplicate account'] = 'Créer un compte avec les mêmes propriétés';
+$lang['Duplicate']                                 = 'Dupliquer';
+$lang['Create a new account with same properties'] = 'Créer un compte avec les mêmes propriétés';
 
 ?>
Index: /extensions/event_cats/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/event_cats/language/fr_FR/plugin.lang.php	(revision 4328)
+++ /extensions/event_cats/language/fr_FR/plugin.lang.php	(revision 4329)
@@ -7,213 +7,185 @@
 */
 
-// In template
-// Upper banner
-$lang['ec_tab_autoid_entries']    = 'Entrées autolog';
-$lang['ec_tab_autoid_modif']      = 'Modification autolog';
-$lang['ec_tab_autoid_new']        = 'Création autolog';
-$lang['ec_tab_config']            = 'Configuration générale';
-$lang['ec_tab_duplication']       = 'Duplication';
-// Autolog area
-$lang['ec_javascript_needed']     = 'Javascript DOIT être activé sur votre navigateur pour un fonctionnement correct de cette page !';
-$lang['ec_admin_page_title']      = 'Event Categories';
-$lang['ec_admin_page_howto']      = 'Event Categories, pour catégories événementielles :<br>cette extension permet d\'identifier automatiquement un compte ("autolog"), et de dupliquer le compte sous lequel un visiteur est identifié ("duplication").<br><br>Merci au Forum, plg, ddtddt, flipflip, P@t pour le code principal :-) !';
-$lang['ec_plugin_ap_ok']          = 'Plugin Additional Pages : actif';
-$lang['ec_plugin_ap_nok']         = 'Plugin <a href = "http://fr.piwigo.org/ext/extension_view.php?eid=153" title = "Ouvrir une nouvelle fenêtre sur le plugin Additional Pages" target = "_blank">Additional Pages</a> : inactif';
-$lang['ec_entry_table_title']     = 'Entrées du paramètre "autolog"';
-$lang['ec_new_entry_title']       = 'Nouvelle entrée du paramètre "autolog"';
-$lang['ec_modify_entry_title']    = 'Modification d\'une entrée du paramètre "autolog"';
-$lang['ec_top_title']             = 'Placer ce titre en haut de la page';
+// Convenient
+$t_ap1                             = 'Ouvrir une nouvelle fenêtre sur le plugin Additional Pages';
+$t_ap2                             = '<a href  = "http://fr.piwigo.org/ext/extension_view.php?eid =153" title  = "'.$t_ap1.'" target  = "_blank">Additional Pages</a>';
+
+// +-------------------------------------------------------------------------+
+// | In templates                                                            |
+// +-------------------------------------------------------------------------+
+
+// "Header"
+$lang['Admin page title']          = 'Event Categories';
+$lang['Acknowledgement']           = 'Event Categories, pour catégories événementielles :<br />cette extension permet d\'identifier automatiquement un compte ("autolog"), et de dupliquer le compte sous lequel un visiteur est identifié ("duplication").<br /><br />Merci au Forum, plg, ddtddt, flipflip, VDigital, P@t pour le code principal :-) !';
+$lang['JS needed']                 = 'Javascript DOIT être activé sur votre navigateur pour un fonctionnement correct de cette page !';
+
+// Autolog page
+$lang['Additional Pages active']   = 'Plugin Additional Pages : actif';
+$lang['Additional Pages inactive'] = 'Plugin '.$t_ap2.' : inactif';
+$lang['Autolog entries']           = 'Entrées du paramètre "autolog"';
+$lang['Place title on top ttip']   = 'Placer ce titre en haut de la page';
 // Table
-$lang['ec_col_name_entry']        = 'Entrée';
-$lang['ec_col_name_code']         = 'Code';
-$lang['ec_col_name_user']         = 'Utilisateur';
-$lang['ec_col_name_bhvr']         = 'Identification ?';
-$lang['ec_col_name_dspl']         = 'Page affichée';
-$lang['ec_col_name_actn']         = 'Outils';
-$lang['ec_lower_tools_desc']      = 'Entrée sélectionnée :';
-$lang['ec_show_URL']              = 'URL : ';
-$lang['ec_test_text']             = 'Tester';
-$lang['ec_delete_text']           = 'Supprimer';
-$lang['ec_modify_text']           = 'Modifier';
-$lang['ec_url_tooltip']           = 'Copiez l\'adresse du lien pour le transmettre';
-$lang['ec_test_tooltip']          = 'Tester l\'URL ( => déconnexion admin.)';
-$lang['ec_url_delete']            = 'Supprimer l\'entrée';
-$lang['ec_modify_tooltip']        = 'Modifier l\'entrée';
-$lang['ec_url_disable']           = 'Rendre l\'entrée périmée';
-$lang['ec_url_forced']            = 'Ne plus forcer ce code à afficher cette page';
-$lang['ec_url_nforced']           = 'Forcer ce code à afficher cette page';
-$lang['ec_url_duplicate']         = 'Recopier ce code pour une nouvelle entrée';
-// New entry
-$lang['ec_create_modify_code']    = 'Nouvelle entrée';
-$lang['ec_new_full_auto']         = 'Tout automatique : nouveau code, nouvel utilisateur et nouveau groupe d\'après page à afficher ci-dessous';
-$lang['ec_new_entry']             = 'Code';
-$lang['ec_up_code_lbl_code_new']  = 'Nouveau code :';
-$lang['ec_sel_entry']             = 'Entrée sélectionnée';
-$lang['ec_new_entry_button']      = 'Générer un code automatiquement';
-$lang['ec_gen_code_nb_pre']       = 'de';
-$lang['ec_gen_code_nb_min']       = ' (min)';
-$lang['ec_gen_code_nb_max']       = ' (max)';
-$lang['ec_gen_code_nb_end']       = 'caractères';
-$lang['ec_up_code_lbl_code_old']  = 'Code existant :';
-$lang['ec_up_code_lbl_user']      = 'Utilisateur identifié';
-$lang['ec_up_code_lbl_user_none'] = 'Aucun (entrée périmée)';
-$lang['ec_up_code_lbl_user_new']  = 'Nouvel utilisateur (créer un compte générique) :';
-$lang['ec_new_user_name']         = 'Nom d\'utilisateur';
-$lang['ec_new_user_pswd']         = 'Mot de passe';
-$lang['ec_confirm_pswd']          = 'Confirmez :';
-$lang['ec_new_user_group']        = 'Nouveau groupe';
-$lang['ec_up_code_lbl_gen_user']  = 'Générer un nom d\'utilisateur d\'après l\'action choisie';
-$lang['ec_up_code_lbl_user_old']  = 'Utilisateur existant :';
-$lang['ec_up_code_lbl_action']    = 'Page affichée';
-$lang['ec_up_code_lbl_forced']    = 'Forcée';
-$lang['ec_up_code_lbl_aps']       = 'Additional Page';
-$lang['ec_up_code_lbl_cats']      = 'Catégorie';
-$lang['ec_up_code_lbl_img']       = 'Id. image';
-$lang['ec_up_code_lbl_home']      = 'Accueil';
-$lang['ec_up_code_lbl_refused']   = 'Accès refusé';
-// Duplication
-$lang['ec_duplication']           = 'Dupliquer';
-$lang['ec_duplication_config']    = 'Configuration';
-$lang['ec_dup_types']             = 'Types d\'utilisateurs';
-$lang['ec_dup_types_generic']     = 'Génériques';
-$lang['ec_dup_types_contacts']    = 'Contacts';
-$lang['ec_dup_types_friends']     = 'Amis';
-$lang['ec_dup_types_family']      = 'Famille';
-$lang['ec_duplication_allowance'] = 'Autorisation de la duplication';
-$lang['ec_dup_allowance_none']    = 'Aucun compte';                       /*
-$lang['ec_dup_allowance_gen']     = 'Tous les comptes génériques';        */
-$lang['ec_dup_allowance_group']   = 'Sélection par groupe';
-$lang['ec_dup_allowance_all']     = 'Tous les comptes';                   /*
-$lang['ec_duplication_display']   = 'Affichage du lien de duplication';
-$lang['ec_dup_display_normal']    = 'Normal';
-$lang['ec_dup_display_dup']       = 'Modifié';                            */
-$lang['ec_duplic_ok']             = 'Duplication autorisée';
-$lang['ec_duplic_ok_groups']      = 'Duplication autorisée grâce à l\'appartenance aux groupes et aux types';
-$lang['ec_duplic_nok']            = 'Duplication refusée';
-$lang['ec_dup_grp_ok_sbmt_lbl']   = 'Interdire la duplication aux groupes sélectionnés';
-$lang['ec_dup_grp_nok_sbmt_lbl']  = 'Autoriser la duplication aux groupes sélectionnés';
-$lang['ec_dup_typ_sbmt_nok_lbl']  = 'Interdire la duplication aux types sélectionnés';
-$lang['ec_dup_typ_sbmt_ok_lbl']   = 'Autoriser la duplication aux types sélectionnés';
-$lang['ec_dup_usr_ok_sbmt_lbl']   = 'Interdire la duplication aux utilisateurs sélectionnés';
-$lang['ec_dup_usr_nok_sbmt_lbl']  = 'Autoriser la duplication aux utilisateurs sélectionnés';
-$lang['ec_dup_conf_sbmt_lbl']     = 'Sauvegarder la configuration de la duplication';
-// JS checks
-$lang['ec_confirm_test']          = "Vraiment tester le code sélectionné ?\n\rCela terminera votre session d'administration.";
-$lang['ec_confirm_delete']        = "Vraiment supprimer l'entrée sélectionnée ?";
-$lang['ec_confirm_disable']       = "Vraiment rendre périmé le code sélectionné ?\n\rCela supprimera toutes les autres entrées utilisant le même code, s'il y en a.";
-$lang['ec_confirm_force']         = "Forcer l'affichage pour le code sélectionné\n\rsupprimera toutes les autres entrées utilisant le même code, s'il y en a. OK ?";
-$lang['ec_confirm_del_other']     = "Cela supprimera toutes les autres entrées utilisant le même code, s'il y en a.\n\rOK ?";
-$lang['ec_confirm_change_user']   = "Modifier l'utilisateur identifié supprimera\n\rtoutes les autres entrées utilisant le même code, s'il y en a. OK ?";
-$lang['ec_gen_user_act_miss']     = 'Sélectionnez d\'abord une page à afficher';
-$lang['ec_act_cat_miss']          = 'Catégorie ?';
-$lang['ec_act_img_miss']          = 'L\'identifiant d\'une image doit être un nombre.';
-$lang['ec_new_pwd_gen']           = 'Pensez à NOTER<br>le mot de passe !';
-$lang['ec_submit_code_miss']      = 'Vous devez fournir un code.';
-$lang['ec_submit_code_bad']       = 'Un code doit comprendre entre 4 et 32 caractères inclus dans [a-zA-Z0-9_-].';
-$lang['ec_submit_user_miss']      = 'Vous devez fournir un utilisateur.';
-$lang['ec_submit_action_miss']    = 'Vous devez proposer une page à afficher.';
-$lang['ec_act_entry_miss']        = 'Sélectionnez d\'abord une entrée à modifier.';
-$lang['ec_clk_entry_miss']        = 'Sélectionnez d\'abord une entrée.';
-$lang['ec_code_already_exists']   = 'Ce code existe déjà.';
-$lang['ec_user_already_exists']   = 'Ce nom d\'utilisateur existe déjà.';
-$lang['ec_conf_pwd_dont_match']   = 'Le mot de passe n\'est pas correctement confirmé.';
+$lang['Entry']                     = 'Entrée';
+$lang['Code']                      = 'Code';
+$lang['Username']                  = 'Utilisateur';
+$lang['Identification']            = 'Identification ?';
+$lang['Displayed page']            = 'Page affichée';
+$lang['Tools']                     = 'Outils';
+$lang['Selected entry']            = 'Entrée sélectionnée';
+$lang['URL']                       = 'URL : ';
+$lang['Test']                      = 'Tester';
+$lang['Delete']                    = 'Supprimer';
+$lang['Modify']                    = 'Modifier';
+$lang['Copy URL ttip']             = 'Copiez l\'adresse du lien pour le transmettre';
+$lang['Test URL ttip']             = 'Tester l\'URL (     => déconnexion admin.)';
+$lang['Delete entry ttip']         = 'Supprimer l\'entrée';
+$lang['Modify entry ttip']         = 'Modifier l\'entrée';
+$lang['Outdate entry ttip']        = 'Rendre l\'entrée périmée';
+$lang['Unforce display ttip']      = 'Ne plus forcer ce code à afficher cette page';
+$lang['Force display ttip']        = 'Forcer ce code à afficher cette page';
+$lang['Duplicate entry ttip']      = 'Recopier ce code pour une nouvelle entrée';
 
-// In PHP files
-// Errors
-$lang['ec_action_pb']             = 'champ "action" corrompu (plusieurs valeurs pour un code ayant plusieurs entrées)';
-$lang['ec_username_pb']           = 'champ "user_id" corrompu (plusieurs valeurs pour un code ayant plusieurs entrées)';
-$lang['ec_username_miss']         = 'utilisateur inexistant (probablement supprimé)';
-$lang['ec_category_miss']         = 'catégorie inexistante (probablement supprimée)';
-$lang['ec_image_miss']            = 'image inexistante (probablement supprimée)';
-$lang['ec_add_page_miss']         = 'page Additional Pages inexistante (probablement supprimée)';
-$lang['ec_entry_del_nok_pre']     = 'Problème avec suppression entrée ';
-$lang['ec_entry_del_nok_end']     = ' : ';
-$lang['ec_entry_dup_nok_pre1']    = 'Problème avec tentative de rendre périmée entrée ';
-$lang['ec_entry_dup_nok_end1']    = ' : ';
-$lang['ec_entry_dis_nok_pre1']    = 'Problème avec tentative de rendre périmée entrée ';
-$lang['ec_entry_dis_nok_end1']    = ' : ';
-$lang['ec_entry_dis_nok_pre2']    = 'Problème avec tentative de rendre périmée entrée ';
-$lang['ec_entry_dis_nok_mid2']    = ' (lié à Add. Page n°';
-$lang['ec_entry_dis_nok_end2']    = ')';
-$lang['ec_entry_dis_nok_pre3']    = 'Problème avec tentative de rendre périmée entrée ';
-$lang['ec_entry_dis_nok_end3']    = ' (arg1 = NULL)';
-$lang['ec_user_create_OK']        = 'Création utilisateur ';
-$lang['ec_user_create_pb']        = 'Création nouvel utilisateur impossible';
-$lang['ec_user_generic_OK']       = 'Utilisateur générique : ';
-$lang['ec_user_generic_pb']       = 'Problème passage utilisateur générique : ';
-$lang['ec_group_create_OK']       = 'Création nouveau groupe ';
-$lang['ec_group_create_OK2']      = ' associé à ';
-$lang['ec_group_create_pb']       = 'Création nouveau groupe impossible : ';
-$lang['ec_entry_create_OK']       = 'Création entrée ';
-$lang['ec_entry_create_pb']       = 'Création nouvelle entrée impossible : ';
-$lang['ec_cnfrm_forced']          = ' (affichage forcé)';
-$lang['ec_entry_modify_OK']       = 'Modification entrée ';
-$lang['ec_entry_already_exists']  = 'Entrée déjà existante : ';
-$lang['ec_bad_argument1']         = 'Mauvais argument : ';
-$lang['ec_bad_argument2']         = 'Code déjà existant : ';
-$lang['ec_bad_argument3']         = 'Utilisateur déjà existant : ';
-$lang['ec_bad_argument4']         = 'Additional Page, catégorie, ou image, inexistante : ';
-$lang['ec_bad_argument5']         = 'Code inexistant ou non duplicable : ';
-$lang['ec_bad_argument6']         = 'Utilisateur inexistant : ';
-$lang['ec_bad_argument7']         = 'Code non conforme : ';
-// Infos
-$lang['ec_entry_del_ok_pre']      = 'Entrée ';
-$lang['ec_entry_del_ok_end']      = ' supprimée.';
-$lang['ec_entry_dup_ok_pre']      = 'Entrée ';
-$lang['ec_entry_dup_ok_end']      = ' dupliquée.';
-$lang['ec_entry_dis_ok_pre1']     = 'Entrée ';
-$lang['ec_entry_dis_ok_end1']     = ' maintenant périmée';
-$lang['ec_entry_dis_ok_pre2']     = ', renvoie vers Additional Page n°';
-$lang['ec_entry_dis_ok_mid2']     = ' : ';
-$lang['ec_entry_dis_ok_end2']     = '';
+// New entry and Modify entry pages
+$lang['New entry title']           = 'Nouvelle entrée du paramètre "autolog"';
+$lang['Modify entry title']        = 'Modification d\'une entrée du paramètre "autolog"';
+$lang['New entry']                 = 'Nouvelle entrée';
+$lang['Full auto']                 = 'Tout automatique : nouveau code, nouvel utilisateur et nouveau groupe d\'après page à afficher ci-dessous';
+$lang['New code']                  = 'Nouveau code :';
+$lang['Auto code button']          = 'Générer un code automatiquement';
+$lang['Auto code mid']             = 'de';
+$lang['Auto code min']             = ' (min)';
+$lang['Auto code max']             = ' (max)';
+$lang['Auto code end']             = 'caractères';
+$lang['Existing code']             = 'Code existant :';
+$lang['Identified user']           = 'Utilisateur identifié';
+$lang['No user']                   = 'Aucun (entrée périmée)';
+$lang['New generic user']          = 'Nouvel utilisateur (créer un compte générique) :';
+$lang['New username']              = 'Nom d\'utilisateur';
+$lang['New password']              = 'Mot de passe';
+$lang['Confirm password']          = 'Confirmez :';
+$lang['New group']                 = 'Nouveau groupe';
+$lang['Generate username']         = 'Générer un nom d\'utilisateur d\'après l\'action choisie';
+$lang['Existing user']             = 'Utilisateur existant :';
+$lang['Displayed page']            = 'Page affichée';
+$lang['Forced']                    = 'Forcée';
+$lang['Additional Page']           = 'Additional Page';
+$lang['Category']                  = 'Catégorie';
+$lang['Image id']                  = 'Id. image';
+$lang['Home']                      = 'Accueil';
+$lang['Access denied']             = 'Accès refusé';
 
-// Table
-//   actions
-$lang['ec_ok']                    = 'OUI';
-$lang['ec_ok_ap_pb']              = 'OUI, mais Add. Page inconnue';
-$lang['ec_ok_cat_pb']             = 'OUI, mais catégorie inconnue';
-$lang['ec_ok_img_pb']             = 'OUI, mais image inconnue';
-$lang['ec_nok']                   = 'NON';
-$lang['ec_nok_ap_pb']             = 'NON';
-$lang['ec_nok_userid_miss']       = 'NON : utilisateur inconnu';
-$lang['ec_nok_action_pb']         = 'NON : "action" corrompu';
-$lang['ec_nok_userid_pb']         = 'NON : "user_id" corrompu';
-// Username can't be displayed
-$lang['ec_dspl_nok_actn']         = '"action" inutilisable';
-$lang['ec_dspl_usr_pb']           = '"user_id" inutilisable';
-$lang['ec_dspl_nok_usr_pre']      = 'Utilisateur n°';
-$lang['ec_dspl_nok_usr_mid1']     = ' (';
-$lang['ec_dspl_nok_usr_mid2']     = ' )';
-$lang['ec_dspl_nok_usr_end']      = ' n\'existe pas';
-//   displayed pages
-$lang['ec_dspl_ok_home']          = 'Accueil';
-$lang['ec_dspl_ok_acc_denied']    = 'Accès refusé';
-$lang['ec_dspl_ok_cat_pre']       = 'Catégorie n°';
-$lang['ec_dspl_ok_cat_mid']       = ' : ';
-$lang['ec_dspl_ok_cat_end']       = '';
-$lang['ec_dspl_ok_img1_pre']      = 'Catégorie n°';
-$lang['ec_dspl_ok_img1_mid']      = ' : ';
-$lang['ec_dspl_ok_img1_end']      = ' ; ';
-$lang['ec_dspl_ok_img2_pre']      = 'image n°';
-$lang['ec_dspl_ok_img2_mid1']     = ' : ';
-$lang['ec_dspl_ok_img2_mid2']     = ' (';
-$lang['ec_dspl_ok_img2_end']      = ')';
-$lang['ec_dspl_ok_ap_pre']        = 'Additional Page n°';
-$lang['ec_dspl_ok_ap_mid']        = ' : ';
-$lang['ec_dspl_ok_ap_end']        = '';
-$lang['ec_dspl_nok_home']         = 'Accueil';
-$lang['ec_dspl_nok_acc_denied']   = 'Accès refusé';
-$lang['ec_dspl_nok_ap_pre']       = ' (Additional Page n°';
-$lang['ec_dspl_nok_ap_end']       = ' n\'existe pas)';
-$lang['ec_dspl_nok_cat_pre']      = ' (catégorie n°';
-$lang['ec_dspl_nok_cat_end']      = ' n\'existe pas)';
-$lang['ec_dspl_nok_img1_pre']     = ' (catégorie n°';
-$lang['ec_dspl_nok_img1_end']     = ' n\'existe pas)';
-$lang['ec_dspl_nok_img2_pre']     = ' (image n°';
-$lang['ec_dspl_nok_img2_mid']     = ' n\'existe pas dans catégorie n°';
-$lang['ec_dspl_nok_img2_end']     = ')';
+// Duplication page
+$lang['Configuration']             = 'Configuration';
+$lang['Types']                     = 'Types d\'utilisateurs';
+$lang['Duplication allowance']     = 'Autorisation de la duplication';
+$lang['No account']                = 'Aucun compte';
+$lang['Selection per group']       = 'Sélection par groupes';
+$lang['All accounts']              = 'Tous les comptes';
+$lang['Register replacement']      = 'Pour les comptes pouvant être dupliqués,%1$s remplacer "%2$s" par "%3$s"';
+                                 // %1$s : nice line feed ; %2$s : "register" ; %3$s : "duplicate"
+$lang['All but generics']          = 'Tous les comptes sauf les génériques';
+$lang['Duplication allowed']       = 'Duplication autorisée';
+$lang['Dup. allowed tks to']       = 'Duplication autorisée grâce à l\'appartenance aux groupes et aux types';
+$lang['Duplication denied']        = 'Duplication refusée';
+$lang['Deny to groups btn']        = 'Interdire la duplication aux groupes sélectionnés';
+$lang['Grant to groups btn']       = 'Autoriser la duplication aux groupes sélectionnés';
+$lang['Deny to types btn']         = 'Interdire la duplication aux types sélectionnés';
+$lang['Grant to types btn']        = 'Autoriser la duplication aux types sélectionnés';
+$lang['Deny to users btn']         = 'Interdire la duplication aux utilisateurs sélectionnés';
+$lang['Grant to users btn']        = 'Autoriser la duplication aux utilisateurs sélectionnés';
+$lang['Save dup. config btn']      = 'Sauvegarder la configuration de la duplication';
+
+// Configuration page
+$lang['Duplication']               = 'Duplication';
+$lang['Unknown code']              = 'Code inconnu';
+$lang['Page for unknown code']     = 'Page affichée pour un code "autolog" inconnu';
+
+// JS messages
+$lang['ec_confirm_test']           = "Vraiment tester le code sélectionné ?\n\rCela terminera votre session d'administration.";
+$lang['ec_confirm_delete']         = "Vraiment supprimer l'entrée sélectionnée ?";
+$lang['ec_confirm_disable']        = "Vraiment rendre périmé le code sélectionné ?\n\rCela supprimera toutes les autres entrées utilisant le même code, s'il y en a.";
+$lang['ec_confirm_force']          = "Forcer l'affichage pour le code sélectionné \n\r supprimera toutes les autres entrées utilisant le même code, s'il y en a. OK ?";
+$lang['ec_confirm_del_other']      = "Cela supprimera toutes les autres entrées utilisant le même code, s'il y en a.\n\rOK ?";
+$lang['ec_confirm_change_user']    = "Modifier l'utilisateur identifié supprimera \n\r toutes les autres entrées utilisant le même code, s'il y en a. OK ?";
+$lang['ec_gen_user_act_miss']      = "Sélectionnez d'abord une page à afficher";
+$lang['ec_act_img_miss']           = "L'identifiant d'une image doit être un nombre.";
+$lang['ec_submit_code_miss']       = "Vous devez fournir un code.";
+$lang['ec_submit_code_bad']        = "Un code doit comprendre entre 4 et 32 caractères, inclus dans [a-zA-Z0-9_-].";
+$lang['ec_submit_user_miss']       = "Vous devez fournir un utilisateur.";
+$lang['ec_submit_action_miss']     = "Vous devez proposer une page à afficher.";
+$lang['ec_act_entry_miss']         = "Sélectionnez d'abord une entrée à modifier.";
+$lang['ec_clk_entry_miss']         = "Sélectionnez d'abord une entrée.";
+$lang['ec_code_already_exists']    = "Ce code existe déjà.";
+$lang['ec_user_already_exists']    = "Ce nom d'utilisateur existe déjà.";
+$lang['ec_conf_pwd_dont_match']    = "Le mot de passe n'est pas correctement confirmé.";
+$lang['ec_new_pwd_gen']            = "Pensez à NOTER<br />le mot de passe !";
+$lang['ec_act_cat_miss']           = "Catégorie ?";
 
 
-// $lang['']   = '';
+// +-------------------------------------------------------------------------+
+// | In PHP files                                                            |
+// +-------------------------------------------------------------------------+
+
+// Tabs
+$lang['ec_tab_autoid_entries']     = 'Entrées autolog';
+$lang['ec_tab_autoid_modif']       = 'Modification autolog';
+$lang['ec_tab_autoid_new']         = 'Création autolog';
+$lang['ec_tab_config']             = 'Configuration générale';
+$lang['ec_tab_duplication']        = 'Duplication';
+
+// Infos
+$lang['ec_user_create_OK']         = 'Création utilisateur %s';
+$lang['ec_user_generic_OK']        = 'Utilisateur "%s" générique';
+$lang['ec_group_create_OK']        = 'Création groupe %s';
+$lang['ec_group_create_OK2']       = '%1$s associé à %2$s';
+                                 // %1$s : username ; %2$s : group
+$lang['ec_entry_create_OK']        = 'Création entrée %s';
+$lang['ec_cnfrm_forced']           = ' (affichage forcé)';
+$lang['ec_entry_modify_OK']        = 'Modification entrée %s';
+$lang['ec_entry_del_ok']           = 'Entrée %s supprimée.';
+$lang['ec_config_saved']           = 'Configuration sauvegardée';
+// Errors
+$lang['ec_action_pb']              = 'champ "action" corrompu (plusieurs valeurs pour un code ayant plusieurs entrées)';
+$lang['ec_username_pb']            = 'champ "user_id" corrompu (plusieurs valeurs pour un code ayant plusieurs entrées)';
+$lang['ec_username_miss']          = 'utilisateur inexistant (probablement supprimé)';
+$lang['ec_category_miss']          = 'catégorie inexistante (probablement supprimée)';
+$lang['ec_image_miss']             = 'image inexistante (probablement supprimée)';
+$lang['ec_add_page_miss']          = 'page Additional Pages inexistante (probablement supprimée)';
+$lang['ec_entry_del_nok']          = 'Problème avec suppression entrée %s : ';
+$lang['ec_user_create_pb']         = 'Création nouvel utilisateur impossible';
+$lang['ec_user_generic_pb']        = 'Problème passage générique utilisateur %s';
+$lang['ec_group_create_pb']        = 'Création groupe %s impossible';
+$lang['ec_entry_create_pb']        = 'Création entrée impossible';
+$lang['ec_entry_already_exists']   = 'Entrée %s déjà existante';
+$lang['ec_DB_problem']             = 'Problème d\'accès à la base (n°%s) : ';
+
+// Entries table
+//   actions
+$lang['ec_ok']                     = 'OUI';
+$lang['ec_ok_ap_pb']               = 'OUI, mais Add. Page inconnue';
+$lang['ec_ok_cat_pb']              = 'OUI, mais catégorie inconnue';
+$lang['ec_ok_img_pb']              = 'OUI, mais image inconnue';
+$lang['ec_nok']                    = 'NON';
+$lang['ec_nok_ap_pb']              = 'NON';
+$lang['ec_nok_userid_miss']        = 'NON : utilisateur inconnu';
+$lang['ec_nok_action_pb']          = 'NON : "action" corrompu';
+$lang['ec_nok_userid_pb']          = 'NON : "user_id" corrompu';
+// Username can't be displayed
+$lang['ec_dspl_nok_actn']          = '"action" inutilisable';
+$lang['ec_dspl_usr_pb']            = '"user_id" inutilisable';
+$lang['ec_dspl_nok_usr']           = 'Utilisateur n°%s n\'existe pas';
+//   displayed pages
+$lang['ec_dspl_ok_cat']            = 'Catégorie n°%1$s : %2$s';
+                                 // %1$s : category id, %2$s : name
+$lang['ec_dspl_ok_img2']           = 'image n°%1$s : %2$s (%3$s)';
+                                 // %1$s : image id, %2$s : name, %3$s : filename
+$lang['ec_dspl_ok_ap']             = 'Additional Page n°%1$s : %2$s';
+                                 // %1$s : add. p. id, %2$s : name
+$lang['ec_dspl_nok_ap']            = ' (Additional Page n°%s n\'existe pas)';
+$lang['ec_dspl_nok_cat']           = ' (catégorie n°%s n\'existe pas)';
+$lang['ec_dspl_nok_img2']          = ' (image n°%1$s n\'existe pas dans catégorie n°%2$s)';
+                                 // %1$s : image id, %2$s : category id
+
+unset($t_ap1, $t_ap2);
 
 ?>
Index: /extensions/event_cats/main.inc.php
===================================================================
--- /extensions/event_cats/main.inc.php	(revision 4328)
+++ /extensions/event_cats/main.inc.php	(revision 4329)
@@ -38,13 +38,31 @@
 //ini_set('display_errors', true);
 
-global $conf, $prefixeTable, $ec_lists, $ec_debug,
-  $ec_ap_ok;   // whether Additional Pages is installed and activated
-
-define('EVNTCATS_INFO_VERSION','1.0.0');
-define('EVNTCATS_PATH',PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)). '/');
-define('EVNTCATS_TABLE', $prefixeTable.'event_cats');
-define('ROOT_URL',get_absolute_root_url());
-
-$ec_ap_ok = defined('AP_DIR');
+global $conf, $prefixeTable, $ec_lists;
+
+define( // -------------------------------------------------------------------
+  'EVNTCATS_INFO_VERSION', // VERSION HISTORY :
+   '1.0.0'   // Conception (non published) version
+); // ------------------------------------------------------------------------
+define(
+  'EVNTCATS_PATH',
+   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'
+);
+define(
+  'EVNTCATS_TABLE',
+   $prefixeTable.'event_cats'
+);
+define(
+  'ROOT_URL',
+   get_absolute_root_url()
+);
+define(
+  'EC_AP_OK', // whether Additional Pages is installed and activated
+   (mysql_num_rows(pwg_query("
+     SELECT *
+     FROM `".PLUGINS_TABLE."`
+     WHERE `id`    = 'AdditionalPages'
+       AND `state` = 'active';
+   ")) != 0)
+);
 
 include_once(EVNTCATS_PATH.'include/evntcats_main_funcs.inc.php');
@@ -268,12 +286,22 @@
 
 function duplicate_account_url() {
-  global $lang, $template;
+  global $lang, $template, $user;
   
-  if (!is_admin() and !is_a_guest()) {
+  if (!is_admin() and !is_a_guest()) if (
+    read_ec_conf('dup_allow') == '1' or (
+      read_ec_conf('dup_allow') == '2' and
+      dup_allowed($user['id'])
+    )
+  ) {
     $template->assign( 'U_REGISTER', get_root_url().'register.php');
-    if (isset($lang['Duplicate account']))
-     $lang['Create a new account'] = l10n('Duplicate account');
-    if (isset($lang['Duplicate']))
-     $lang['Register'] = l10n('Duplicate');
+    if (
+      read_ec_conf('duplic_display') == '1' or (
+        read_ec_conf('duplic_display') == '2' and
+        !is_generic()
+      )
+    ) {
+      $lang['Register'] = l10n('Duplicate');
+      $lang['Create a new account'] = l10n('Create a new account with same properties');
+    }
   }
 }
