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

jms jms@source.lon-capa.org
Fri, 04 Dec 2009 13:50:48 -0000


jms		Fri Dec  4 13:50:48 2009 EDT

  Modified files:              
    /loncom/auth	lonlogin.pm 
  Log:
  Added ability to customize Log-in Help
  
Index: loncom/auth/lonlogin.pm
diff -u loncom/auth/lonlogin.pm:1.130 loncom/auth/lonlogin.pm:1.131
--- loncom/auth/lonlogin.pm:1.130	Tue Dec  1 14:23:49 2009
+++ loncom/auth/lonlogin.pm	Fri Dec  4 13:50:48 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Login Screen
 #
-# $Id: lonlogin.pm,v 1.130 2009/12/01 14:23:49 bisitz Exp $
+# $Id: lonlogin.pm,v 1.131 2009/12/04 13:50:48 jms Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -85,13 +85,21 @@
         if ($env{'form.firsturl'} ne '') {
             $dest = $env{'form.firsturl'}; 
         }
+        
+    my $dom = &Apache::lonnet::default_login_domain();
+    my %helpconfig = &Apache::lonnet::get_dom('configuration',['helpsettings'],$dom);
+    
+    my $loginhelp_page = $helpconfig{'helpsettings'}{'loginhelpurl'};
+    if ($loginhelp_page eq '') {
+		$loginhelp_page = '/adm/loginproblems.html';
+    }
 	$r->print(
                   $start_page
                  .'<h1>'.&mt('You are already logged in!').'</h1>'
                  .'<p>'.&mt('Please either [_1]continue the current session[_2] or [_3]log out[_4].',
                   '<a href="'.$dest.'">','</a>','<a href="/adm/logout">','</a>').'</p>'
-                 .'<p><a href="/adm/loginproblems.html">'.&mt('Login problems?').'</a></p>'
-                 .$end_page
+                 .'<p><a href="'.$loginhelp_page.'">'.&mt('Login problems?').'</a></p>'
+                 .$dom.' '.$end_page
                  );
         return OK;
     }
@@ -353,6 +361,7 @@
           'newuser'  => 'New User?',
        );
 # -------------------------------------------------- Change password field name
+
 my $forgotpw = &forgotpwdisplay(%lt);
 my $loginhelp = &loginhelpdisplay(%lt);
 
@@ -581,7 +590,14 @@
     my (%lt) = @_;
     my $login_help = 1;
     if ($login_help) {
-        return '<a href="/adm/loginproblems.html">'.$lt{'help'}.'</a>';
+    	my $dom = &Apache::lonnet::default_login_domain();
+		my %helpconfig = &Apache::lonnet::get_dom('configuration',['helpsettings'],$dom);
+		my $loginhelp_url = $helpconfig{'helpsettings'}{'loginhelpurl'};
+		if ($loginhelp_url ne '') {
+        	return '<a href="'.$loginhelp_url.'">'.$lt{'help'}.'</a>';
+        } else {
+        	return '<a href="/adm/loginproblems.html">'.$lt{'help'}.'</a>';
+       	}
     }
     return;
 }