Index: extensions/event_cats/main.inc.php
===================================================================
--- extensions/event_cats/main.inc.php	(revision 7066)
+++ extensions/event_cats/main.inc.php	(revision 7084)
@@ -32,5 +32,5 @@
 // +-----------------------------------------------------------------------+
 
-// Keeps file coded in UTF-8 without BOM : é
+// Keeps file coded in UTF-8 without BOM: é
 
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
@@ -43,5 +43,5 @@
 
 define( // -------------------------------------------------------------------
-  'EVNTCATS_INFO_VERSION', // VERSION HISTORY :
+  'EVNTCATS_INFO_VERSION', // VERSION HISTORY:
    '1.2.3' // Re-fix bug 1432 :-/ ...
 // '2.1.0' // When done, will simplfy and allow EC management from categories
@@ -50,14 +50,14 @@
 // '1.2.1' // Improve EN translation thanks to Tosca
 // '1.2.0' // Add feature 1335, Possibility to display the 'Connection'
-//         // link in identification block menu for generic users ;
+//         // link in identification block menu for generic users;
 //         // finish (yes !) english translation
 // '1.1.5' // Fix bugs 1324 and 1325
 // '1.1.4' // Improve help banner
-// '1.1.3' // Better help banner management ; finalize banner texts
-// '1.1.2' // Better help banner example : some examples
-// '1.1.1' // Better help banner example ; but still no text in it
-// '1.1.0' // First bugs (1305 and 1306) corrected ;
+// '1.1.3' // Better help banner management; finalize banner texts
+// '1.1.2' // Better help banner example: some examples
+// '1.1.1' // Better help banner example; but still no text in it
+// '1.1.0' // First bugs (1305 and 1306) corrected;
            // add newly created user/group association with cat/AP (was
-           // forgotten) ; begin help banner
+           // forgotten); begin help banner
 // '1.0.0' // Conception version
 ); // ------------------------------------------------------------------------
@@ -103,5 +103,5 @@
   return (
    $help_content = (is_admin() and $page == 'help') ?
-    load_language($page.'.html', EVNTCATS_PATH, array('return' => true)) : false
+    load_language($page.'.html',EVNTCATS_PATH,array('return' => true)) : false
   ) ? $popup_help_content.$help_content : $popup_help_content;
 }
@@ -112,6 +112,6 @@
  *
  * auto_log_user()
- * the function uses the value of the argument "autolog" of the posted URL, as a code
- * to know which username has to be logged in.
+ * the function uses the value of the argument "autolog" of the posted URL,
+ * as a code to know which username has to be logged in.
  *
  * @param no parameter
@@ -128,5 +128,5 @@
   $ec_img = NULL;
   
