auth.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. require_once( '../functions/page_header.php' );
  13. /* If a user opens a new session then comes back to this one,
  14. * $base_uri isn't set because it the session is invalid.
  15. */
  16. if (! isset($base_uri)) {
  17. ereg ('(^.*/)[^/]+/[^/]+$', $PHP_SELF, $regs);
  18. $base_uri = $regs[1];
  19. }
  20. function is_logged_in () {
  21. global $squirrelmail_language, $frame_top, $base_uri;
  22. if ( session_is_registered('user_is_logged_in') ) {
  23. return;
  24. }
  25. if (!isset($frame_top) || $frame_top == '' ) {
  26. $frame_top = '_top';
  27. }
  28. set_up_language($squirrelmail_language, true);
  29. displayHtmlHeader( 'SquirrelMail', '', FALSE );
  30. echo "<body bgcolor=\"ffffff\">\n" .
  31. '<br><br><center><b>' .
  32. _("You must be logged in to access this page.").'</b><br><br>' .
  33. "<a href=\"$base_uri" . "src/login.php\" target=\"$frame_top\">"._("Go to the login page")."</a>\n" .
  34. "</center></body></html>\n";
  35. exit;
  36. }
  37. ?>