Index: /extensions/Register_FluxBB/trunk/admin/admin.php
===================================================================
--- /extensions/Register_FluxBB/trunk/admin/admin.php	(revision 6814)
+++ /extensions/Register_FluxBB/trunk/admin/admin.php	(revision 6815)
@@ -572,7 +572,7 @@
 	case 'manage':
   
-  if ( isset($_POST['submit']) and !is_adviser() and isset($_POST['FluxBB_prefix']) and isset($_POST['FluxBB_admin']) and isset($_POST['FluxBB_guest']) and isset($_POST['FluxBB_del_pt']) and isset($_POST['FluxBB_confirm']) and isset($_POST['FluxBB_details']) )
-  {
-    $conf['Register_FluxBB'] = $_POST['FluxBB_prefix'].';'.addslashes($_POST['FluxBB_admin']).';'.addslashes($_POST['FluxBB_guest']).';'.$_POST['FluxBB_del_pt'].';'.$_POST['FluxBB_confirm'].';'.$_POST['FluxBB_details'];
+  if (isset($_POST['submit']) and !is_adviser() and isset($_POST['FluxBB_prefix']) and isset($_POST['FluxBB_admin']) and isset($_POST['FluxBB_guest']) and isset($_POST['FluxBB_del_pt']) and isset($_POST['FluxBB_confirm']) and isset($_POST['FluxBB_details']))
+  {
+    $conf['Register_FluxBB'] = $_POST['FluxBB_prefix'].';'.addslashes($_POST['FluxBB_admin']).';'.addslashes($_POST['FluxBB_guest']).';'.$_POST['FluxBB_del_pt'].';'.$_POST['FluxBB_confirm'].';'.$_POST['FluxBB_details'].';'.$_POST['FluxBB_UAM'].';'.$_POST['FluxBB_group'];
 
     $query = '
@@ -598,10 +598,32 @@
       'FluxBB_ADMIN'         => stripslashes($conf_Register_FluxBB[1]),
       'FluxBB_GUEST'         => stripslashes($conf_Register_FluxBB[2]),
-      'FluxBB_DEL_PT_TRUE'   => (isset($conf_Register_FluxBB[3]) and $conf_Register_FluxBB[3] == 'true') ? 'checked="checked"' : '' ,
-      'FluxBB_DEL_PT_FALSE'  => (isset($conf_Register_FluxBB[3]) and $conf_Register_FluxBB[3] == 'false') ? 'checked="checked"' : '' ,
-      'FluxBB_CONFIRM_TRUE'  => (isset($conf_Register_FluxBB[4]) and $conf_Register_FluxBB[4] == 'true') ? 'checked="checked"' : '' ,
-      'FluxBB_CONFIRM_FALSE' => (isset($conf_Register_FluxBB[4]) and $conf_Register_FluxBB[4] == 'false') ? 'checked="checked"' : '' ,
-      'FluxBB_DETAILS_TRUE'  => (isset($conf_Register_FluxBB[5]) and $conf_Register_FluxBB[5] == 'true') ? 'checked="checked"' : '' ,
-      'FluxBB_DETAILS_FALSE' => (isset($conf_Register_FluxBB[5]) and $conf_Register_FluxBB[5] == 'false') ? 'checked="checked"' : '' ,
+      'FluxBB_DEL_PT_TRUE'   => (isset($conf_Register_FluxBB[3]) and $conf_Register_FluxBB[3] == 'true') ? 'checked="checked"' : '',
+      'FluxBB_DEL_PT_FALSE'  => (isset($conf_Register_FluxBB[3]) and $conf_Register_FluxBB[3] == 'false') ? 'checked="checked"' : '',
+      'FluxBB_CONFIRM_TRUE'  => (isset($conf_Register_FluxBB[4]) and $conf_Register_FluxBB[4] == 'true') ? 'checked="checked"' : '',
+      'FluxBB_CONFIRM_FALSE' => (isset($conf_Register_FluxBB[4]) and $conf_Register_FluxBB[4] == 'false') ? 'checked="checked"' : '',
+      'FluxBB_DETAILS_TRUE'  => (isset($conf_Register_FluxBB[5]) and $conf_Register_FluxBB[5] == 'true') ? 'checked="checked"' : '',
+      'FluxBB_DETAILS_FALSE' => (isset($conf_Register_FluxBB[5]) and $conf_Register_FluxBB[5] == 'false') ? 'checked="checked"' : '',
+    )
+  );
+
+// If UAM exists and if UAM ConfirmMail is set, we can set this feature
+  if (function_exists('FindAvailableConfirmMailID'))
+  {  
+    $conf_UAM = unserialize($conf['UserAdvManager']);
+    $UAM_bridge = false;
+    
+    if (isset($conf_UAM[1]) and ($conf_UAM[1] == 'true' or $conf_UAM[1] == 'local') and isset($conf_UAM[2]) and $conf_UAM[2] != '-1')
+    {
+      $UAM_bridge = true;
+    }
+  }
+  
+  $template->assign(
+    array
+    (
+      'UAM_BRIDGE'            => $UAM_bridge,
+      'FluxBB_UAM_LINK_TRUE'  => (isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true') ? 'checked="checked"' : '',
+      'FluxBB_UAM_LINK_FALSE' => (isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'false') ? 'checked="checked"' : '',
+      'FluxBB_GROUP'          => $conf_Register_FluxBB[7],
     )
   );
Index: /extensions/Register_FluxBB/trunk/admin/template/manage.tpl
===================================================================
--- /extensions/Register_FluxBB/trunk/admin/template/manage.tpl	(revision 6814)
+++ /extensions/Register_FluxBB/trunk/admin/template/manage.tpl	(revision 6815)
@@ -1,3 +1,33 @@
 {html_head}<link rel="stylesheet" type="text/css" href="{$REGFLUXBB_PATH}admin/template/register_fluxbb.css">{/html_head}
+
+<script type="text/javascript">
+function blockToggleDisplay(headerId, contentId)
+{ldelim}
+  var revHeader = document.getElementById(headerId);
+  var revContent = document.getElementById(contentId);
+
+  if (revContent.style.display == 'none')
+  {ldelim}
+    revContent.style.display = 'block';
+    revHeader.className = 'instructionBlockHeaderExpanded';
+  {rdelim}
+  else
+  {ldelim}
+    revContent.style.display = 'none';
+    revHeader.className = 'instructionBlockHeaderCollapsed';
+  {rdelim}
+{rdelim}
+
+function rfbb_blockToggleDisplay( headerId, contentId )
+{ldelim}
+  if (typeof(headerId)=='string')
+  {ldelim}
+   if ( headerId.length>  1)
+       blockToggleDisplay(headerId, contentId) ;
+      document.getElementById("nb_para").value =headerId ;
+      document.getElementById("nb_para2").value =contentId;
+  {rdelim}
+{rdelim}
+</script>
 
 <div class="titrePage">
@@ -8,38 +38,69 @@
   <fieldset>
   	<legend>{'Config_Title'|@translate}</legend>
-    <div align="left">{'Config_Disclaimer'|@translate}</div>
+    {'Config_Disclaimer'|@translate}
+    <br><br>
     <ul>
     	<li><label>{'Prefix'|@translate}</label><br>
-    		<input type="text" name="FluxBB_prefix" size="20" style="text-align: center;" value={$FluxBB_PREFIX}><br>
+    		<input type="text" name="FluxBB_prefix" value={$FluxBB_PREFIX} size="20" style="text-align: center;"><br>
+      <br>
     	</li>
-      <br>
     	<li><label>{'Admin'|@translate}</label><br>
     		<input type="text" name="FluxBB_admin" value={$FluxBB_ADMIN} size="20" style="text-align: center;"><br>
     		{'User'|@translate}
+      <br>
     	</li>
-      <br>
     	<li><label>{'Guest'|@translate}</label><br>
     		<input type="text" name="FluxBB_guest" value={$FluxBB_GUEST} size="20" style="text-align: center;"><br>
+      <br>
     	</li>
-      <br>
     	<li><label>{'Del_Pt'|@translate}</label><br>
         <input type="radio" value="true" {$FluxBB_DEL_PT_TRUE} name="FluxBB_del_pt">{'Del_Pt_true'|@translate}<br>
         <input type="radio" value="false" {$FluxBB_DEL_PT_FALSE} name="FluxBB_del_pt">{'Del_Pt_false'|@translate}<br>
+      <br>
     	</li>
-      <br>
     	<li><label>{'Confirm'|@translate}</label><br>
         <input type="radio" value="true" {$FluxBB_CONFIRM_TRUE} name="FluxBB_confirm">{'Confirm_true'|@translate}<br>
         <input type="radio" value="false" {$FluxBB_CONFIRM_FALSE} name="FluxBB_confirm">{'Confirm_false'|@translate}<br>
+      <br>
     	</li>
-      <br>
     	<li><label>{'Details'|@translate}</label><br>
         <input type="radio" value="true" {$FluxBB_DETAILS_TRUE} name="FluxBB_details">{'Details_true'|@translate}<br>
         <input type="radio" value="false" {$FluxBB_DETAILS_FALSE} name="FluxBB_details">{'Details_false'|@translate}<br>
+      <br>
     	</li>
+      {if $UAM_BRIDGE}
+    	<li><label>{'Bridge_UAM'|@translate}</label><br>
+        <input type="radio" value="true" {$FluxBB_UAM_LINK_TRUE} name="FluxBB_UAM">{'Bridge_UAM_true'|@translate}<br>
+        <input type="radio" value="false" {$FluxBB_UAM_LINK_FALSE} name="FluxBB_UAM">{'Bridge_UAM_false'|@translate}<br>
+      <br>
+      </li>
+    	<li><label>{'FluxBB_Group'|@translate}</label><br>
+    		<input type="text" name="FluxBB_group" value={$FluxBB_GROUP} size="6" style="text-align: center;"><br>
+    	</li>
+      {/if}
     </ul>
-    <br>
-  	{'No_Reg_advise'|@translate}
     <br>
   	<div align="center"><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}></div>
   </fieldset>
