BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

quick_ban.php 733B

1234567891011121314151617181920212223242526
  1. <?php
  2. #declare(strict_types=1);
  3. if (!check_perms('admin_manage_ipbans')) {
  4. error(403);
  5. }
  6. if (isset($_GET['perform'])) {
  7. $IPA = substr($_GET['ip'], 0, strcspn($_GET['ip'], '.'));
  8. if ($_GET['perform'] == 'delete') {
  9. if (!is_number($_GET['id']) || $_GET['id'] == '') {
  10. error(0);
  11. }
  12. $DB->query('DELETE FROM ip_bans WHERE ID='.$_GET['id']);
  13. $Bans = $Cache->delete_value('ip_bans_'.$IPA);
  14. } elseif ($_GET['perform'] == 'create') {
  15. $Notes = db_string($_GET['notes']);
  16. $IP = Tools::ip_to_unsigned($_GET['ip']); //Sanitized by Validation regex
  17. $DB->query("
  18. INSERT INTO ip_bans (FromIP, ToIP, Reason)
  19. VALUES ('$IP','$IP', '$Notes')");
  20. $Cache->delete_value('ip_bans_'.$IPA);
  21. }
  22. }
  23. ?>