Index: extensions/event_cats/admin/autolog_new.inc.php
===================================================================
--- extensions/event_cats/admin/autolog_new.inc.php	(revision 4171)
+++ extensions/event_cats/admin/autolog_new.inc.php	(revision 4173)
@@ -110,5 +110,4 @@
 $template->assign('ec_ap_ok',               $ec_ap_ok);
 $template->assign('ec_lists',               $ec_lists);
-$template->assign('cat_display',            (read_ec_conf('cat_display') == '0'));
 $template->assign('ec_default_entry',       $ec_default_entry);
 $template->assign('ec_default_action',      $ec_default_action);
Index: extensions/event_cats/admin/template/autolog_new.js
===================================================================
--- extensions/event_cats/admin/template/autolog_new.js	(revision 4171)
+++ extensions/event_cats/admin/template/autolog_new.js	(revision 4173)
@@ -7,5 +7,4 @@
 var ec_flag1                    = false;
 var ec_flag2                    = false;
-var cat_display                 = false;
 var ec_dont_check               = false;
 var ec_selected_old_group       = false;
@@ -445,8 +444,8 @@
             d.ec_new_code.ec_in_up_cat.selectedIndex
            ].label;
-          if (cat_display) ec_new_user_text =
+          /* 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];
+          else */ 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, 32);
Index: extensions/event_cats/admin/template/autolog_new.tpl
===================================================================
--- extensions/event_cats/admin/template/autolog_new.tpl	(revision 4171)
+++ extensions/event_cats/admin/template/autolog_new.tpl	(revision 4173)
@@ -267,5 +267,4 @@
 <script type = "text/javascript"><!--
   ec_is_creation                          = {if $ec_is_creation}true{else}false{/if};
-  cat_display                             = {if $cat_display}true{else}false{/if};
   ec_up_code_lbl_forced_txt               = "{'ec_up_code_lbl_forced'|@translate}";
   ec_JS_message['ec_gen_user_act_miss']   = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
Index: extensions/event_cats/include/ec_conf.inc.php
===================================================================
--- extensions/event_cats/include/ec_conf.inc.php	(revision 4171)
+++ extensions/event_cats/include/ec_conf.inc.php	(revision 4173)
@@ -33,7 +33,7 @@
  _ the number of digits when creating a new code automatically
    ($ec_conf[2] <=> read_ec_conf('auto_code_dg_nb')) ;
- _ whether categories are displayed "cat / under_cat / ..." or
-   "cat <CR LF> - under_cat <CR LF> - ..." ($ec_conf[3] <=>
-   read_ec_conf('cat_display')) ;
+ _ -----------------------------------------------------------
+   --------------------------------------- ( $ec_conf[3] <=>
+   read_ec_conf('') ) ;
  _ whether the "how to" banner has already been displayed or not
    ($ec_conf[4] <=> read_ec_conf('howto')) ;
@@ -47,5 +47,5 @@
 *****************************************************************************/
 
-global $ec_conf;
+global $ec_conf, $page;
 
 // $ec_conf initalization / check
@@ -54,10 +54,9 @@
  FROM `".CONFIG_TABLE."`
  WHERE `param` = 'event_cats';
-"))) {
-  $ec_conf = explode(',' , $t[0]);
-}
+"))) $ec_conf = explode(',' , $t[0]);
 else {
   $ec_conf = explode(',' , '0,1,10,0,0,0,0');
-  change_ec_conf('activated', 0);
+  if (!change_ec_conf('activated', 0))
+   $page['errors'][] = 'Error updating $ec_conf';
 }
 