+
+  <div id="instructionConfig1" class="instructionBlock" >
+    <div id="config1_header" class="instructionBlockHeaderCollapsed" onclick="rfbb_blockToggleDisplay('config1_header', 'Config1')">
+        {'About_Reg'|@translate}
+      </span>
+    </div>
+  
+    <div id="Config1" class="instructionBlockContent" style="display:none">
+      {'No_Reg_advise'|@translate}
+    </div>
+  </div>
+  <div id="instructionConfig2" class="instructionBlock" >
+    <div id="config2_header" class="instructionBlockHeaderCollapsed" onclick="rfbb_blockToggleDisplay('config2_header', 'Config2')">
+        {'About_Bridge'|@translate}
+      </span>
+    </div>
+  
+    <div id="Config2" class="instructionBlockContent" style="display:none">
+      {'UAM_Bridge_advice'|@translate}
+    </div>
+  </div>
 </form>
Index: /extensions/Register_FluxBB/trunk/admin/template/register_fluxbb.css
===================================================================
--- /extensions/Register_FluxBB/trunk/admin/template/register_fluxbb.css	(revision 6814)
+++ /extensions/Register_FluxBB/trunk/admin/template/register_fluxbb.css	(revision 6815)
@@ -47,2 +47,36 @@
   background-color: #ffd5dc;
 }
