// -*- c++ -*- if ($have_get_login == "") { $have_get_login = "1"; if ($maintdir == "") $maintdir = ".."; require("$maintdir/constants.php3"); require("$authdir/constants.php3"); require("$classdir/User.php3"); // Function to retrieve the user record if they are logged in, or // do an error if they are not. Stores resulting user in global // $theUser function get_login($do_msg) { global $cookieName; global $$cookieName; # Wow. Weird! global $theUser; global $authdir; static $set = false; if ($set) return; if ($$cookieName <> "") { $theUser = lookupCookie($$cookieName); } else { $theUser = new User_lsc(""); } $set = true; # If we just wanted to fill $theUser and not do anything else, return if (!$do_msg) return; # Otherwise, check on the status if (!$theUser->isValid()) { ?>
Sorry, you are not logged in to this server. You must login before you can use this service. print("
Llamas can login here.\n"); ?> exit; } else if ($theUser->isCookieExpired()) { ?>
Sorry, your login has expired. You must re-login. exit; } else if ($theUser->isPwExpired()) { ?>
Sorry, your password has expired. You must contact the system head Llama to renew your password before you can login again. exit; } } }