[LON-CAPA-cvs] cvs: loncom /auth lonauth.pm

www lon-capa-cvs@mail.lon-capa.org
Fri, 21 Nov 2003 22:10:25 -0000


www		Fri Nov 21 17:10:25 2003 EDT

  Modified files:              
    /loncom/auth	lonauth.pm 
  Log:
  Bug #2403: document encoding on welcome page.
  
  
Index: loncom/auth/lonauth.pm
diff -u loncom/auth/lonauth.pm:1.59 loncom/auth/lonauth.pm:1.60
--- loncom/auth/lonauth.pm:1.59	Wed Nov 12 11:55:40 2003
+++ loncom/auth/lonauth.pm	Fri Nov 21 17:10:25 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # User Authentication Module
 #
-# $Id: lonauth.pm,v 1.59 2003/11/12 16:55:40 www Exp $
+# $Id: lonauth.pm,v 1.60 2003/11/21 22:10:25 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -184,10 +184,11 @@
     my $setflags=&Apache::lonmenu::setflags();
     my $maincall=&Apache::lonmenu::maincall();
     my $bodytag=&Apache::loncommon::bodytag('Successful Login');
+    my $add=&addcontent();
 # ------------------------------------------------- Output for successful login
 
     $r->send_cgi_header(<<ENDHEADER);
-Content-type: text/html
+Content-type: text/html$add
 Set-cookie: $cookie
 
 ENDHEADER
@@ -220,8 +221,9 @@
 sub failed {
     my ($r,$message) = @_;
     my $bodytag=&Apache::loncommon::bodytag('Unsuccessful Login');
+    my $add=&addcontent();
     $r->send_cgi_header(<<ENDFHEADER);
-Content-type: text/html
+Content-type: text/html$add
 
 ENDFHEADER
     $r->print(<<ENDFAILED);
@@ -239,6 +241,17 @@
 </body>
 </html>
 ENDFAILED
+}
+
+# --------------------------------------------------------------------- Charset
+
+sub addcontent {
+    my $encoding=&Apache::lonlocal::current_encoding;
+    if ($encoding) {
+	return '; charset='.$encoding;
+    } else {
+	return '';
+    }
 }
 
 # ------------------------------------------------------------------ Rerouting!