Index: /extensions/nbc_HistoryIPExcluder/trunk/admin/HIPE_admin.php
===================================================================
--- /extensions/nbc_HistoryIPExcluder/trunk/admin/HIPE_admin.php	(revision 6757)
+++ /extensions/nbc_HistoryIPExcluder/trunk/admin/HIPE_admin.php	(revision 6758)
@@ -37,4 +37,19 @@
   pwg_query($query);
 
+  if (!isset($_POST['HIPE_chkb'])) $_POST['HIPE_chkb'] = '0';
+  $newconf_HIPE = array(
+    'Blacklist' => $_POST['HIPE_chkb'],
+    'Version'   => $version,
+  );
+  
+  $conf['HistoryIPConfig'] = serialize($newconf_HIPE);
+
+  $query = '
+    UPDATE '.CONFIG_TABLE.'
+    SET value="'.addslashes($conf['HistoryIPConfig']).'"
+    WHERE param="HistoryIPConfig"
+    LIMIT 1';
+  pwg_query($query);
+
   // information message
   array_push($page['infos'], l10n('HIPE_save_config'));
@@ -85,5 +100,5 @@
   while ($subrow = pwg_db_fetch_assoc($subresult))
   {
-    $template->assign(
+    $template->append(
       'resultat',
       array(
@@ -125,5 +140,5 @@
   while ($subrow = pwg_db_fetch_assoc($subresult))
   {
-    $template->assign(
+    $template->append(
       'resultat',
       array(
@@ -158,5 +173,5 @@
   while ($subrow = pwg_db_fetch_assoc($subresult))
   {
-    $template->assign(
+    $template->append(
       'resultat',
       array(
@@ -172,5 +187,5 @@
 elseif ( isset($_POST['HIPE_MemberForIp']) and isset($_POST['HIPE_input']))
 {
-  $template->assign(
+  $template->append(
     array(
       'HIPE_DESCRIPTION2' => l10n('HIPE_MemberForIp_description'),
@@ -205,4 +220,5 @@
 
 $conf_HIPE = explode("," , $conf['HistoryIPExcluder']);
+$HIPE_Config = unserialize($conf['HistoryIPConfig']);
 
 $template->assign(
@@ -215,4 +231,6 @@
 );
 
+  if ($HIPE_Config['Blacklist'] == 1) $template->assign(array('HIPE_IPBlacklisted' => 'checked="checked"'));
+
   $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/HIPE_admin.tpl');
   $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
Index: /extensions/nbc_HistoryIPExcluder/trunk/admin/HIPE_admin.tpl
===================================================================
--- /extensions/nbc_HistoryIPExcluder/trunk/admin/HIPE_admin.tpl	(revision 6757)
+++ /extensions/nbc_HistoryIPExcluder/trunk/admin/HIPE_admin.tpl	(revision 6758)
@@ -15,6 +15,12 @@
     <div style="text-align:center;">
       <textarea name="HIPE_IPs_Excluded" rows="10" cols="30" {$TAG_INPUT_ENABLED}>{$IPs_EXCLUDED}</textarea>
+    </div>
 
-    </div>
+    <fieldset>
+    <legend>{'HIPE_IPBlacklist_title'|@translate}</legend>
+      <ul>
+		    <li><input type="checkbox" name="HIPE_chkb" {$HIPE_IPBlacklisted} value="1">&nbsp;{'HIPE_IPBlacklisted'|@translate}</li>
+      </ul>
+    </fieldset>
     
     <p><input type="submit" name="submit" value="{'submit'|@translate}" class="bouton" {$TAG_INPUT_ENABLED}> <input type="submit" name="CleanHist" value="{'HIPE_CleanHist'|@translate}" class="bouton" {$TAG_INPUT_ENABLED}></p>
@@ -44,11 +50,13 @@
       <table>
       <!-- BEGIN resultat -->
-        <tr>
-          <td>{$resultat.HIPE_RESULTAT1}</td>
-          <td>{$resultat.HIPE_RESULTAT2}</td>
-          <td>{$resultat.HIPE_RESULTAT3}</td>
-          <td>{$resultat.HIPE_RESULTAT4}</td>
-          <td>{$resultat.HIPE_RESULTAT5}</td>
+      {foreach from=$resultat item=result}
+        <tr style="color: red;">
+          <td>{$result.HIPE_RESULTAT1}</td>
+          <td>{$result.HIPE_RESULTAT2}</td>
+          <td>{$result.HIPE_RESULTAT3}</td>
+          <td>{$result.HIPE_RESULTAT4}</td>
+          <td>{$result.HIPE_RESULTAT5}</td>
         </tr>
+      {/foreach} 
       <!-- END resultat -->
       </table>
Index: /extensions/nbc_HistoryIPExcluder/trunk/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/nbc_HistoryIPExcluder/trunk/language/fr_FR/plugin.lang.php	(revision 6757)
+++ /extensions/nbc_HistoryIPExcluder/trunk/language/fr_FR/plugin.lang.php	(revision 6758)
@@ -30,3 +30,9 @@
 $lang['HIPE_version'] = ' - Version: ';
 // --------- End: New or revised $lang ---- from version 2.1.0
+
+// --------- Starting below: New or revised $lang ---- from version 2.1.1
+$lang['HIPE_IPBlacklist_title'] = 'Exclusion à l\'inscription';
+$lang['HIPE_IPBlacklisted'] = ' Empêcher l\'inscription à la galerie des IP exclues de l\'historique (Blacklistage)';
+$lang['Error_HIPE_BlacklistedIP'] = 'Erreur! Votre IP a été bannie. Vous ne pouvez plus vous inscrire à cette galerie. Contactez l\'administrateur pour de plus amples détails.';
+// --------- End: New or revised $lang ---- from version 2.1.1
 ?>
Index: /extensions/nbc_HistoryIPExcluder/trunk/main.inc.php
===================================================================
--- /extensions/nbc_HistoryIPExcluder/trunk/main.inc.php	(revision 6757)
+++ /extensions/nbc_HistoryIPExcluder/trunk/main.inc.php	(revision 6758)
@@ -2,6 +2,6 @@
 /*
 Plugin Name: History IP Excluder
-Version: 2.1.0
-Description: Permet l'exclusion d'une IP ou d'une plage d'IP de l historique - Excludes one IP or a range of IP from the history.
+Version: 2.1.1
+Description: Permet l'exclusion d'une IP ou d'une plage d'IP de l historique et de les blacklister à l'inscription - Base MySql seulement! / Excludes one IP or a range of IP from the history and to blacklist them on registration - MySql database only!
 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=147
 Author: Nicco, Eric
@@ -20,4 +20,7 @@
                   - Removing "nbc_" prefix in plugin code and display in piwigo's plugin manager
                   - Displaying the good plugin name and current version in admin panel
+                  
+2.1.1             - Bug 1792 fixed (Thx to TOnin)
+                  - Bug 1511 fixed - New function to blacklist excluded IPs or ranged IPs for registration
 
 --------------------------------------------------------------------------------
@@ -86,3 +89,37 @@
   }
 }
+
+/* Check users registration */
+add_event_handler('register_user_check', 'HIPE_RegistrationCheck', EVENT_HANDLER_PRIORITY_NEUTRAL +2, 2);
+
+function HIPE_RegistrationCheck($err, $user)
+{
+  global $errors, $conf;
+  load_language('plugin.lang', HIPE_PATH);
+  
+  if (count($err)!=0 ) return $err;
+  
+  $IP_Client = explode('.', $_SERVER['REMOTE_ADDR']);
+  $HIPE_Config = unserialize($conf['HistoryIPConfig']);
+  $conf_HIPE = explode("," , $conf['HistoryIPExcluder']);
+  
+  if (isset($HIPE_Config['Blacklist']) and $HIPE_Config['Blacklist'] == true)
+  {
+    foreach ($conf_HIPE as $Exclusion)
+    {
+      $IP_Exclude = explode('.', $Exclusion);
+  
+      if (
+        (($IP_Client[0] == $IP_Exclude[0]) or ($IP_Exclude[0] == '%')) and
+        (!isset($IP_Exclude[1]) or ($IP_Client[1] == $IP_Exclude[1]) or ($IP_Exclude[1] == '%')) and
+        (!isset($IP_Exclude[2]) or ($IP_Client[2] == $IP_Exclude[2]) or ($IP_Exclude[2] == '%')) and
+        (!isset($IP_Exclude[3]) or ($IP_Client[3] == $IP_Exclude[3]) or ($IP_Exclude[3] == '%'))
+      )
+      {
+        $err = l10n('Error_HIPE_BlacklistedIP');
+      }
+    }
+    return $err;
+  }
+}
 ?>
Index: /extensions/nbc_HistoryIPExcluder/trunk/maintain.inc.php
===================================================================
--- /extensions/nbc_HistoryIPExcluder/trunk/maintain.inc.php	(revision 6757)
+++ /extensions/nbc_HistoryIPExcluder/trunk/maintain.inc.php	(revision 6758)
@@ -10,4 +10,16 @@
 INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
 VALUES ("HistoryIPExcluder","","History IP Excluder parameters");
+';
+      
+  pwg_query($q);
+
+$default = array (
+  'Blacklist' => "0",
+  'Version'=> "2.1.1",
+);
+
+  $q = '
+INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+VALUES ("HistoryIPConfig","'.addslashes(serialize($default)).'","History IP Excluder options");
 ';
       
@@ -31,7 +43,21 @@
 	if ($count == 1)
 	{
-  /* upgrade from branch 2.0.0 to 2.0.1 */
+  /* upgrade from branch 2.0.0 to 2.0.1   */
   /* ************************************ */
 		upgrade_200();
+	}
+
+	$query = '
+SELECT param
+  FROM '.CONFIG_TABLE.'
+WHERE param = "HistoryIPConfig"
+;';
+  $count = pwg_db_num_rows(pwg_query($query));
+
+	if ($count == 0)
+	{
+  /* upgrade from branch 2.1.0 to 2.1.1   */
+  /* ************************************ */
+		upgrade_210();
 	}
 }
@@ -42,13 +68,22 @@
   global $conf;
 
-  if (isset($conf['nbc_HistoryIPExcluder']))
+  if (isset($conf['HistoryIPExcluder']))
   {
     $q = '
 DELETE FROM '.CONFIG_TABLE.'
-WHERE param="nbc_HistoryIPExcluder" LIMIT 1;
+WHERE param="HistoryIPExcluder" LIMIT 1;
 ';
 
     pwg_query($q);
   }
+  if (isset($conf['HistoryIPConfig']))
+  {
+    $q = '
+DELETE FROM '.CONFIG_TABLE.'
+WHERE param="HistoryIPConfig" LIMIT 1;
+';
+
+    pwg_query($q);
+  }  
 }
 
@@ -71,4 +106,23 @@
 ;';
   pwg_query($q);
+
+  upgrade_210();
+}
+
+function upgrade_210()
+{
+  global $conf;
+  
+  $default = array (
+    'Blacklist' => "0",
+    'Version'=> "2.1.1",
+  );
+
+  $q = '
+INSERT INTO '.CONFIG_TABLE.' (param,value,comment)
+VALUES ("HistoryIPConfig","'.addslashes(serialize($default)).'","History IP Excluder options");
+';
+      
+  pwg_query($q);
 }
 ?>