-  if (isset($_GET['autolog']) and (read_ec_conf('activated') == 1)) {
+  if (isset($_GET['autolog']) and (read_ec_conf('activated') == '1')) {
     if (!is_a_guest()) {
       $url = '';
@@ -166,5 +166,5 @@
             if (isset($ec_img)) {
               if (ec_image_exists($ec_cat, $ec_img)) {
-                redirect(PHPWG_ROOT_PATH.'picture.php?/'.$ec_img.'/category/'.$ec_cat);
+       redirect(PHPWG_ROOT_PATH.'picture.php?/'.$ec_img.'/category/'.$ec_cat);
               }
             }
@@ -230,52 +230,60 @@
   global $user;
 
-  if (!is_a_guest() and !is_admin()) if (
-    read_ec_conf('dup_allow') == '1' or (
-      read_ec_conf('dup_allow') == '2' and
-      dup_allowed($user['id'])
-    )
-  ) {
-    // User access
-    $result = pwg_query("
-      SELECT `cat_id`
-      FROM `".USER_ACCESS_TABLE."`
-      WHERE `user_id` = ".$user['id'].";
-    ");
-    $insert = array();
-    while ($row = pwg_db_fetch_assoc($result))
-     $insert[] = "(".$new_user['id'].",".$row['cat_id'].")";
-    if (!empty($insert)) pwg_query("
-      INSERT INTO `".USER_ACCESS_TABLE."`
-      VALUES ".implode(',', $insert).";
-    ");
-
-    // User groups
-    $result = pwg_query("
-      SELECT `group_id`
-      FROM `".USER_GROUP_TABLE."`
-      WHERE `user_id` = ".$user['id'].";
-    ");
-    $insert = array();
-    while ($row = pwg_db_fetch_assoc($result))
-     $insert[] = "(".$new_user['id'].",".$row['group_id'].")";
-    if (!empty($insert)) pwg_query("
-      INSERT INTO `".USER_GROUP_TABLE."`
-      VALUES ".implode(',', $insert).";
-    ");
-
-    // User infos
-    $result = pwg_query("
-      SELECT `level`
-      FROM `".USER_INFOS_TABLE."`
-      WHERE `user_id` = ".$user['id'].";
-    ");
-    $insert = array();
-    while ($row = pwg_db_fetch_assoc($result))
-     $insert[] = "(".$new_user['id'].",".$row['level'].")";
-    if (!empty($insert)) pwg_query("
-      UPDATE `".USER_INFOS_TABLE."`
-      SET `level` = ".$user['level']."
-      WHERE `user_id` = ".$new_user['id'].";
-    ");
+  if (read_ec_conf('activated') == '1') {
+    if (
+      !is_a_guest() and !is_admin() and (
+        read_ec_conf('dup_allow') == '1' or (
+          read_ec_conf('dup_allow') == '2' and (
+            dup_allowed($user['id']) or (
+              read_ec_conf('simple_mode_on') == '1' and
+              is_generic()
+            )
+          )
+        )
+      )
+    ) {
+      // User access
+      $result = pwg_query("
+        SELECT `cat_id`
+        FROM `".USER_ACCESS_TABLE."`
+        WHERE `user_id` = ".$user['id'].";
+      ");
+      $insert = array();
+      while ($row = pwg_db_fetch_assoc($result))
+       $insert[] = "(".$new_user['id'].",".$row['cat_id'].")";
+      if (!empty($insert)) pwg_query("
+        INSERT INTO `".USER_ACCESS_TABLE."`
+        VALUES ".implode(',', $insert).";
+      ");
+
+      // User groups
+      $result = pwg_query("
+        SELECT `group_id`
+        FROM `".USER_GROUP_TABLE."`
+        WHERE `user_id` = ".$user['id'].";
+      ");
+      $insert = array();
+      while ($row = pwg_db_fetch_assoc($result))
+       $insert[] = "(".$new_user['id'].",".$row['group_id'].")";
+      if (!empty($insert)) pwg_query("
+        INSERT INTO `".USER_GROUP_TABLE."`
+        VALUES ".implode(',', $insert).";
+      ");
+
+      // User infos
+      $result = pwg_query("
+        SELECT `level`
+        FROM `".USER_INFOS_TABLE."`
+        WHERE `user_id` = ".$user['id'].";
+      ");
+      $insert = array();
+      while ($row = pwg_db_fetch_assoc($result))
+       $insert[] = "(".$new_user['id'].",".$row['level'].")";
+      if (!empty($insert)) pwg_query("
+        UPDATE `".USER_INFOS_TABLE."`
+        SET `level` = ".$user['level']."
+        WHERE `user_id` = ".$new_user['id'].";
+      ");
+    }
   }
 }
@@ -313,38 +321,46 @@
   global $lang, $template, $user;
   
-  if (version_compare(PHPWG_VERSION, '2.1.0', '<')) {
-    // Makes the "quick connect" fieldset able to redirect to current page
-    // after user identification, just as does the "connection" link.
-    $template->assign(array('U_REDIRECT' => $_SERVER['REQUEST_URI']));
-    $template->set_prefilter('menubar', 'ec_duplicate_prefilter');
-  }
-  
-  // Adds duplication link, if needed
-  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 (read_ec_conf('activated') == '1') {
+    if (version_compare(PHPWG_VERSION, '2.1.0', '<')) {
+      // Makes the "quick connect" fieldset able to redirect to current page
+      // after user identification, just as does the "connection" link.
+      $template->assign(array('U_REDIRECT' => $_SERVER['REQUEST_URI']));
+      $template->set_prefilter('menubar', 'ec_duplicate_prefilter');
+    }
+    
+    // Add duplication link, if needed
     if (
-      read_ec_conf('duplic_display') == '1' or (
-        read_ec_conf('duplic_display') == '2' and
-        !is_generic()
+      !is_admin() and !is_a_guest() and (
+        read_ec_conf('dup_allow') == '1' or (
+          read_ec_conf('dup_allow') == '2' and (
+            dup_allowed($user['id']) or (
+              read_ec_conf('simple_mode_on') == '1' and
+              is_generic()
+            )
+          )
+        )
       )
     ) {
-      $lang['Register'] = $lang['Duplicate'];
-      $lang['Create a new account'] =
-       $lang['Create a new account with same properties'];
-    }
-  }
-  
-  // Adds connection link, if needed
-  if (read_ec_conf('display_connection') == '1' and is_generic()) {
-    // Adds connection link
-    $template->assign(
-      'U_LOGIN',
-      get_root_url().'identification.php?redirect='.$_SERVER['REQUEST_URI']
-    );
+      $template->assign('U_REGISTER', get_root_url().'register.php');
+      if (
+        read_ec_conf('duplic_display') == '1' or (
+          read_ec_conf('duplic_display') == '2' and
+          !is_generic()
+        )
+      ) {
+        $lang['Register'] = $lang['Duplicate'];
+        $lang['Create a new account'] =
+         $lang['Create a new account with same properties'];
+      }
+    }
+    
+    // Adds connection link, if needed
+    if (read_ec_conf('display_connection') == '1' and is_generic()) {
+      // Adds connection link
+      $template->assign(
+        'U_LOGIN',
+        get_root_url().'identification.php?redirect='.$_SERVER['REQUEST_URI']
+      );
+    }
   }
 }
