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

raeburn raeburn at source.lon-capa.org
Mon Aug 27 07:55:26 EDT 2012


raeburn		Mon Aug 27 11:55:26 2012 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/auth	lonauth.pm 
  Log:
  - For 2.11
    - Backport 1.122, 1.123.
  
  
Index: loncom/auth/lonauth.pm
diff -u loncom/auth/lonauth.pm:1.121.2.1 loncom/auth/lonauth.pm:1.121.2.2
--- loncom/auth/lonauth.pm:1.121.2.1	Mon Aug  6 23:14:04 2012
+++ loncom/auth/lonauth.pm	Mon Aug 27 11:55:26 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # User Authentication Module
 #
-# $Id: lonauth.pm,v 1.121.2.1 2012/08/06 23:14:04 raeburn Exp $
+# $Id: lonauth.pm,v 1.121.2.2 2012/08/27 11:55:26 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -146,16 +146,20 @@
     my %lt=&Apache::lonlocal::texthash(
 				       'wel' => 'Welcome',
 				       'pro' => 'Login problems?',
-				       'log' => 'loginproblems.html',
 				       );
+    my $loginhelp = &loginhelpdisplay($domain);
+    if ($loginhelp) {
+        $loginhelp = '<p><a href="'.$loginhelp.'">'.$lt{'pro'}.'</a></p>';
+    }
+
     my $welcome = &mt('Welcome to the Learning[_1]Online[_2] Network with CAPA. Please wait while your session is being set up.','<i>','</i>'); 
     $r->print(<<ENDSUCCESS);
 $start_page
 $setflags
 $windowinfo
 <h1>$lt{'wel'}</h1>
-$welcome<p>
-<a href="/adm/$lt{'log'}">$lt{'pro'}</a></p>
+$welcome
+$loginhelp
 $remoteinfo
 $maincall
 $continuelink
@@ -179,13 +183,18 @@
     my $end_page   = &Apache::loncommon::end_page();
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
+    my $loginhelp = &loginhelpdisplay($form->{'udom'});
+    if ($loginhelp) {
+        $loginhelp = '<p><a href="'.$loginhelp.'">'.&mt('Login problems?').'</a></p>';
+    }
+
     $r->print(
        $start_page
       .'<h1>'.&mt('Sorry ...').'</h1>'
       .'<p class="LC_warning">'.&mt($message).'</p>'
       .'<p>'.&mt('Please [_1]log in again[_2].','<a href="'.$retry.'">','</a>')
       .'</p>'
-      .'<p><a href="/adm/loginproblems.html">'.&mt('Login problems?').'</a></p>'
+      .$loginhelp
       .$end_page
     );
  }
@@ -554,6 +563,33 @@
     return $result;
 }
 
+sub loginhelpdisplay {
+    my ($authdomain) = @_;
+    my $login_help = 1;
+    my $lang = &Apache::lonlocal::current_language();
+    if ($login_help) {
+        my $dom = $authdomain;
+        if ($dom eq '') {
+            $dom = &Apache::lonnet::default_login_domain();
+        }
+        my %domconfhash = &Apache::loncommon::get_domainconf($dom);
+        my $loginhelp_url;
+        if ($lang) {
+            $loginhelp_url = $domconfhash{$dom.'.login.helpurl_'.$lang};
+            if ($loginhelp_url ne '') {
+                return $loginhelp_url;
+            }
+        }
+        $loginhelp_url = $domconfhash{$dom.'.login.helpurl_nolang'};
+        if ($loginhelp_url ne '') {
+            return $loginhelp_url;
+        } else {
+            return '/adm/loginproblems.html';
+        }
+    }
+    return;
+}
+
 1;
 __END__
 




More information about the LON-CAPA-cvs mailing list