From 2f05b46ec9944b986f5c8053abf8eab83deca8f0 Mon Sep 17 00:00:00 2001
From: moodler <moodler>
Date: Sun, 16 Feb 2003 09:42:06 +0000
Subject: [PATCH] Added language menus to top of login pages

---
 login/index.php  | 16 +++++++++-------
 login/signup.php |  7 ++++++-
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/login/index.php b/login/index.php
index b663689ce8..4ca7a37825 100644
--- a/login/index.php
+++ b/login/index.php
@@ -57,19 +57,16 @@
 
             if (user_not_fully_set_up($USER)) {
                 $site = get_site();
-                session_write_close();
-                header("Location: $CFG->wwwroot/user/edit.php?id=$USER->id&course=$site->id");
+                redirect("$CFG->wwwroot/user/edit.php?id=$USER->id&course=$site->id");
 
             } else if (empty($SESSION->wantsurl)) {
-                session_write_close();
-                header("Location: $CFG->wwwroot");
+                redirect($CFG->wwwroot);
 
             } else {
                 $wantsurl = $SESSION->wantsurl;
                 unset($SESSION->wantsurl);
                 save_session("SESSION");
-                session_write_close();
-                header("Location: $wantsurl");
+                redirect($wantsurl);
             }
     
             reset_login_count();
@@ -111,9 +108,14 @@
     if (!$site = get_site()) {
         error("No site found!");
     }
+
+    $currlang = current_language();
+    $langs    = get_list_of_languages();
+    $langmenu = popup_form ("$CFG->wwwroot/login/index.php?lang=", $langs, "chooselang", $currlang, "", "", "", true);
+
     $loginsite = get_string("loginsite");
 
-    print_header("$site->fullname: $loginsite", "$loginsite", get_string("login"), $focus); 
+    print_header("$site->fullname: $loginsite", "$loginsite", get_string("login"), $focus, "", true, "<div align=right>$langmenu</div>"); 
     include("index_form.html");
     print_footer();
 
diff --git a/login/signup.php b/login/signup.php
index fd01e23e2e..2f9b12419c 100644
--- a/login/signup.php
+++ b/login/signup.php
@@ -46,7 +46,12 @@
     $newaccount = get_string("newaccount");
     $login = get_string("login");
 
-	print_header($newaccount, $newaccount, "<A HREF=\"index.php\">$login</A> -> $newaccount", $focus);
+    $currlang = current_language();
+    $langs    = get_list_of_languages();
+    $langmenu = popup_form ("$CFG->wwwroot/login/signup.php?lang=", $langs, "chooselang", $currlang, "", "", "", true);
+
+
+	print_header($newaccount, $newaccount, "<A HREF=\"index.php\">$login</A> -> $newaccount", $focus, "", true, "<div align=right>$langmenu</div>");
 	include("signup_form.php");
     print_footer();
 
-- 
2.39.5