Oppaitime'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.

index.php 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?
  2. function notify ($Channel, $Message) {
  3. global $LoggedUser;
  4. send_irc("PRIVMSG ".$Channel." :".$Message." error by ".(!empty($LoggedUser['ID']) ? site_url()."user.php?id=".$LoggedUser['ID'] ." (".$LoggedUser['Username'].")" : $_SERVER['REMOTE_ADDR']." (".Tools::geoip($_SERVER['REMOTE_ADDR']).")")." accessing https://".SITE_DOMAIN."".$_SERVER['REQUEST_URI'].(!empty($_SERVER['HTTP_REFERER'])? " from ".$_SERVER['HTTP_REFERER'] : ''));
  5. }
  6. $Errors = array('403','404','413','504');
  7. if (!empty($_GET['e']) && in_array($_GET['e'],$Errors)) {
  8. // Web server error i.e. http://sitename/madeupdocument.php
  9. include($_GET['e'].'.php');
  10. } else {
  11. // Gazelle error (Comes from the error() function)
  12. switch ($Error ?? NAN) {
  13. case '400':
  14. $Title = "Error 400";
  15. $Description = "Bad request.";
  16. notify(STATUS_CHAN,'400');
  17. break;
  18. case '403':
  19. $Title = "Error 403";
  20. $Description = "You just tried to go to a page that you don't have enough permission to view.";
  21. notify(STATUS_CHAN,'403');
  22. break;
  23. case '404':
  24. $Title = "Error 404";
  25. $Description = "You just tried to go to a page that doesn't exist.";
  26. break;
  27. case '0':
  28. $Title = "Invalid Input";
  29. $Description = "Something was wrong with the input provided with your request, and the server is refusing to fulfill it.";
  30. notify(STATUS_CHAN,'PHP-0');
  31. break;
  32. case '-1':
  33. $Title = "Invalid request";
  34. $Description = "Something was wrong with your request, and the server is refusing to fulfill it.";
  35. break;
  36. default:
  37. if (!empty($Error)) {
  38. $Title = 'Error';
  39. $Description = $Error;
  40. } else {
  41. $Title = "Unexpected Error";
  42. $Description = "You have encountered an unexpected error.";
  43. }
  44. }
  45. if ($Log ?? false) {
  46. $Description .= ' <a href="log.php?search='.$Log.'">Search Log</a>';
  47. }
  48. if (empty($NoHTML) && (!isset($Error) || $Error != -1)) {
  49. View::show_header($Title);
  50. ?>
  51. <div class="thin">
  52. <div class="header">
  53. <h2><?=$Title?></h2>
  54. </div>
  55. <div class="box pad">
  56. <p><?=$Description?></p>
  57. </div>
  58. </div>
  59. <?
  60. View::show_footer();
  61. } else {
  62. echo $Description;
  63. }
  64. }