Changes to add login/logout button to the right-hand top corner of every page

... this is to help encourage people to log out after a session, especially
on shared or public terminals.
This commit is contained in:
martin 2002-08-17 07:02:35 +00:00
parent 17e5f694a0
commit 4efeb8c3e3
2 changed files with 14 additions and 2 deletions

View file

@ -26,6 +26,14 @@ function print_header ($title="", $heading="", $navigation="", $focus="", $meta=
} else {
$styles = "$CFG->wwwroot/theme/standard/styles.css";
}
if (!$button and $navigation) {
if (isset($USER->id)) {
$button = "<FONT SIZE=2><A HREF=\"$CFG->wwwroot/login/logout.php\">".get_string("logout")."</A></FONT>";
} else {
$button = "<FONT SIZE=2><A HREF=\"$CFG->wwwroot/login\">".get_string("login")."</A></FONT>";
}
}
if (!$cache) { // Do everything we can to prevent clients and proxies caching
@header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");