Changeset 6815


Ignore:
Timestamp:
Aug 28, 2010, 10:20:24 PM (14 years ago)
Author:
Eric
Message:

bug 1434 fixed : Bridge between Register_FluxBB and UAM for users registration control

  • Language files updated (FR and EN are OK. DE is to do)
  • Admin page small refactory
  • Database upgrade process updated for new plugin version
  • Version 2.3.0 hard coded
Location:
extensions/Register_FluxBB/trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • extensions/Register_FluxBB/trunk/admin/admin.php

    r5635 r6815  
    572572        case 'manage':
    573573 
    574   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']) )
    575   {
    576     $conf['Register_FluxBB'] = $_POST['FluxBB_prefix'].';'.addslashes($_POST['FluxBB_admin']).';'.addslashes($_POST['FluxBB_guest']).';'.$_POST['FluxBB_del_pt'].';'.$_POST['FluxBB_confirm'].';'.$_POST['FluxBB_details'];
     574  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']))
     575  {
     576    $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'];
    577577
    578578    $query = '
     
    598598      'FluxBB_ADMIN'         => stripslashes($conf_Register_FluxBB[1]),
    599599      'FluxBB_GUEST'         => stripslashes($conf_Register_FluxBB[2]),
    600       'FluxBB_DEL_PT_TRUE'   => (isset($conf_Register_FluxBB[3]) and $conf_Register_FluxBB[3] == 'true') ? 'checked="checked"' : '' ,
    601       'FluxBB_DEL_PT_FALSE'  => (isset($conf_Register_FluxBB[3]) and $conf_Register_FluxBB[3] == 'false') ? 'checked="checked"' : '' ,
    602       'FluxBB_CONFIRM_TRUE'  => (isset($conf_Register_FluxBB[4]) and $conf_Register_FluxBB[4] == 'true') ? 'checked="checked"' : '' ,
    603       'FluxBB_CONFIRM_FALSE' => (isset($conf_Register_FluxBB[4]) and $conf_Register_FluxBB[4] == 'false') ? 'checked="checked"' : '' ,
    604       'FluxBB_DETAILS_TRUE'  => (isset($conf_Register_FluxBB[5]) and $conf_Register_FluxBB[5] == 'true') ? 'checked="checked"' : '' ,
    605       'FluxBB_DETAILS_FALSE' => (isset($conf_Register_FluxBB[5]) and $conf_Register_FluxBB[5] == 'false') ? 'checked="checked"' : '' ,
     600      'FluxBB_DEL_PT_TRUE'   => (isset($conf_Register_FluxBB[3]) and $conf_Register_FluxBB[3] == 'true') ? 'checked="checked"' : '',
     601      'FluxBB_DEL_PT_FALSE'  => (isset($conf_Register_FluxBB[3]) and $conf_Register_FluxBB[3] == 'false') ? 'checked="checked"' : '',
     602      'FluxBB_CONFIRM_TRUE'  => (isset($conf_Register_FluxBB[4]) and $conf_Register_FluxBB[4] == 'true') ? 'checked="checked"' : '',
     603      'FluxBB_CONFIRM_FALSE' => (isset($conf_Register_FluxBB[4]) and $conf_Register_FluxBB[4] == 'false') ? 'checked="checked"' : '',
     604      'FluxBB_DETAILS_TRUE'  => (isset($conf_Register_FluxBB[5]) and $conf_Register_FluxBB[5] == 'true') ? 'checked="checked"' : '',
     605      'FluxBB_DETAILS_FALSE' => (isset($conf_Register_FluxBB[5]) and $conf_Register_FluxBB[5] == 'false') ? 'checked="checked"' : '',
     606    )
     607  );
     608
     609// If UAM exists and if UAM ConfirmMail is set, we can set this feature
     610  if (function_exists('FindAvailableConfirmMailID'))
     611  { 
     612    $conf_UAM = unserialize($conf['UserAdvManager']);
     613    $UAM_bridge = false;
     614   
     615    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')
     616    {
     617      $UAM_bridge = true;
     618    }
     619  }
     620 
     621  $template->assign(
     622    array
     623    (
     624      'UAM_BRIDGE'            => $UAM_bridge,
     625      'FluxBB_UAM_LINK_TRUE'  => (isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true') ? 'checked="checked"' : '',
     626      'FluxBB_UAM_LINK_FALSE' => (isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'false') ? 'checked="checked"' : '',
     627      'FluxBB_GROUP'          => $conf_Register_FluxBB[7],
    606628    )
    607629  );
  • extensions/Register_FluxBB/trunk/admin/template/manage.tpl

    r5606 r6815  
    11{html_head}<link rel="stylesheet" type="text/css" href="{$REGFLUXBB_PATH}admin/template/register_fluxbb.css">{/html_head}
     2
     3<script type="text/javascript">
     4function blockToggleDisplay(headerId, contentId)
     5{ldelim}
     6  var revHeader = document.getElementById(headerId);
     7  var revContent = document.getElementById(contentId);
     8
     9  if (revContent.style.display == 'none')
     10  {ldelim}
     11    revContent.style.display = 'block';
     12    revHeader.className = 'instructionBlockHeaderExpanded';
     13  {rdelim}
     14  else
     15  {ldelim}
     16    revContent.style.display = 'none';
     17    revHeader.className = 'instructionBlockHeaderCollapsed';
     18  {rdelim}
     19{rdelim}
     20
     21function rfbb_blockToggleDisplay( headerId, contentId )
     22{ldelim}
     23  if (typeof(headerId)=='string')
     24  {ldelim}
     25   if ( headerId.length>  1)
     26       blockToggleDisplay(headerId, contentId) ;
     27      document.getElementById("nb_para").value =headerId ;
     28      document.getElementById("nb_para2").value =contentId;
     29  {rdelim}
     30{rdelim}
     31</script>
    232
    333<div class="titrePage">
     
    838  <fieldset>
    939        <legend>{'Config_Title'|@translate}</legend>
    10     <div align="left">{'Config_Disclaimer'|@translate}</div>
     40    {'Config_Disclaimer'|@translate}
     41    <br><br>
    1142    <ul>
    1243        <li><label>{'Prefix'|@translate}</label><br>
    13                 <input type="text" name="FluxBB_prefix" size="20" style="text-align: center;" value={$FluxBB_PREFIX}><br>
     44                <input type="text" name="FluxBB_prefix" value={$FluxBB_PREFIX} size="20" style="text-align: center;"><br>
     45      <br>
    1446        </li>
    15       <br>
    1647        <li><label>{'Admin'|@translate}</label><br>
    1748                <input type="text" name="FluxBB_admin" value={$FluxBB_ADMIN} size="20" style="text-align: center;"><br>
    1849                {'User'|@translate}
     50      <br>
    1951        </li>
    20       <br>
    2152        <li><label>{'Guest'|@translate}</label><br>
    2253                <input type="text" name="FluxBB_guest" value={$FluxBB_GUEST} size="20" style="text-align: center;"><br>
     54      <br>
    2355        </li>
    24       <br>
    2556        <li><label>{'Del_Pt'|@translate}</label><br>
    2657        <input type="radio" value="true" {$FluxBB_DEL_PT_TRUE} name="FluxBB_del_pt">{'Del_Pt_true'|@translate}<br>
    2758        <input type="radio" value="false" {$FluxBB_DEL_PT_FALSE} name="FluxBB_del_pt">{'Del_Pt_false'|@translate}<br>
     59      <br>
    2860        </li>
    29       <br>
    3061        <li><label>{'Confirm'|@translate}</label><br>
    3162        <input type="radio" value="true" {$FluxBB_CONFIRM_TRUE} name="FluxBB_confirm">{'Confirm_true'|@translate}<br>
    3263        <input type="radio" value="false" {$FluxBB_CONFIRM_FALSE} name="FluxBB_confirm">{'Confirm_false'|@translate}<br>
     64      <br>
    3365        </li>
    34       <br>
    3566        <li><label>{'Details'|@translate}</label><br>
    3667        <input type="radio" value="true" {$FluxBB_DETAILS_TRUE} name="FluxBB_details">{'Details_true'|@translate}<br>
    3768        <input type="radio" value="false" {$FluxBB_DETAILS_FALSE} name="FluxBB_details">{'Details_false'|@translate}<br>
     69      <br>
    3870        </li>
     71      {if $UAM_BRIDGE}
     72        <li><label>{'Bridge_UAM'|@translate}</label><br>
     73        <input type="radio" value="true" {$FluxBB_UAM_LINK_TRUE} name="FluxBB_UAM">{'Bridge_UAM_true'|@translate}<br>
     74        <input type="radio" value="false" {$FluxBB_UAM_LINK_FALSE} name="FluxBB_UAM">{'Bridge_UAM_false'|@translate}<br>
     75      <br>
     76      </li>
     77        <li><label>{'FluxBB_Group'|@translate}</label><br>
     78                <input type="text" name="FluxBB_group" value={$FluxBB_GROUP} size="6" style="text-align: center;"><br>
     79        </li>
     80      {/if}
    3981    </ul>
    40     <br>
    41         {'No_Reg_advise'|@translate}
    4282    <br>
    4383        <div align="center"><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED}></div>
    4484  </fieldset>
     85
     86  <div id="instructionConfig1" class="instructionBlock" >
     87    <div id="config1_header" class="instructionBlockHeaderCollapsed" onclick="rfbb_blockToggleDisplay('config1_header', 'Config1')">
     88        {'About_Reg'|@translate}
     89      </span>
     90    </div>
     91 
     92    <div id="Config1" class="instructionBlockContent" style="display:none">
     93      {'No_Reg_advise'|@translate}
     94    </div>
     95  </div>
     96  <div id="instructionConfig2" class="instructionBlock" >
     97    <div id="config2_header" class="instructionBlockHeaderCollapsed" onclick="rfbb_blockToggleDisplay('config2_header', 'Config2')">
     98        {'About_Bridge'|@translate}
     99      </span>
     100    </div>
     101 
     102    <div id="Config2" class="instructionBlockContent" style="display:none">
     103      {'UAM_Bridge_advice'|@translate}
     104    </div>
     105  </div>
    45106</form>
  • extensions/Register_FluxBB/trunk/admin/template/register_fluxbb.css

    r6294 r6815  
    4747  background-color: #ffd5dc;
    4848}
     49
     50/* Bloc expand-collapse instructions */
     51.instructionBlockHeaderCollapsed, .instructionBlockHeaderExpanded
     52{
     53  background-color:#111;
     54  background-position:15px center;
     55  background-repeat:no-repeat;
     56  color:#ff3363;
     57  cursor:pointer;
     58  font-size:110%;
     59  overflow:hidden;
     60  padding:8px 41px;
     61  text-align: left;
     62}
     63
     64.instructionBlockHeaderCollapsed span, .instructionBlockHeaderExpanded span
     65{
     66  border-bottom: none;
     67}
     68 
     69.instructionBlockHeaderCollapsed
     70{
     71  background-image: url(./icon/expand.gif);
     72}
     73
     74.instructionBlockHeaderExpanded
     75{
     76  background-image: url(./icon/collapse.gif);
     77}
     78
     79.instructionBlockContent
     80{
     81  padding:0 15px 15px;
     82}
  • extensions/Register_FluxBB/trunk/include/functions.inc.php

    r6791 r6815  
    5858  $registred = time();
    5959  $registred_ip = $_SERVER['REMOTE_ADDR'];
    60 
    61   $query = "
     60 
     61  // Check if UAM is installed and if bridge is set - Exception for admins and webmasters
     62  if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true')
     63  {
     64    $o_default_user_group = $conf_Register_FluxBB[7];
     65  }
     66  else
     67  {
     68    $query = "
    6269SELECT conf_value
    6370FROM ".FluxBB_CONFIG_TABLE."
     
    6572;";
    6673
    67   $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query));
     74    $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query));
     75  }
    6876
    6977// Check for FluxBB version 1.4.x and get the correct value
  • extensions/Register_FluxBB/trunk/language/de_DE/plugin.lang.php

    r6300 r6815  
    114114$lang['Title_Tab'] = 'Register_FluxBB - Version: ';
    115115
    116 // --------- Starting below: New or revised $lang ---- from version 2.2.2
    117 $lang['No_Reg_advise'] = '<b>Über die Registrierung von Benutzern im FluxBB Forum</b><br><br>
    118   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>
    119   <b>* Deaktivieren Sie die Option "Neuanmeldungen erlauben" auf der FluxBB-Administrationsseite (unter: Einstellungen - Registrierung)</b>
    120 <br>
    121 <br>
    122   <b>* Ändern Sie die Datei</b> : [FluxBBRoot]/lang/German/register.php und ersetzen Sie die folgende Zeile:
    123   <div class="mod">\'No new regs\'                              =>      \'Dieses Forum akzeptiert momentan keine neuen Mitglieder.\'</div>
    124   <b>mit :</b>
    125   <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>
     116// --------- Starting below: New or revised $lang ---- from version 2.3.0
     117/*TODO*/$lang['No_Reg_advise'] = '
     118  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>):
     119<br><br>
     120  <b>* In FluxBB\'s administration panel, change "Allow new registrations" to NO (in: Options - Registration)</b>
     121<br><br>
     122  <b>* Modify the file</b> : [FluxBBRoot]/lang/English/register.php by replacing the following line:
     123  <div class="mod">\'No new regs\'                              =>      \'This forum is not accepting new users.\'</div>
     124  <b>with :</b>
     125  <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>
    126126  <br>
    127   Selbstverständlich sollten Sie diese Änderung für alle installierten Sprachen Ihres FluxBB Forums vornehmen.
    128 <br>
    129 <br>
    130   <b>* Modifier le fichier</b> : [RacineDeFluxBB]/login.php und ersetzen Sie die Zeile 69:
     127  Of course you should also make the same change for other languages of your FluxBB forum.
     128<br><br>
     129  <b>* Modify the file</b> : [FluxBBRoot]/login.php by replacing the line 69:
    131130  <div class="mod">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;login.php?action=forget&quot;&gt;</div>
    132   <b>mit :</b>
     131  <b>with :</b>
    133132  <div class="info">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;../[PiwigoRoot]/password.php&quot;&gt;</div>
    134133<br>
    135   Und am Zeile 216:
     134  and at line 216:
    136135  <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>
    137   <b>mit :</b>
     136  <b>with :</b>
    138137  <div class="info">&lt;a href=&quot;../[PiwigoRoot]/password.php&quot; tabindex=&quot;5&quot;><?php echo $lang_login[\'Forgotten pass\']</a></p></div>
    139138  <br>';
    140 // --------- End: New or revised $lang ---- from version 2.2.2
     139/*TODO*/$lang['About_Reg'] = 'About the registration of users on the forum FluxBB';
     140/*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).';
     141/*TODO*/$lang['Bridge_UAM_true'] = ' --> Enable bridge Register_FluxBB / UAM';
     142/*TODO*/$lang['Bridge_UAM_false'] = ' --> Disable bridge Register_FluxBB / UAM (default)';
     143/*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).';
     144/*TODO*/$lang['About_Bridge'] = 'About Register_FluxBB / UAM bridge';
     145/*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>
     146Here is the general procedure to apply:
     147<br>
     148- In the administration of your FluxBB forum, set at least 2 groups of users (for example: "validated" and "no_validated").<br>
     149- Give the first group ("validated") access permissions you want on your forum and set it as the default group.<br>
     150- Remove the second group ("no_validated") all permissions on your forum (the members of this group can only read public posts).<br>
     151- Locate the ID of the second group "no_validated".<br>
     152- Enter this ID in Register_FluxBB plugin, activate the bridge and save the settings.
     153<br>
     154<b class="mod"><u>Important notes:</u></b>
     155<br>
     156If 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>
     157Similarly, 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.';
     158// --------- End: New or revised $lang ---- from version 2.3.0
    141159?>
  • extensions/Register_FluxBB/trunk/language/en_UK/plugin.lang.php

    r6300 r6815  
    114114$lang['Title_Tab'] = 'Register_FluxBB - Version: ';
    115115
    116 // --------- Starting below: New or revised $lang ---- from version 2.2.2
    117 $lang['No_Reg_advise'] = '<b>About the registration of users on the forum FluxBB</b><br><br>
    118   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>
     116// --------- Starting below: New or revised $lang ---- from version 2.3.0
     117$lang['No_Reg_advise'] = '
     118  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>):
     119<br><br>
    119120  <b>* In FluxBB\'s administration panel, change "Allow new registrations" to NO (in: Options - Registration)</b>
    120 <br>
    121 <br>
     121<br><br>
    122122  <b>* Modify the file</b> : [FluxBBRoot]/lang/English/register.php by replacing the following line:
    123123  <div class="mod">\'No new regs\'                              =>      \'This forum is not accepting new users.\'</div>
     
    126126  <br>
    127127  Of course you should also make the same change for other languages of your FluxBB forum.
    128 <br>
    129 <br>
     128<br><br>
    130129  <b>* Modify the file</b> : [FluxBBRoot]/login.php by replacing the line 69:
    131130  <div class="mod">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;login.php?action=forget&quot;&gt;</div>
     
    138137  <div class="info">&lt;a href=&quot;../[PiwigoRoot]/password.php&quot; tabindex=&quot;5&quot;><?php echo $lang_login[\'Forgotten pass\']</a></p></div>
    139138  <br>';
    140 // --------- End: New or revised $lang ---- from version 2.2.2
     139$lang['About_Reg'] = 'About the registration of users on the forum FluxBB';
     140$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).';
     141$lang['Bridge_UAM_true'] = ' --> Enable bridge Register_FluxBB / UAM';
     142$lang['Bridge_UAM_false'] = ' --> Disable bridge Register_FluxBB / UAM (default)';
     143$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).';
     144$lang['About_Bridge'] = 'About Register_FluxBB / UAM bridge';
     145$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>
     146Here is the general procedure to apply:
     147<br>
     148- In the administration of your FluxBB forum, set at least 2 groups of users (for example: "validated" and "no_validated").<br>
     149- Give the first group ("validated") access permissions you want on your forum and set it as the default group.<br>
     150- Remove the second group ("no_validated") all permissions on your forum (the members of this group can only read public posts).<br>
     151- Locate the ID of the second group "no_validated".<br>
     152- Enter this ID in Register_FluxBB plugin, activate the bridge and save the settings.
     153<br>
     154<b class="mod"><u>Important notes:</u></b>
     155<br>
     156If 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>
     157Similarly, 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.';
     158// --------- End: New or revised $lang ---- from version 2.3.0
    141159?>
  • extensions/Register_FluxBB/trunk/language/fr_FR/plugin.lang.php

    r6299 r6815  
    115115
    116116
    117 // --------- Starting below: New or revised $lang ---- from version 2.2.2
    118 $lang['No_Reg_advise'] = '<b>A propos de l\'enregistrement d\'utilisateur sur le forum FluxBB</b><br><br>
    119   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>
    120   <b>* Modifier dans l\'interface d\'administration de FluxBB "Autoriser les nouvelles inscriptions" à NON ( dans : Options - Inscriptions )</b>
    121 <br>
    122 <br>
     117// --------- Starting below: New or revised $lang ---- from version 2.3.0
     118$lang['No_Reg_advise'] = '
     119  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>):
     120<br><br>
     121  <b>* Modifier dans l\'interface d\'administration de FluxBB l\'option "Autoriser les nouvelles inscriptions" à NON ( dans : Options - Inscriptions )</b>
     122<br><br>
    123123  <b>* Modifier le fichier</b> : [RacineDeFluxBB]/lang/French/register.php en remplacant la ligne suivante:
    124124  <div class="mod">\'No new regs\'                              =>      \'Ce forum n\\\'accepte pas de nouveaux utilisateurs.\'</div>
     
    127127  <br>
    128128  Et reporter cette modification pour toutes les langues gérées sur votre forum.
    129 <br>
    130 <br>
     129<br><br>
    131130  <b>* Modifier le fichier</b> : [RacineDeFluxBB]/login.php en remplacant à la ligne 69:
    132131  <div class="mod">message($lang_login[\'Wrong user/pass\'].\'&lt;a href=&quot;login.php?action=forget&quot;&gt;</div>
     
    135134<br>
    136135  à la ligne 216:
    137   <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>
     136  <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>
    138137  <b>par :</b>
    139   <div class="info">&lt;a href=&quot;../[VotreRacineDePiwigo]/password.php&quot; tabindex=&quot;5&quot;><?php echo $lang_login[\'Forgotten pass\']</a></p></div>
     138  <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>
    140139  <br>';
    141 // --------- End: New or revised $lang ---- from version 2.2.2
     140$lang['About_Reg'] = 'A propos de l\'enregistrement d\'utilisateur sur le forum FluxBB';
     141$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).';
     142$lang['Bridge_UAM_true'] = ' --> Pont Register_FluxBB / UAM activé';
     143$lang['Bridge_UAM_false'] = ' --> Pont Register_FluxBB / UAM désactivé (par défaut)';
     144$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).';
     145$lang['About_Bridge'] = 'A propos du pont Register_FluxBB / UAM';
     146$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>
     147Voici la procédure générale à appliquer:
     148<br><br>
     149- 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>
     150- 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>
     151- 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>
     152- Repérez l\'ID du second groupe "non_validés".<br>
     153- Notez l\'ID dans le plugin Register_FluxBB, activez le pont et sauvegardez les paramètres.
     154<br><br>
     155<b class="mod"><u>Notes importantes:</u></b>
     156<br><br>
     157Si 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>
     158De 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.';
     159// --------- End: New or revised $lang ---- from version 2.3.0
    142160?>
  • extensions/Register_FluxBB/trunk/main.inc.php

    r6791 r6815  
    22/*
    33Plugin Name: Register FluxBB
    4 Version: 2.2.4
     4Version: 2.3.0
    55Description: 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
    66Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=252
     
    5454
    55552.2.4     - 22/08/10  - Bug 1812 fixed : Compliance with FluxBB 1.4
     56
     572.3.0     - 01/09/10  - Bug 1434 fixed : Bridge between Register_FluxBB and UserAdvManager for new users validation
    5658--------------------------------------------------------------------------------
    5759*/
     
    9193  include_once (REGFLUXBB_PATH.'include/functions.inc.php');
    9294
    93   // Warning : FluxBB uses Sha1 hash instead of md5 for Piwigo !
     95  // Warning : FluxBB uses Sha1 hash instead of md5 for Piwigo!
    9496  FluxBB_Adduser($register_user['id'], $register_user['username'], sha1($_POST['password']), $register_user['email']);
    9597}
     
    200202  }
    201203}
     204
     205
     206/* Access validation in FluxBB when validated in Piwigo through UAM plugin */
     207add_event_handler('login_success', 'UAM_Bridge');
     208
     209function UAM_Bridge()
     210{
     211  global $conf, $user;
     212 
     213  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
     214 
     215  // Check if UAM is installed and if bridge is set - Exception for admins and webmasters
     216  if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true' and !is_admin() and !is_webmaster())
     217  {
     218    $conf_UAM = unserialize($conf['UserAdvManager']);
     219   
     220    // Getting unvalidated users group else Piwigo's default group
     221    if (isset($conf_UAM[2]) and $conf_UAM[2] != '-1')
     222    {
     223      $Waitingroup = $conf_UAM[2];
     224    }
     225    else
     226    {
     227      $query = '
     228SELECT id
     229FROM '.GROUPS_TABLE.'
     230WHERE is_default = "true"
     231LIMIT 1
     232;';
     233      $data = pwg_db_fetch_assoc(pwg_query($query));
     234      $Waitingroup = $data['id'];
     235    }
     236   
     237    // check if logged in user is in a Piwigo's validated or unvalidated users group
     238    $query = '
     239SELECT *
     240FROM '.USER_GROUP_TABLE.'
     241WHERE user_id = '.$user['id'].'
     242AND group_id = '.$Waitingroup.'
     243;';
     244    $count = pwg_db_num_rows(pwg_query($query));
     245
     246    // Check if logged in user is in a FluxBB's unvalidated group
     247    $query = "
     248SELECT group_id
     249FROM ".FluxBB_USERS_TABLE."
     250WHERE id = ".FluxBB_Searchuser($user['id'])."
     251;";
     252
     253    $data = pwg_db_fetch_assoc(pwg_query($query));
     254
     255    // Logged in user switch to the default FluxBB's group if he'is validated
     256    if ($count == 0 and $data['group_id'] = $conf_Register_FluxBB[7])
     257    {
     258      $query = "
     259SELECT conf_value
     260FROM ".FluxBB_CONFIG_TABLE."
     261WHERE conf_name = 'o_default_user_group'
     262;";
     263
     264      $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query));
     265     
     266      $query = "
     267UPDATE ".FluxBB_USERS_TABLE."
     268SET group_id = ".$o_default_user_group['conf_value']."
     269WHERE id = ".FluxBB_Searchuser($user['id'])."
     270;";
     271      pwg_query($query);
     272    }
     273  }
     274}
    202275?>
  • extensions/Register_FluxBB/trunk/maintain.inc.php

    r5606 r6815  
    1717  $q = '
    1818INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
    19 VALUES ("Register_FluxBB","FluxBB_;PhpWebGallery;Guest;false;false;true","Parametres Register_FluxBB")
     19VALUES ("Register_FluxBB","FluxBB_;PhpWebGallery;Guest;false;false;true;false;0","Parametres Register_FluxBB")
    2020;';
    2121   
     
    4242/* *********************** */
    4343  regfluxbb_obsolete_files();
     44
     45/* Check version < 2.3.0 */
     46  $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();
     47 
     48  if (!isset($conf_Register_FluxBB[6]) and !isset($conf_Register_FluxBB[7]))
     49  {
     50    $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';
     51               
     52    $query = '
     53UPDATE '.CONFIG_TABLE.'
     54SET value="'.$upgrade_RFBB.'"
     55WHERE param="Register_FluxBB"
     56LIMIT 1
     57;';
     58                pwg_query($query);
     59  }
    4460}
    4561
Note: See TracChangeset for help on using the changeset viewer.