+
+/* Bloc expand-collapse instructions */
+.instructionBlockHeaderCollapsed, .instructionBlockHeaderExpanded
+{
+  background-color:#111;
+  background-position:15px center;
+  background-repeat:no-repeat;
+  color:#ff3363;
+  cursor:pointer;
+  font-size:110%;
+  overflow:hidden;
+  padding:8px 41px;
+  text-align: left;
+}
+
+.instructionBlockHeaderCollapsed span, .instructionBlockHeaderExpanded span
+{
+  border-bottom: none;
+}
+ 
+.instructionBlockHeaderCollapsed
+{
+  background-image: url(./icon/expand.gif);
+}
+
+.instructionBlockHeaderExpanded
+{
+  background-image: url(./icon/collapse.gif);
+}
+
+.instructionBlockContent
+{
+  padding:0 15px 15px;
+}
Index: /extensions/Register_FluxBB/trunk/include/functions.inc.php
===================================================================
--- /extensions/Register_FluxBB/trunk/include/functions.inc.php	(revision 6814)
+++ /extensions/Register_FluxBB/trunk/include/functions.inc.php	(revision 6815)
@@ -58,6 +58,13 @@
   $registred = time();
   $registred_ip = $_SERVER['REMOTE_ADDR'];
-
-  $query = "
+  
+  // Check if UAM is installed and if bridge is set - Exception for admins and webmasters
+  if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true')
+  {
+    $o_default_user_group = $conf_Register_FluxBB[7];
+  }
+  else
+  {
+    $query = "
 SELECT conf_value
 FROM ".FluxBB_CONFIG_TABLE."
@@ -65,5 +72,6 @@
 ;";
 
-  $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query));
+    $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query));
+  }
 
 // Check for FluxBB version 1.4.x and get the correct value
Index: /extensions/Register_FluxBB/trunk/language/de_DE/plugin.lang.php
===================================================================
--- /extensions/Register_FluxBB/trunk/language/de_DE/plugin.lang.php	(revision 6814)
+++ /extensions/Register_FluxBB/trunk/language/de_DE/plugin.lang.php	(revision 6815)
@@ -114,28 +114,46 @@
 $lang['Title_Tab'] = 'Register_FluxBB - Version: ';
 