@@ -74,5 +73,5 @@
  */
 function change_ec_conf($c, $v) {
-  global $ec_conf;
+  global $ec_conf, $page;
   switch ($c) {
     case 'activated':
@@ -84,8 +83,8 @@
     case 'auto_code_dg_nb':
       $ec_conf[2] = $v;
-    break;
+    break;                  /*
     case 'cat_display':
       $ec_conf[3] = $v;
-    break;
+    break;                  */
     case 'howto':
       $ec_conf[4] = $v;
@@ -97,11 +96,13 @@
       $ec_conf[6] = $v;
     break;
-    default: return false;
+    default:
+      $page['errors'][] = 'Bad change_ec_conf argument';
+    return false;
   }
-  return pwg_query("
+  return (pwg_query("
    UPDATE `".CONFIG_TABLE."`
    SET `value` = '".implode(',', $ec_conf)."'
    WHERE `param` = 'event_cats';
-  ");
+  ") !== false);
 }
 
@@ -116,14 +117,16 @@
  */
 function read_ec_conf($c) {
-  global $ec_conf;
+  global $ec_conf, $page;
   switch ($c) {
     case 'activated'         : return $ec_conf[0];
     case 'dup_allow'         : return $ec_conf[1];
-    case 'auto_code_dg_nb'   : return $ec_conf[2];
-    case 'cat_display'       : return $ec_conf[3];
+    case 'auto_code_dg_nb'   : return $ec_conf[2]; /*
+    case 'cat_display'       : return $ec_conf[3]; */
     case 'howto'             : return $ec_conf[4];
     case 'unknown_code'      : return $ec_conf[5];
     case 'unknown_code_ap_id': return $ec_conf[6];
-    default                  : return false;
+    default:
+      $page['errors'][] = 'Bad read_ec_conf argument';
+    return false;
   }
 }
Index: extensions/event_cats/include/evntcats_admin_funcs.inc.php
===================================================================
--- extensions/event_cats/include/evntcats_admin_funcs.inc.php	(revision 4171)
+++ extensions/event_cats/include/evntcats_admin_funcs.inc.php	(revision 4173)
@@ -92,5 +92,5 @@
  */
 function build_ec_duplicable_codes() {
-  global $ec_lists;
+  global $ec_lists, $template;
   $ec_lists['duplicable_codes'] = array();
   $t                            = array();
@@ -111,4 +111,7 @@
      $ec_lists['duplicable_codes']['codes'][$ec_code]['id'];
   }
+  
+  // Builds a category list displayed a best way
+  build_ec_categories(false);
 }
 
@@ -148,34 +151,90 @@
 )
 
+(
+    [ec_act1] => create
+    [ec_entry_sel] => -1
+    [ec_sel_code] => new
+    [ec_in_up_auto_code_length] => 10
+    [ec_in_up_code] => NU1pah0qVJ
+    [ec_in_up_usr_txt] => 
+    [ec_in_up_psd_txt] => 
+    [ec_in_up_grp_txt] => 
+    [ec_sel_user] => old
+    [ec_in_up_usr_list] => 9
+    [ec_input_action] => cat
+    [ec_in_up_cat] => 6
+    [ec_in_up_img] => 
+)
+
 */
-  /* foreach ($ec_lists['ec_table'] as $ec_entry) {
-    if ($_POST['ec_in_up_code'] == $ec_entry['code'])
-      return ec_end1('ec_in_up_code', 'ec_bad_argument2');
-  }
-  if ($t1 = (in_array($_POST['ec_in_up_usr_txt'], $ec_lists['user_ids'])))
-   $ec_user_id = $_POST['ec_in_up_usr_txt'];
+  // $_POST validity checks : creation prevented in case of bad arguments
+  /* if (
+    !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');
+  
+  foreach ($ec_lists['ec_table'] as $ec_entry)
+   if ($_POST['ec_in_up_code'] == $ec_entry['code'])
+    return ec_end1('ec_in_up_code', 'ec_bad_argument2');
+  
+  if (
+    !isset($_POST['ec_sel_user']) or (
+      $_POST['ec_sel_user'] != 'new' and
+      $_POST['ec_sel_user'] != 'old'
+    )
+  ) return ec_end1('ec_sel_user', 'ec_bad_argument1');
+  
   if ($_POST['ec_sel_user'] == 'new') {
+    if (
+      !isset($_POST['ec_in_up_usr_txt']) or
+      $_POST['ec_in_up_usr_txt'] == ''
+    ) return ec_end1('ec_in_up_usr_txt', 'ec_bad_argument1');
+    $t1 = (in_array($_POST['ec_in_up_usr_txt'], $ec_lists['user_ids']));
     if ($t1) return ec_end1('ec_in_up_usr_txt', 'ec_bad_argument3');
-    else { // New user account creation
-      $page['errors'] = register_user(
-       $_POST['ec_in_up_usr_txt'], $_POST['ec_in_up_psd_txt'], '', false
-      );
+  }
+  else {
+    if (!isset($_POST['ec_in_up_usr_list']))
+     return ec_end1('ec_in_up_usr_txt', 'ec_bad_argument1');
+    $ec_user_id = $_POST['ec_in_up_usr_list'];
+    $t1 = (array_key_exists($ec_user_id, $ec_lists['user_ids']));
+    if (!$t1) return ec_end1('ec_in_up_usr_list', 'ec_bad_argument6');
+  }
+  
+  // code and user_id (if needed) are OK, creation can be done
+  if ($_POST['ec_sel_user'] == 'new') {
+    $page['errors'] = register_user(
+     $_POST['ec_in_up_usr_txt'], $_POST['ec_in_up_psd_txt'], '', false
+    );
+    if (
+      count($page['errors']) != 0 or
+      !($ec_user_id = get_userid($_POST['ec_in_up_usr_txt'])) or
+      !pwg_query("
+        UPDATE `".USER_INFOS_TABLE."`
+        SET `status` = 'generic'
+        WHERE `user_id` = ".$ec_user_id.";
+      ")
+    ) {
+      array_unshift($page['errors'], l10n('ec_user_create_pb'));
+      return false;
+    }
+    else $page['infos'][] = l10n('ec_user_create_OK').$ec_user_id;
+    if (
+      isset($_POST['ec_in_up_newgroup']) and
+      isset($_POST['ec_in_up_grp_txt']) and
+      $_POST['ec_in_up_grp_txt'] != ''
+    ) { // New group creation, and association with user_id at the same time
       if (
-        count($page['errors']) != 0 or
-        !($ec_user_id = get_userid($_POST['ec_in_up_usr_txt'])) or
-        !pwg_query("
-          UPDATE `".USER_INFOS_TABLE."`
-          SET `status` = 'generic'
-          WHERE `user_id` = ".$ec_user_id.";
-        ")
+        !($t = mysql_fetch_row(pwg_query("
+          SELECT `id`
+          FROM `".GROUPS_TABLE."`
+          WHERE `name` = '".$_POST['ec_in_up_grp_txt']."';
+        ")))
       ) {
-        array_unshift($page['errors'], l10n('ec_user_create_pb'));
-        return false;
-      }
-      if (
-        isset($_POST['ec_in_up_newgroup']) and
-        isset($_POST['ec_in_up_grp_txt']) and
-        $_POST['ec_in_up_grp_txt'] != ''
-      ) { // New group creation, and association with user_id at the same time
+        if (
+          !pwg_query("
+            INSERT INTO `".GROUPS_TABLE."` (`name`, `is_default`)
+            VALUES ('".$_POST['ec_in_up_grp_txt']."', 'false');
+          ")
+        ) return ec_end2('ec_group_create_pb', '1');
         if (
           !($t = mysql_fetch_row(pwg_query("
@@ -184,42 +243,28 @@
             WHERE `name` = '".$_POST['ec_in_up_grp_txt']."';
           ")))
-        ) {
-          if (
-            !pwg_query("
-              INSERT INTO `".GROUPS_TABLE."` (`name`, `is_default`)
-              VALUES ('".$_POST['ec_in_up_grp_txt']."', 'false');
-            ")
-          ) return ec_end2('ec_group_create_pb', '1');
-          if (
-            !($t = mysql_fetch_row(pwg_query("
-              SELECT `id`
-              FROM `".GROUPS_TABLE."`
-              WHERE `name` = '".$_POST['ec_in_up_grp_txt']."';
-            ")))
-          ) return ec_end2('ec_group_create_pb', '2');
-        }
-        if (
-          !(pwg_query("
-            INSERT INTO `".USER_GROUP_TABLE."` (`user_id `, `group_id`)
-            VALUES ('".$ec_user_id."', '".$t['id']."');
-          "))
-        ) return ec_end2('ec_group_create_pb', '3');
+        ) return ec_end2('ec_group_create_pb', '2');
       }
+      if (
+        !(pwg_query("
+          INSERT INTO `".USER_GROUP_TABLE."` (`user_id `, `group_id`)
+          VALUES ('".$ec_user_id."', '".$t['id']."');
+        "))
+      ) return ec_end2('ec_group_create_pb', '3');
     }
   }
   else {
     if ($t1) {
-      if (ereg('^[a-zA-Z0-9_-]{4,32}$',$_POST['ec_in_up_code'])) {
-        $arg1 = ''; $arg2 = '';
-        switch ($_POST['ec_input_action']) {
-          // case 'home':  // Home : nothing to do : "arg"s are ''
-          case 'add_p': // Additional Page
-          break;
-          case 'cat':   // Category
-          case 'img':   // Image
-          break;
-          default : return ec_end1('ec_input_action', 'ec_bad_argument1');
-        }
+      
+      $arg1 = ''; $arg2 = '';
+      switch ($_POST['ec_input_action']) {
+        // case 'home':  // Home : nothing to do : "arg"s are ''
+        case 'add_p': // Additional Page
+        break;
+        case 'cat':   // Category
+        case 'img':   // Image
+        break;
+        default : return ec_end1('ec_input_action', 'ec_bad_argument1');
       }
+      
       else return ec_end1('ec_in_up_code', 'ec_bad_argument7');
     }
Index: extensions/event_cats/include/evntcats_main_funcs.inc.php
===================================================================
--- extensions/event_cats/include/evntcats_main_funcs.inc.php	(revision 4171)
+++ extensions/event_cats/include/evntcats_main_funcs.inc.php	(revision 4173)
@@ -162,4 +162,24 @@
 
 /*
+ * build_ec_categories($dsp)
+ * builds $ec_lists['categories'].
+ *
+ * @param
+ *   whether $ec_lists['categories'] must be of type "cat / sub-cat" or
+ *   or "cat <CR LF> - sub-cat".
+ * @return
+ *   (no return value)
+ */
+function build_ec_categories($dsp) {
+  global $template, $ec_lists;
+  $c = array();
+  display_select_cat_wrapper('
+     SELECT id,name,uppercats,global_rank
+     FROM '.CATEGORIES_TABLE,
+   $c, 'category_options', $dsp);
+  $ec_lists['categories'] = $template->smarty->_tpl_vars['category_options'];
+}
+
+/*
  * build_ec_table()
  * builds a table showing the content of the <pwg>_event_cats database table,
@@ -326,10 +346,5 @@
   
   // Construction of $ec_lists['categories'] array var
-  $c = array();
-  display_select_cat_wrapper('
-     SELECT id,name,uppercats,global_rank
-     FROM '.CATEGORIES_TABLE,
-   $c, 'category_options', (read_ec_conf('cat_display') == '0'));
-  $ec_lists['categories'] = $template->smarty->_tpl_vars['category_options'];
+  build_ec_categories(true);
   
   // Construction of $ec_lists['user_ids'] array var
Index: extensions/event_cats/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/event_cats/language/fr_FR/plugin.lang.php	(revision 4171)
+++ extensions/event_cats/language/fr_FR/plugin.lang.php	(revision 4173)
@@ -113,4 +113,5 @@
 $lang['ec_entry_dis_nok_end3']    = ' (arg1 = NULL)';
 $lang['ec_user_create_pb']        = 'Création nouvel utilisateur impossible';
+$lang['ec_user_create_OK']        = 'Création utilisateur ';
 $lang['ec_group_create_pb']       = 'Création nouveau groupe impossible : ';
 $lang['ec_bad_argument1']         = 'Mauvais argument : ';
