plugins/SpecialAdmin.php
changeset 271 f088805540ae
parent 266 917dcc6c4ceb
parent 270 5bcdee999015
child 279 8acd77a6c19d
equal deleted inserted replaced
266:917dcc6c4ceb 271:f088805540ae
  2226           $error = true;
  2226           $error = true;
  2227           break;
  2227           break;
  2228         }
  2228         }
  2229         if ( $type == BAN_IP )
  2229         if ( $type == BAN_IP )
  2230         {
  2230         {
  2231           // parse a range of addresses
  2231           if ( !isset($_POST['regex']) )
  2232           $range = parse_ip_range($entry);
  2232           {
  2233           if ( !$range )
  2233             // as of 1.0.2 parsing is done at runtime
  2234           {
  2234             $entries[] = $entry;
  2235             $error = true;
  2235           }
  2236             echo '<div class="error-box">Malformed IP address expression.</div>';
  2236           else
  2237             break;
  2237           {
  2238           }
  2238             $entries[] = $entry;
  2239           foreach ($range as $ip)
       
  2240           {
       
  2241             $entries[] = $ip;
       
  2242           }
  2239           }
  2243         }
  2240         }
  2244         else
  2241         else
  2245         {
  2242         {
  2246           $entries[] = $entry;
  2243           $entries[] = $entry;
  2288   echo '<h3>Create new ban rule</h3>';
  2285   echo '<h3>Create new ban rule</h3>';
  2289   echo '<form action="'.makeUrl($paths->nslist['Special'].'Administration', 'module='.$paths->cpage['module']).'" method="post">';
  2286   echo '<form action="'.makeUrl($paths->nslist['Special'].'Administration', 'module='.$paths->cpage['module']).'" method="post">';
  2290   ?>
  2287   ?>
  2291   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 />
  2288   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 />
  2292   Rule: <input type="text" name="value" size="30" /><br />
  2289   Rule: <input type="text" name="value" size="30" /><br />
  2293   <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 />
  2290   <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 />
  2294   Reason to show to the banned user: <textarea name="reason" rows="7" cols="40"></textarea><br />
  2291   Reason to show to the banned user: <textarea name="reason" rows="7" cols="40"></textarea><br />
  2295   <input type="checkbox" name="regex" id="regex" />  <label for="regex">This rule is a regular expression</label> (advanced users only)<br />
  2292   <input type="checkbox" name="regex" id="regex" />  <label for="regex">This rule is a regular expression</label> (advanced users only)<br />
  2296   <input type="submit" style="font-weight: bold;" name="create" value="Create new ban rule" />
  2293   <input type="submit" style="font-weight: bold;" name="create" value="Create new ban rule" />
  2297   <?php
  2294   <?php
  2298   echo '</form>';
  2295   echo '</form>';