PageRenderTime 41ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/error.php

https://github.com/steveworkman/Uni-Sport
PHP | 63 lines | 59 code | 4 blank | 0 comment | 3 complexity | 8212e9e15d162d41b0642472b45e1dca MD5 | raw file
Possible License(s): AGPL-1.0, LGPL-2.1
  1. <?php
  2. define('CURR_PAGE', 'home');
  3. define('PAGE_TITLE','Error');
  4. $css = array();
  5. $js = array();
  6. include('inc/unsecure_page.inc.php');
  7. include('inc/indexfunctions.inc.php');
  8. include('inc/header.inc.php');
  9. include('inc/sidebar.inc.php');
  10. switch($_GET['type'])
  11. {
  12. case 'hack':
  13. $smarty->assign('title','Hacking Attempt Detected');
  14. $smarty->assign('text','Ooh, you naughty little munchkin! I saw that!<br />Your hacking attempt has been recorded. DO NOT try it again');
  15. submitlog('Hacking Attempt Detected');
  16. $smarty->display('error.tpl');
  17. break;
  18. case 'auth':
  19. $smarty->assign('title','Authentication Failed');
  20. $smarty->assign('text',"Oops, you don't appear to have the right security level to access that area<br /><br />For some areas of this site, you need to be logged in. Try the box on the left<br /><br />Give the administrator a bell if you think this is wrong.");
  21. $smarty->display('error.tpl');
  22. break;
  23. case 'user':
  24. $smarty->assign('title','Incorrect User');
  25. $smarty->assign('text',"Oh my, it looks like you're trying to edit or delete something you didn't create in the first place!<br /><br />Unless you're an admin, that's a big no no round here. Use the links to take you back from whence you came");
  26. $smarty->display('error.tpl');
  27. break;
  28. case '404':
  29. $smarty->assign('title','Computer says no');
  30. $smarty->assign('text',"Oh no! You've wandered off the beaten path!<br /><br />Never mind, look around for the right link or use the big links at the top to start again");
  31. $smarty->display('error.tpl');
  32. break;
  33. case '401':
  34. $smarty->assign('title','Authorisation Required');
  35. $smarty->assign('text',"It seems like you'll go no further from here, unless you know the password!<br /><br />Refresh the page to try again");
  36. $smarty->display('error.tpl');
  37. break;
  38. case '403':
  39. $smarty->assign('title','Forbidden');
  40. $smarty->assign('text',"Well, now you're in trouble! You've found a forbidden area.<br /><br />Quick! use the links to get back before you're spotted!");
  41. $smarty->display('error.tpl');
  42. break;
  43. case '500':
  44. $smarty->assign('title','Server Problems');
  45. $smarty->assign('text',"This is one of those, it's not you, it's me, moments.<br /><br />We're very sorry that the server has thrown a wobbly, we'll get a new hamster for the wheel in a short while.");
  46. $smarty->display('error.tpl');
  47. break;
  48. default:
  49. $smarty->assign('title','Error');
  50. $smarty->assign('text',"Well done, you've caused a generic error. Either we don't have a name for it yet or you've done so many things wrong we can't count any more<br /><br />If you'd like to let your administrator know how you caused such a thing, we'll name it after you");
  51. $smarty->display('error.tpl');
  52. break;
  53. }
  54. include ('inc/sidebar2.inc.php');
  55. include ('inc/footer.inc.php');
  56. ?>