auth.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 ( session_is_registered('user_is_logged_in') ) {
  14. return;
  15. } else {
  16. global $HTTP_POST_VARS, $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 = $HTTP_POST_VARS;
  22. $session_expired_location = $PHP_SELF;
  23. if (!session_is_registered('session_expired_post')) {
  24. session_register('session_expired_post');
  25. }
  26. if (!session_is_registered('session_expired_location')) {
  27. session_register('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. ?>