Unsupported scripts and control panel web app for a hosting company
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

adminipbans.php 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?PHP
  2. if (!defined('LIB_DATABASE')) { require_once('lib/database.php'); }
  3. if (!defined('LIB_COMMON')) { require_once('lib/common.php'); }
  4. if (!defined('ADMIN') || !ADMIN) { die('Admins only'); }
  5. ?>
  6. <div class="block" id="users">
  7. <h2>ADMIN: IP Bans</h2>
  8. <table class="innerblock">
  9. <tr>
  10. <th>&nbsp;</th>
  11. <th>IP</th>
  12. <th>Reason</th>
  13. <th>Expires in</th>
  14. <th>Actions</th>
  15. </tr>
  16. <?PHP
  17. $i = 0;
  18. $sql = 'SELECT ipban_id, ipban_ip, ipban_expires, ipban_message FROM ipbans';
  19. $res = mysql_query($sql) or mf(__FILE__, __LINE__, $sql);
  20. if (mysql_num_rows($res) == 0) {
  21. echo '<tr><td colspan="5" style="text-align: center; font-style: italic;">';
  22. echo 'No IP bans</td></tr>';
  23. }
  24. while ($row = mysql_fetch_array($res)) {
  25. ?>
  26. <tr class="<?PHP echo ($i == 0) ? 'even' : 'odd'; ?>">
  27. <td><?PHP echo $row['ipban_id']; ?>.</td>
  28. <td><?PHP echo h($row['ipban_ip']); ?></td>
  29. <td><?PHP echo h($row['ipban_message']); ?></td>
  30. <?PHP
  31. if ($row['ipban_expires'] < time()) {
  32. echo '<td style="color: red;">Expired</td><td>-</td>';
  33. } else {
  34. echo '<td>'.duration($row['ipban_expires'] - time()).'</td>';
  35. ?>
  36. <td>
  37. <a href="<?PHP echo CP_PATH; ?>bans/<?PHP echo $row['ipban_id']; ?>">
  38. Remove
  39. </a>
  40. </td>
  41. <?PHP
  42. }
  43. ?>
  44. </tr>
  45. <?PHP
  46. $i = 1 - $i;
  47. }
  48. ?>
  49. </table>
  50. </div>