-// --------- Starting below: New or revised $lang ---- from version 2.2.2
-$lang['No_Reg_advise'] = '<b>Über die Registrierung von Benutzern im FluxBB Forum</b><br><br>
-  Für eine bessere Integration, ist es ratsam, die folgenden drei Änderungen an Ihrem FluxBB Forum (<b>Warnung: Nehmen Sie diese Änderungen werden verschwinden, wenn Update-Forum</b>):<br>
-  <b>* Deaktivieren Sie die Option "Neuanmeldungen erlauben" auf der FluxBB-Administrationsseite (unter: Einstellungen - Registrierung)</b>
-<br>
-<br>
-  <b>* Ändern Sie die Datei</b> : [FluxBBRoot]/lang/German/register.php und ersetzen Sie die folgende Zeile:
-  <div class="mod">\'No new regs\'				=>	\'Dieses Forum akzeptiert momentan keine neuen Mitglieder.\'</div>
-  <b>mit :</b>
-  <div class="info">\'No new regs\'				=>	\'&lt;a href=&quot;http://[YourPiwigoRoot]/register.php&quot; &gt; Registrieren Sie sich bitte hier &lt;/a&gt;&lt;br/&gt;&lt;br/&gt;\'</div>
+// --------- Starting below: New or revised $lang ---- from version 2.3.0
+/*TODO*/$lang['No_Reg_advise'] = '
+  For better integration, it is advisable to make the following changes to your FluxBB forum (<b>Warning: These changes will disappear when updating the forum</b>):
+<br><br>
+  <b>* In FluxBB\'s administration panel, change "Allow new registrations" to NO (in: Options - Registration)</b>
+<br><br>
+  <b>* Modify the file</b> : [FluxBBRoot]/lang/English/register.php by replacing the following line:
+  <div class="mod">\'No new regs\'				=>	\'This forum is not accepting new users.\'</div>
+  <b>with :</b>
+  <div class="info">\'No new regs\'				=>	\'&lt;a href=&quot;http://[YourPiwigoRoot]/register.php&quot; &gt; Go here to register &lt;/a&gt;&lt;br/&gt;&lt;br/&gt;\'</div>
   <br>
-  Selbstverständlich sollten Sie diese Änderung für alle installierten Sprachen Ihres FluxBB Forums vornehmen.
-<br>
-<br>
-  <b>* Modifier le fichier</b> : [RacineDeFluxBB]/login.php und ersetzen Sie die Zeile 69:
+  Of course you should also make the same change for other languages of your FluxBB forum.
+<br><br>
+  <b>* Modify the file</b> : [FluxBBRoot]/login.php by replacing the line 69:
   <div class="mod">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;login.php?action=forget&quot;&gt;</div>
-  <b>mit :</b>
+  <b>with :</b>
   <div class="info">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;../[PiwigoRoot]/password.php&quot;&gt;</div>
 <br>
