Index: /extensions/event_cats/admin/duplication.inc.php
===================================================================
--- /extensions/event_cats/admin/duplication.inc.php	(revision 4246)
+++ /extensions/event_cats/admin/duplication.inc.php	(revision 4247)
@@ -8,3 +8,142 @@
 $template->assign('ec_conf', $ec_conf);
 
+
+
+
+
+
+// A lot of below code has simply been copied-pasted from file cat_perm.php .
+// Many thanks to people who wrote it !
+
+// +-----------------------------------------------------------------------+
+// |                          form construction                            |
+// +-----------------------------------------------------------------------+
+
+// groups denied are the groups not granted. So we need to find all groups
+// minus groups granted to find groups denied.
+
+$groups = array();
+
+$query = '
+SELECT id, name
+  FROM '.GROUPS_TABLE.'
+  ORDER BY name ASC
+;';
+$groups = simple_hash_from_query($query, 'id', 'name');
+$template->assign('all_groups', $groups);
+
+// groups granted to access the category
+$query = "
+SELECT `arg1`
+  FROM ".EVNTCATS_TABLE."
+  WHERE `code` IS NULL
+    AND `arg1` IS NOT NULL
+;";
+$group_granted_ids = array_from_query($query, 'arg1');
+$group_granted_ids = order_by_name($group_granted_ids, $groups);
+$template->assign('group_granted_ids', $group_granted_ids);
+
+
+// groups denied
+$template->assign('group_denied_ids',
+    order_by_name(array_diff(array_keys($groups), $group_granted_ids), $groups)
+  );
+
+// users...
+$users = array();
+
+$query = "
+SELECT ".$conf['user_fields']['id']." AS id,
+       ".$conf['user_fields']['username']." AS username
+  FROM ".USERS_TABLE."
+;";
+$users = simple_hash_from_query($query, 'id', 'username');
+$template->assign('all_users', $users);
+
+
+$query = "
+SELECT `arg2`
+  FROM ".EVNTCATS_TABLE."
+  WHERE `code` IS NULL
+    AND `arg2` IS NOT NULL
+;";
+$user_granted_direct_ids = array_from_query($query, 'arg2');
+$user_granted_direct_ids = order_by_name($user_granted_direct_ids, $users);
+$template->assign('user_granted_direct_ids', $user_granted_direct_ids);
+
+
+
+$user_granted_indirect_ids = array();
+if (count($group_granted_ids) > 0)
+{
+  $granted_groups = array();
+
+  $query = "
+SELECT user_id, group_id
+  FROM ".USER_GROUP_TABLE."
+  WHERE group_id IN (".implode(',', $group_granted_ids).") 
+";
+  $result = pwg_query($query);
+  while ($row = mysql_fetch_array($result))
+  {
+    if (!isset($granted_groups[$row['group_id']]))
+    {
+      $granted_groups[$row['group_id']] = array();
+    }
+    array_push($granted_groups[$row['group_id']], $row['user_id']);
+  }
+
+  $user_granted_by_group_ids = array();
+
+  foreach ($granted_groups as $group_users)
+  {
+    $user_granted_by_group_ids = array_merge($user_granted_by_group_ids,
+                                             $group_users);
+  }
+  $user_granted_by_group_ids = array_unique($user_granted_by_group_ids);
+  
+  
+  $user_granted_indirect_ids = array_diff($user_granted_by_group_ids,
+                                          $user_granted_direct_ids);
+  $user_granted_indirect_ids = 
+    order_by_name($user_granted_indirect_ids, $users);  
+  foreach ($user_granted_indirect_ids as $user_id)
+  {
+    foreach ($granted_groups as $group_id => $group_users)
+    {
+      if (in_array($user_id, $group_users))
+      {
+        $template->append(
+          'user_granted_indirects',
+          array(
+            'USER'=>$users[$user_id],
+            'GROUP'=>$groups[$group_id]
+            )
+          );
+        break;
+      }
+    }
+  }
+}
+
+$user_denied_ids = array_diff(array_keys($users),
+                              $user_granted_indirect_ids,
+                              $user_granted_direct_ids);
+$user_denied_ids = order_by_name($user_denied_ids, $users);
+$template->assign('user_denied_ids', $user_denied_ids);
+
+
+
+
+
+
+
+
+
+
+
+
+/* */
+
+
 ?>
Index: /extensions/event_cats/admin/evntcats_admin.php
===================================================================
--- /extensions/event_cats/admin/evntcats_admin.php	(revision 4246)
+++ /extensions/event_cats/admin/evntcats_admin.php	(revision 4247)
@@ -55,4 +55,5 @@
 
 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+include_once(PHPWG_ROOT_PATH.'include/functions.inc.php');
 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
 include_once(PHPWG_ROOT_PATH.'include/functions_url.inc.php');
