auth.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * auth.php
  4. *
  5. * Copyright (c) 1999-2002 The SquirrelMail Project Team
  6. * Licensed under the GNU GPL. For full terms see the file COPYING.
  7. *
  8. * Contains functions used to do authentication.
  9. *
  10. * $Id$
  11. */
  12. function is_logged_in() {
  13. if ( sqsession_is_registered('user_is_logged_in') ) {
  14. return;
  15. } else {
  16. global $PHP_SELF, $session_expired_post,
  17. $session_expired_location;
  18. /* First we store some information in the new session to prevent
  19. * information-loss.
  20. */
  21. $session_expired_post = $_POST;
  22. $session_expired_location = $PHP_SELF;
  23. if (!sqsession_is_registered('session_expired_post')) {
  24. sqsession_register($session_expired_post,'session_expired_post');
  25. }
  26. if (!sqsession_is_registered('session_expired_location')) {
  27. sqsession_register($session_expired_location,'session_expired_location');
  28. }
  29. include_once( '../functions/display_messages.php' );
  30. logout_error( _("You must be logged in to access this page.") );
  31. exit;
  32. }
  33. }
  34. ?>