-  Und am Zeile 216:
+  and at line 216:
   <div class="mod">&lt;a href=&quot;login.php?action=forget&quot; tabindex=&quot;5&quot;><?php echo $lang_login[\'Forgotten pass\']</a></p></div>
-  <b>mit :</b>
+  <b>with :</b>
   <div class="info">&lt;a href=&quot;../[PiwigoRoot]/password.php&quot; tabindex=&quot;5&quot;><?php echo $lang_login[\'Forgotten pass\']</a></p></div>
   <br>';
-// --------- End: New or revised $lang ---- from version 2.2.2
+/*TODO*/$lang['About_Reg'] = 'About the registration of users on the forum FluxBB';
+/*TODO*/$lang['Bridge_UAM'] = 'Validation d\'accès au forum via le plugin UserAdvManager (UAM): Activez ici le pont entre les deux plugins qui vous permettra d\'interdir l\'accès à votre forum FluxBB tant que l\'utilisateur n\'a pas validé son inscription à la galerie (la fonction correspondante doit être active sur UAM). Access validation to the forum via UserAdvManager (UAM) plugin: Turn the bridge on between the two plugins that will allow you to prohibit the access to your FluxBB forum until the user has not validated its registration in the gallery (the function must be active on UAM).';
+/*TODO*/$lang['Bridge_UAM_true'] = ' --> Enable bridge Register_FluxBB / UAM';
+/*TODO*/$lang['Bridge_UAM_false'] = ' --> Disable bridge Register_FluxBB / UAM (default)';
+/*TODO*/$lang['FluxBB_Group'] = 'Précisez ici l\'ID du <b>groupe FluxBB</b> dans lequel les utilisateurs non validé doivent se trouver (à créer au préalable dans FluxBB). Pour être efficace, ce groupe ne doit avoir aucune permission sur le forum (voir à la fin de cette page pour les détails d\'utilisation de cette option).Specify the ID of <b>FluxBB\' group</b> in which non validated users must be (to be created in advance in FluxBB). To be effective, this group should have no permission on the forum (see the end of this page for details on using this option).';
+/*TODO*/$lang['About_Bridge'] = 'About Register_FluxBB / UAM bridge';
+/*TODO*/$lang['UAM_Bridge_advice'] = 'The UserAdvManager plugin allows forcing new registrants to confirm their registration before allowing them to access the entire gallery. The joint use of this plugin with Register_FluxBB can do the same on the forum linked: Registrants can not post until they have validated their registration in the gallery. <br>
+Here is the general procedure to apply:
+<br>
+- In the administration of your FluxBB forum, set at least 2 groups of users (for example: "validated" and "no_validated").<br>
+- Give the first group ("validated") access permissions you want on your forum and set it as the default group.<br>
+- Remove the second group ("no_validated") all permissions on your forum (the members of this group can only read public posts).<br>
+- Locate the ID of the second group "no_validated".<br>
+- Enter this ID in Register_FluxBB plugin, activate the bridge and save the settings.
+<br>
+<b class="mod"><u>Important notes:</u></b>
+<br>
+If you already use an earlier version of Register_FluxBB, Piwigo\'s accounts linked between your gallery and your FluxBB forum will not be impacted by the effects of the bridge. Only new registers will be impacted after activation of the bridge.<b><u>Accounts resynchronization function will be void.</u></b><br>
+Similarly, if you\'ve never used Register_FluxBB, the Piwigo\'s accounts migration phase from your gallery to your FluxBB forum will disregard the state validated or not for the accounts at the launch of the migration phase.';
+// --------- End: New or revised $lang ---- from version 2.3.0
 ?>
Index: /extensions/Register_FluxBB/trunk/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/Register_FluxBB/trunk/language/en_UK/plugin.lang.php	(revision 6814)
+++ /extensions/Register_FluxBB/trunk/language/en_UK/plugin.lang.php	(revision 6815)
@@ -114,10 +114,10 @@
 $lang['Title_Tab'] = 'Register_FluxBB - Version: ';
 
-// --------- Starting below: New or revised $lang ---- from version 2.2.2
-$lang['No_Reg_advise'] = '<b>About the registration of users on the forum FluxBB</b><br><br>
-  For better integration, it is advisable to make the following 3 changes to your FluxBB forum (<b>Warning: These changes will disappear when updating the forum</b>):<br>
+// --------- Starting below: New or revised $lang ---- from version 2.3.0
+$lang['No_Reg_advise'] = '
+  For better integration, it is advisable to make the following changes to your FluxBB forum (<b>Warning: These changes will disappear when updating the forum</b>):
+<br><br>
   <b>* In FluxBB\'s administration panel, change "Allow new registrations" to NO (in: Options - Registration)</b>
-<br>
-<br>
+<br><br>
   <b>* Modify the file</b> : [FluxBBRoot]/lang/English/register.php by replacing the following line:
   <div class="mod">\'No new regs\'				=>	\'This forum is not accepting new users.\'</div>
@@ -126,6 +126,5 @@
   <br>
   Of course you should also make the same change for other languages of your FluxBB forum.
-<br>
-<br>
+<br><br>
   <b>* Modify the file</b> : [FluxBBRoot]/login.php by replacing the line 69:
   <div class="mod">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;login.php?action=forget&quot;&gt;</div>
@@ -138,4 +137,23 @@
   <div class="info">&lt;a href=&quot;../[PiwigoRoot]/password.php&quot; tabindex=&quot;5&quot;><?php echo $lang_login[\'Forgotten pass\']</a></p></div>
   <br>';
-// --------- End: New or revised $lang ---- from version 2.2.2
+$lang['About_Reg'] = 'About the registration of users on the forum FluxBB';
+$lang['Bridge_UAM'] = 'Validation d\'accès au forum via le plugin UserAdvManager (UAM): Activez ici le pont entre les deux plugins qui vous permettra d\'interdir l\'accès à votre forum FluxBB tant que l\'utilisateur n\'a pas validé son inscription à la galerie (la fonction correspondante doit être active sur UAM). Access validation to the forum via UserAdvManager (UAM) plugin: Turn the bridge on between the two plugins that will allow you to prohibit the access to your FluxBB forum until the user has not validated its registration in the gallery (the function must be active on UAM).';
+$lang['Bridge_UAM_true'] = ' --> Enable bridge Register_FluxBB / UAM';
+$lang['Bridge_UAM_false'] = ' --> Disable bridge Register_FluxBB / UAM (default)';
+$lang['FluxBB_Group'] = 'Précisez ici l\'ID du <b>groupe FluxBB</b> dans lequel les utilisateurs non validé doivent se trouver (à créer au préalable dans FluxBB). Pour être efficace, ce groupe ne doit avoir aucune permission sur le forum (voir à la fin de cette page pour les détails d\'utilisation de cette option).Specify the ID of <b>FluxBB\' group</b> in which non validated users must be (to be created in advance in FluxBB). To be effective, this group should have no permission on the forum (see the end of this page for details on using this option).';
+$lang['About_Bridge'] = 'About Register_FluxBB / UAM bridge';
+$lang['UAM_Bridge_advice'] = 'The UserAdvManager plugin allows forcing new registrants to confirm their registration before allowing them to access the entire gallery. The joint use of this plugin with Register_FluxBB can do the same on the forum linked: Registrants can not post until they have validated their registration in the gallery. <br>
+Here is the general procedure to apply:
+<br>
+- In the administration of your FluxBB forum, set at least 2 groups of users (for example: "validated" and "no_validated").<br>
+- Give the first group ("validated") access permissions you want on your forum and set it as the default group.<br>
+- Remove the second group ("no_validated") all permissions on your forum (the members of this group can only read public posts).<br>
+- Locate the ID of the second group "no_validated".<br>
+- Enter this ID in Register_FluxBB plugin, activate the bridge and save the settings.
+<br>
+<b class="mod"><u>Important notes:</u></b>
+<br>
+If you already use an earlier version of Register_FluxBB, Piwigo\'s accounts linked between your gallery and your FluxBB forum will not be impacted by the effects of the bridge. Only new registers will be impacted after activation of the bridge.<b><u>Accounts resynchronization function will be void.</u></b><br>
+Similarly, if you\'ve never used Register_FluxBB, the Piwigo\'s accounts migration phase from your gallery to your FluxBB forum will disregard the state validated or not for the accounts at the launch of the migration phase.';
+// --------- End: New or revised $lang ---- from version 2.3.0
 ?>
Index: /extensions/Register_FluxBB/trunk/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/Register_FluxBB/trunk/language/fr_FR/plugin.lang.php	(revision 6814)
+++ /extensions/Register_FluxBB/trunk/language/fr_FR/plugin.lang.php	(revision 6815)
@@ -115,10 +115,10 @@
 
 
-// --------- Starting below: New or revised $lang ---- from version 2.2.2
-$lang['No_Reg_advise'] = '<b>A propos de l\'enregistrement d\'utilisateur sur le forum FluxBB</b><br><br>
-  Pour une meilleur intégration, il est conseille d\'apporter les 3 modifications suivantes à votre forum FluxBB (<b>Attention! Ces modifications disparaitront en cas de mise à jour du forum</b>):<br>
-  <b>* Modifier dans l\'interface d\'administration de FluxBB "Autoriser les nouvelles inscriptions" à NON ( dans : Options - Inscriptions )</b>
-<br>
-<br>
+// --------- Starting below: New or revised $lang ---- from version 2.3.0
+$lang['No_Reg_advise'] = '
+  Pour une meilleur intégration, il est conseillé d\'apporter les modifications suivantes à votre forum FluxBB (<b>Attention! Ces modifications disparaitront en cas de mise à jour du forum</b>):
+<br><br>
+  <b>* Modifier dans l\'interface d\'administration de FluxBB l\'option "Autoriser les nouvelles inscriptions" à NON ( dans : Options - Inscriptions )</b>
+<br><br>
   <b>* Modifier le fichier</b> : [RacineDeFluxBB]/lang/French/register.php en remplacant la ligne suivante:
   <div class="mod">\'No new regs\'				=>	\'Ce forum n\\\'accepte pas de nouveaux utilisateurs.\'</div>
@@ -127,6 +127,5 @@
   <br>
   Et reporter cette modification pour toutes les langues gérées sur votre forum.
-<br>
-<br>
+<br><br>
   <b>* Modifier le fichier</b> : [RacineDeFluxBB]/login.php en remplacant à la ligne 69:
   <div class="mod">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;login.php?action=forget&quot;&gt;</div>
@@ -135,8 +134,27 @@
 <br>
   à la ligne 216:
-  <div class="mod">&lt;a href=&quot;login.php?action=forget&quot; tabindex=&quot;5&quot;><?php echo $lang_login[\'Forgotten pass\']</a></p></div>
+  <div class="mod">&lt;a href=&quot;login.php?action=forget&quot; tabindex=&quot;5&quot;&gt;&lt;?php echo $lang_login[\'Forgotten pass\']&lt;/a&gt;</div>
   <b>par :</b>
-  <div class="info">&lt;a href=&quot;../[VotreRacineDePiwigo]/password.php&quot; tabindex=&quot;5&quot;><?php echo $lang_login[\'Forgotten pass\']</a></p></div>
+  <div class="info">&lt;a href=&quot;../[VotreRacineDePiwigo]/password.php&quot; tabindex=&quot;5&quot;&gt;&lt;?php echo $lang_login[\'Forgotten pass\']&lt;/a&gt;</div>
   <br>';
-// --------- End: New or revised $lang ---- from version 2.2.2
+$lang['About_Reg'] = 'A propos de l\'enregistrement d\'utilisateur sur le forum FluxBB';
+$lang['Bridge_UAM'] = 'Validation d\'accès au forum via le plugin UserAdvManager (UAM): Activez ici le pont entre les deux plugins qui vous permettra d\'interdir l\'accès à votre forum FluxBB tant que l\'utilisateur n\'a pas validé son inscription à la galerie (la fonction correspondante doit être active sur UAM).';
+$lang['Bridge_UAM_true'] = ' --> Pont Register_FluxBB / UAM activé';
+$lang['Bridge_UAM_false'] = ' --> Pont Register_FluxBB / UAM désactivé (par défaut)';
+$lang['FluxBB_Group'] = 'Précisez ici l\'ID du <b>groupe FluxBB</b> dans lequel les utilisateurs non validé doivent se trouver (à créer au préalable dans FluxBB). Pour être efficace, ce groupe ne doit avoir aucune permission sur le forum (voir à la fin de cette page pour les détails d\'utilisation de cette option).';
+$lang['About_Bridge'] = 'A propos du pont Register_FluxBB / UAM';
+$lang['UAM_Bridge_advice'] = 'Le plugin UserAdvManager permet de forcer les nouveaux inscrits à valider leur inscription avant de leur permettre d\'accéder à la totalité de la galerie. L\'utilisation conjointe de ce plugin avec Register_FluxBB permet de faire de même sur le forum lié: Ils ne pourront pas poster tant qu\'ils n\'auront pas validé leur inscription à la galerie.<br>
+Voici la procédure générale à appliquer:
+<br><br>
+- Dans la partie d\'administration de votre forum FluxBB, établissez au minimum 2 groupes d\'utilisateurs (par exemple: "validés" et "non_validés").<br>
+- Attribuez au premier groupe ("validés") les permissions d\'accès souhaitées sur votre forum et définissez le comme groupe par défaut.<br>
+- Retirez au second groupe ("non_validés") toutes les permissions sur votre forum (les membres de ce groupe ne pourront que lire les posts publics).<br>
+- Repérez l\'ID du second groupe "non_validés".<br>
+- Notez l\'ID dans le plugin Register_FluxBB, activez le pont et sauvegardez les paramètres.
+<br><br>
+<b class="mod"><u>Notes importantes:</u></b>
+<br><br>
+Si vous utilisiez déjà Register_FluxBB dans une version antérieur, les comptes liés entre votre galerie Piwigo et votre forum FluxBB ne seront pas impactés par les effets du pont. Seuls les nouveaux inscrits après l\'activation du pont y seront soumis.<b><u>La fonction de resynchronisation des comptes sera sans effet.</u></b><br><br>
+De même, si vous n\'avez jamais utilisé Register_FluxBB, la phase de migration des comptes de votre galerie Piwigo vers votre forum FluxBB ne tiendra pas compte de l\'état validé ou non de vos inscrits au moment du lancement de la phase de migration.';
+// --------- End: New or revised $lang ---- from version 2.3.0
 ?>
Index: /extensions/Register_FluxBB/trunk/main.inc.php
===================================================================
--- /extensions/Register_FluxBB/trunk/main.inc.php	(revision 6814)
+++ /extensions/Register_FluxBB/trunk/main.inc.php	(revision 6815)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: Register FluxBB
-Version: 2.2.4
+Version: 2.3.0
 Description: Link user registration from Piwigo to FluxBB forum (registration, password changing, deletion) - Original Nicco's NBC_LinkUser2PunBB plugin upgraded to Piwigo / Liez l'inscription des utilisateurs de Piwigo avec votre forum FluxBB - Portage du plugin NBC_LinkUser2PunBB de Nicco vers Piwigo
 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=252
@@ -54,4 +54,6 @@
 
 2.2.4     - 22/08/10  - Bug 1812 fixed : Compliance with FluxBB 1.4
+
+2.3.0     - 01/09/10  - Bug 1434 fixed : Bridge between Register_FluxBB and UserAdvManager for new users validation
 --------------------------------------------------------------------------------
 */
@@ -91,5 +93,5 @@
   include_once (REGFLUXBB_PATH.'include/functions.inc.php');
 
-  // Warning : FluxBB uses Sha1 hash instead of md5 for Piwigo !
+  // Warning : FluxBB uses Sha1 hash instead of md5 for Piwigo!
   FluxBB_Adduser($register_user['id'], $register_user['username'], sha1($_POST['password']), $register_user['email']);
 }
@@ -200,3 +202,74 @@
   }
 }
+
+
+/* Access validation in FluxBB when validated in Piwigo through UAM plugin */
+add_event_handler('login_success', 'UAM_Bridge');
+
+function UAM_Bridge()
+{
+  global $conf, $user;
+  
+  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
+  
+  // Check if UAM is installed and if bridge is set - Exception for admins and webmasters
+  if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true' and !is_admin() and !is_webmaster())
+  {
+    $conf_UAM = unserialize($conf['UserAdvManager']);
+    
+    // Getting unvalidated users group else Piwigo's default group
+    if (isset($conf_UAM[2]) and $conf_UAM[2] != '-1')
+    {
+      $Waitingroup = $conf_UAM[2];
+    }
+    else
+    {
+      $query = '
+SELECT id
+FROM '.GROUPS_TABLE.'
+WHERE is_default = "true"
+LIMIT 1
+;';
+      $data = pwg_db_fetch_assoc(pwg_query($query));
+      $Waitingroup = $data['id'];
+    }
+    
+    // check if logged in user is in a Piwigo's validated or unvalidated users group
+    $query = '
+SELECT *
+FROM '.USER_GROUP_TABLE.'
+WHERE user_id = '.$user['id'].'
+AND group_id = '.$Waitingroup.'
+;';
+    $count = pwg_db_num_rows(pwg_query($query));
+
+    // Check if logged in user is in a FluxBB's unvalidated group
+    $query = "
+SELECT group_id
+FROM ".FluxBB_USERS_TABLE."
+WHERE id = ".FluxBB_Searchuser($user['id'])."
+;";
+
+    $data = pwg_db_fetch_assoc(pwg_query($query));
+
+    // Logged in user switch to the default FluxBB's group if he'is validated
+    if ($count == 0 and $data['group_id'] = $conf_Register_FluxBB[7])
+    {
+      $query = "
+SELECT conf_value
+FROM ".FluxBB_CONFIG_TABLE."
+WHERE conf_name = 'o_default_user_group'
+;";
+
+      $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query));
+      
+      $query = "
+UPDATE ".FluxBB_USERS_TABLE."
+SET group_id = ".$o_default_user_group['conf_value']." 
+WHERE id = ".FluxBB_Searchuser($user['id'])."
+;";
+      pwg_query($query);
+    }
+  }
+}
 ?>
Index: /extensions/Register_FluxBB/trunk/maintain.inc.php
===================================================================
--- /extensions/Register_FluxBB/trunk/maintain.inc.php	(revision 6814)
+++ /extensions/Register_FluxBB/trunk/maintain.inc.php	(revision 6815)
@@ -17,5 +17,5 @@
   $q = '
 INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
-VALUES ("Register_FluxBB","FluxBB_;PhpWebGallery;Guest;false;false;true","Parametres Register_FluxBB")
+VALUES ("Register_FluxBB","FluxBB_;PhpWebGallery;Guest;false;false;true;false;0","Parametres Register_FluxBB")
 ;';
     
@@ -42,4 +42,20 @@
 /* *********************** */
   regfluxbb_obsolete_files();
+
+/* Check version < 2.3.0 */
+  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
+  
+  if (!isset($conf_Register_FluxBB[6]) and !isset($conf_Register_FluxBB[7]))
+  {
+    $upgrade_RFBB = $conf_Register_FluxBB[0].';'.$conf_Register_FluxBB[1].';'.$conf_Register_FluxBB[2].';'.$conf_Register_FluxBB[3].';'.$conf_Register_FluxBB[4].';'.$conf_Register_FluxBB[5].';false;0';
+		
+    $query = '
+UPDATE '.CONFIG_TABLE.'
+SET value="'.$upgrade_RFBB.'"
+WHERE param="Register_FluxBB"
+LIMIT 1
+;';
+		pwg_query($query);
+  }
 }
 