Index: /extensions/event_cats/admin/template/duplication.tpl
===================================================================
--- /extensions/event_cats/admin/template/duplication.tpl	(revision 4246)
+++ /extensions/event_cats/admin/template/duplication.tpl	(revision 4247)
@@ -4,8 +4,13 @@
 
 {* <!-- Available soon... --> *}
-
 <p>Bientôt disponible :-] !</p>
 
-<form class = "titrePage">
+<!-- Aknowledgement ------------------------------------------------------
+A lot of below code has simply been copied-pasted from file cat_perm.tpl .
+Many thanks to people who wrote it !
+------------------------------------------------------------------------->
+
+{* <!-- Duplication configuration parameters --> *}
+<form class = "titrePage" name = "ec_duplic_conf">
   <fieldset>
     <legend>{'ec_duplication_config'|@translate}</legend>
@@ -49,7 +54,6 @@
 </form>
 
-{*
-
-<form action = "{$F_ACTION}" method = "post" id = "categoryPermissions">
+{* <!-- Duplication settings by groups / user ids --> *}
+<form action = "" method = "post" name = "ec_duplic_set" id="categoryPermissions">
 
   <h4>{'Groups'|@translate}</h4>
@@ -62,5 +66,5 @@
       {/foreach}
     </ul>
-    <input class = "submit" type = "submit" name = "deny_groups_submit" value = "{'Deny selected groups'|@translate}" {$TAG_INPUT_ENABLED}/>
+    <input class = "submit" type = "submit" name = "deny_groups_submit" value = "{'Deny selected groups'|@translate}" />
   </fieldset>
 
@@ -72,5 +76,5 @@
       {/foreach}
     </ul>
-    <input class = "submit" type = "submit" name = "grant_groups_submit" value = "{'Grant selected groups'|@translate}" {$TAG_INPUT_ENABLED}/>
+    <input class = "submit" type = "submit" name = "grant_groups_submit" value = "{'Grant selected groups'|@translate}" />
   </fieldset>
 
@@ -84,5 +88,5 @@
       {/foreach}
     </ul>
-    <input class = "submit" type = "submit" name = "deny_users_submit" value = "{'Deny selected users'|@translate}" {$TAG_INPUT_ENABLED}/>
+    <input class = "submit" type = "submit" name = "deny_users_submit" value = "{'Deny selected users'|@translate}" />
   </fieldset>
 
@@ -105,11 +109,9 @@
       {/foreach}
     </ul>
-    <input class = "submit" type = "submit" name = "grant_users_submit" value = "{'Grant selected users'|@translate}" {$TAG_INPUT_ENABLED}/>
+    <input class = "submit" type = "submit" name = "grant_users_submit" value = "{'Grant selected users'|@translate}" />
   </fieldset>
 
 </form>
 
-
-*}
 
 
Index: /extensions/event_cats/admin/template/header.inc.tpl
===================================================================
--- /extensions/event_cats/admin/template/header.inc.tpl	(revision 4246)
+++ /extensions/event_cats/admin/template/header.inc.tpl	(revision 4247)
@@ -24,5 +24,3 @@
     <hr width = 75% size = 3 />
   </p>
-{* {else}
-  <br> *}
 {/if}
Index: /extensions/event_cats/include/evntcats_main_funcs.inc.php
===================================================================
--- /extensions/event_cats/include/evntcats_main_funcs.inc.php	(revision 4246)
+++ /extensions/event_cats/include/evntcats_main_funcs.inc.php	(revision 4247)
@@ -274,5 +274,5 @@
 function build_ec_lists() {
   
-  global $ec_ap_ok, $template, $ec_lists;
+  global $ec_ap_ok, $template, $ec_lists, $conf;
   
   $ec_lists = array();
@@ -295,7 +295,9 @@
   $ec_lists['user_ids'] = array();
   $q = pwg_query("
-    SELECT `id`,`username`
+    SELECT
+      ".$conf['user_fields']['id']." AS id,
+      ".$conf['user_fields']['username']." AS username
     FROM `".USERS_TABLE."`
-    WHERE `id` > 2
+    WHERE id > 2
   ");
   while ($r = mysql_fetch_assoc($q))
Index: /extensions/event_cats/main.inc.php
===================================================================
--- /extensions/event_cats/main.inc.php	(revision 4246)
+++ /extensions/event_cats/main.inc.php	(revision 4247)
@@ -100,4 +100,8 @@
   $ec_img = NULL;
 
+  // For compatibility ; must be removed
+  if (isset($_GET['log'])) $_GET['autolog'] = $_GET['log'];
+  // For compatibility ; must be removed
+  
   if (isset($_GET['autolog']) and (read_ec_conf('activated') == 1)) {
     if (!is_a_guest()) {
