plugins/SpecialAdmin.php
changeset 270 5bcdee999015
parent 256 62ee6685ad18
child 271 f088805540ae
child 272 e0ec986c0af3
equal deleted inserted replaced
269:06db76725891 270:5bcdee999015
  2140           $error = true;
  2140           $error = true;
  2141           break;
  2141           break;
  2142         }
  2142         }
  2143         if ( $type == BAN_IP )
  2143         if ( $type == BAN_IP )
  2144         {
  2144         {
  2145           // parse a range of addresses
  2145           if ( !isset($_POST['regex']) )
  2146           $range = parse_ip_range($entry);
  2146           {
  2147           if ( !$range )
  2147             // as of 1.0.2 parsing is done at runtime
  2148           {
  2148             $entries[] = $entry;
  2149             $error = true;
  2149           }
  2150             echo '<div class="error-box">Malformed IP address expression.</div>';
  2150           else
  2151             break;
  2151           {
  2152           }
  2152             $entries[] = $entry;
  2153           foreach ($range as $ip)
       
  2154           {
       
  2155             $entries[] = $ip;
       
  2156           }
  2153           }
  2157         }
  2154         }
  2158         else
  2155         else
  2159         {
  2156         {
  2160           $entries[] = $entry;
  2157           $entries[] = $entry;
  2202   echo '<h3>Create new ban rule</h3>';
  2199   echo '<h3>Create new ban rule</h3>';
  2203   echo '<form action="'.makeUrl($paths->nslist['Special'].'Administration', 'module='.$paths->cpage['module']).'" method="post">';
  2200   echo '<form action="'.makeUrl($paths->nslist['Special'].'Administration', 'module='.$paths->cpage['module']).'" method="post">';
  2204   ?>
  2201   ?>
  2205   Type: <select name="type"><option value="<?php echo BAN_IP; ?>">IP address</option><option value="<?php echo BAN_USER; ?>">Username</option><option value="<?php echo BAN_EMAIL; ?>">E-mail address</option></select><br />
  2202   Type: <select name="type"><option value="<?php echo BAN_IP; ?>">IP address</option><option value="<?php echo BAN_USER; ?>">Username</option><option value="<?php echo BAN_EMAIL; ?>">E-mail address</option></select><br />
  2206   Rule: <input type="text" name="value" size="30" /><br />
  2203   Rule: <input type="text" name="value" size="30" /><br />
  2207   <small>You can ban multiple IP addresses, users, or e-mail addresses by separating entries with a single comma (User1,User2). Do not put a space after the comma. For IP addresses, you may specify ranges like 172|192.168.4-30|90-167.1-90, which will turn into 172 and 192 . 168 . 4-30 and 90-167 . 1 - 90, which matches 18,899 IP addresses. Don't specify large ranges (like the example one here) at once or you risk temporarily (~60sec) overloading the server.</small><br />
  2204   <small>You can ban multiple IP addresses, users, or e-mail addresses by separating entries with a single comma (User1,User2). Do not put a space after the comma. For IP addresses, you may specify ranges like 172|192.168.4-30|90-167.1-90, which will turn into 172 and 192 . 168 . 4-30 and 90-167 . 1 - 90, which matches 18,899 IP addresses.</small><br />
  2208   Reason to show to the banned user: <textarea name="reason" rows="7" cols="40"></textarea><br />
  2205   Reason to show to the banned user: <textarea name="reason" rows="7" cols="40"></textarea><br />
  2209   <input type="checkbox" name="regex" id="regex" />  <label for="regex">This rule is a regular expression</label> (advanced users only)<br />
  2206   <input type="checkbox" name="regex" id="regex" />  <label for="regex">This rule is a regular expression</label> (advanced users only)<br />
  2210   <input type="submit" style="font-weight: bold;" name="create" value="Create new ban rule" />
  2207   <input type="submit" style="font-weight: bold;" name="create" value="Create new ban rule" />
  2211   <?php
  2208   <?php
  2212   echo '</form>';
  2209   echo '</form>';