Controller_Logout.class.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /**
  3. * Controller for logout
  4. *
  5. * @author Christopher Han <xiphux@gmail.com>
  6. * @copyright Copyright (c) 2012 Christopher Han
  7. * @package GitPHP
  8. * @subpackage Controller
  9. */
  10. class GitPHP_Controller_Logout extends GitPHP_ControllerBase
  11. {
  12. /**
  13. * Initialize controller
  14. */
  15. public function Initialize()
  16. {
  17. $this->InitializeUserList();
  18. }
  19. /**
  20. * Gets the template for this controller
  21. *
  22. * @return string template filename
  23. */
  24. protected function GetTemplate()
  25. {
  26. }
  27. /**
  28. * Gets the cache key for this controller
  29. *
  30. * @return string cache key
  31. */
  32. protected function GetCacheKey()
  33. {
  34. }
  35. /**
  36. * Gets the name of this controller's action
  37. *
  38. * @param boolean $local true if caller wants the localized action name
  39. * @return string action name
  40. */
  41. public function GetName($local = false)
  42. {
  43. return 'logout';
  44. }
  45. /**
  46. * Loads headers for this template
  47. */
  48. protected function LoadHeaders()
  49. {
  50. if (!empty($_SESSION['gitphpuser'])) {
  51. unset($_SESSION['gitphpuser']);
  52. }
  53. if (!empty($_SERVER['HTTP_REFERER'])) {
  54. $this->headers[] = 'Location: ' . $_SERVER['HTTP_REFERER'];
  55. } else {
  56. $this->headers[] = 'Location: ' . $this->router->GetUrl(array(), true);
  57. }
  58. }
  59. /**
  60. * Loads data for this template
  61. */
  62. protected function LoadData()
  63. {
  64. }
  65. /**
  66. * Renders the output
  67. */
  68. public function Render()
  69. {
  70. }
  71. }