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

raeburn raeburn at source.lon-capa.org
Wed Apr 18 14:57:34 EDT 2012


raeburn		Wed Apr 18 18:57:34 2012 EDT

  Modified files:              
    /loncom/auth	lonlogin.pm 
  Log:
  - Fix indents so code is easier to read.
    (standard LON-CAPA indent is 4 spaces).
  
  
-------------- next part --------------
Index: loncom/auth/lonlogin.pm
diff -u loncom/auth/lonlogin.pm:1.150 loncom/auth/lonlogin.pm:1.151
--- loncom/auth/lonlogin.pm:1.150	Wed Apr 11 11:40:07 2012
+++ loncom/auth/lonlogin.pm	Wed Apr 18 18:57:34 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Login Screen
 #
-# $Id: lonlogin.pm,v 1.150 2012/04/11 11:40:07 goltermann Exp $
+# $Id: lonlogin.pm,v 1.151 2012/04/18 18:57:34 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -229,23 +229,23 @@
         if ($spares) {
             $spares.= '<br />';
         }
-my %all_hostnames = &Apache::lonnet::all_hostnames();
-foreach my $hostid (sort
+        my %all_hostnames = &Apache::lonnet::all_hostnames();
+        foreach my $hostid (sort
 		    {
 			&Apache::lonnet::hostname($a) cmp
 			    &Apache::lonnet::hostname($b);
 		    }
 		    keys(%all_hostnames)) {
-    next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid});
-    my $hostname = &Apache::lonnet::hostname($hostid);
-    next if (($last eq $hostname) || ($hostname eq ''));
-    $spares.='<br /><a href="http://'.
-	$hostname.
-	'/adm/login?domain='.$authdomain.'">'.
-	$hostname.'</a>';
-    $last=$hostname;
-}
-$r->print(
+            next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid});
+            my $hostname = &Apache::lonnet::hostname($hostid);
+            next if (($last eq $hostname) || ($hostname eq ''));
+            $spares.='<br /><a href="http://'.
+	             $hostname.
+	             '/adm/login?domain='.$authdomain.'">'.
+	             $hostname.'</a>';
+            $last=$hostname;
+         }
+         $r->print(
    '<html>'
   .'<head><title>'
   .&mt('The LearningOnline Network with CAPA')
@@ -254,48 +254,48 @@
   .'<h1>'.&mt('The LearningOnline Network with CAPA').'</h1>'
   .'<img src="/adm/lonKaputt/lonlogo_broken.gif" align="right" />'
   .'<h3>'.&mt('This LON-CAPA server is temporarily not available for login.').'</h3>');
-    if ($spares) {
-        $r->print('<p>'.&mt('Please attempt to login to one of the following servers:')
-                 .'</p>'
-                 .$spares);
-    }
-    $r->print('</body>'
-  .'</html>'
-    );
-return OK;
-}
+        if ($spares) {
+            $r->print('<p>'.&mt('Please attempt to login to one of the following servers:')
+                     .'</p>'
+                     .$spares);
+        }
+        $r->print('</body>'
+                 .'</html>'
+        );
+        return OK;
+    }
 
 # ----------------------------------------------- Apparently we are in business
-$servadm=~s/\,/\<br \/\>/g;
+    $servadm=~s/\,/\<br \/\>/g;
 
 # ----------------------------------------------------------- Front page design
-my $pgbg=&Apache::loncommon::designparm('login.pgbg',$domain);
-my $font=&Apache::loncommon::designparm('login.font',$domain);
-my $link=&Apache::loncommon::designparm('login.link',$domain);
-my $vlink=&Apache::loncommon::designparm('login.vlink',$domain);
-my $alink=&Apache::loncommon::designparm('login.alink',$domain);
-my $mainbg=&Apache::loncommon::designparm('login.mainbg',$domain);
-my $loginbox_bg=&Apache::loncommon::designparm('login.sidebg',$domain);
-my $loginbox_header_bgcol=&Apache::loncommon::designparm('login.bgcol',$domain);
-my $loginbox_header_textcol=&Apache::loncommon::designparm('login.textcol',$domain);
-my $logo=&Apache::loncommon::designparm('login.logo',$domain);
-my $img=&Apache::loncommon::designparm('login.img',$domain);
-my $domainlogo=&Apache::loncommon::domainlogo($domain);
-my $showbanner = 1;
-my $showmainlogo = 1;
-if (defined(&Apache::loncommon::designparm('login.showlogo_img',$domain))) {
-    $showbanner = &Apache::loncommon::designparm('login.showlogo_img',$domain);
-}
-if (defined(&Apache::loncommon::designparm('login.showlogo_logo',$domain))) {
-    $showmainlogo = &Apache::loncommon::designparm('login.showlogo_logo',$domain);
-}
-my $showadminmail=&Apache::loncommon::designparm('login.adminmail',$domain);
-my $showcoursecat =
-&Apache::loncommon::designparm('login.coursecatalog',$domain);
-my $shownewuserlink = 
-&Apache::loncommon::designparm('login.newuser',$domain);
-my $now=time;
-my $js = (<<ENDSCRIPT);
+    my $pgbg=&Apache::loncommon::designparm('login.pgbg',$domain);
+    my $font=&Apache::loncommon::designparm('login.font',$domain);
+    my $link=&Apache::loncommon::designparm('login.link',$domain);
+    my $vlink=&Apache::loncommon::designparm('login.vlink',$domain);
+    my $alink=&Apache::loncommon::designparm('login.alink',$domain);
+    my $mainbg=&Apache::loncommon::designparm('login.mainbg',$domain);
+    my $loginbox_bg=&Apache::loncommon::designparm('login.sidebg',$domain);
+    my $loginbox_header_bgcol=&Apache::loncommon::designparm('login.bgcol',$domain);
+    my $loginbox_header_textcol=&Apache::loncommon::designparm('login.textcol',$domain);
+    my $logo=&Apache::loncommon::designparm('login.logo',$domain);
+    my $img=&Apache::loncommon::designparm('login.img',$domain);
+    my $domainlogo=&Apache::loncommon::domainlogo($domain);
+    my $showbanner = 1;
+    my $showmainlogo = 1;
+    if (defined(&Apache::loncommon::designparm('login.showlogo_img',$domain))) {
+        $showbanner = &Apache::loncommon::designparm('login.showlogo_img',$domain);
+    }
+    if (defined(&Apache::loncommon::designparm('login.showlogo_logo',$domain))) {
+        $showmainlogo = &Apache::loncommon::designparm('login.showlogo_logo',$domain);
+    }
+    my $showadminmail=&Apache::loncommon::designparm('login.adminmail',$domain);
+    my $showcoursecat =
+        &Apache::loncommon::designparm('login.coursecatalog',$domain);
+    my $shownewuserlink = 
+        &Apache::loncommon::designparm('login.newuser',$domain);
+    my $now=time;
+    my $js = (<<ENDSCRIPT);
 
 <script type="text/javascript" language="JavaScript">
 // <![CDATA[
@@ -339,7 +339,7 @@
 
 # --------------------------------------------------- Print login screen header
 
-my %add_entries = (
+    my %add_entries = (
 	       bgcolor      => "$mainbg",
 	       text         => "$font",
 	       link         => "$link",
@@ -347,14 +347,14 @@
 	       alink        => "$alink",
                onload       => 'javascript:enableInput();',);
 
-$r->print(&Apache::loncommon::start_page('The LearningOnline Network with CAPA Login',$js,
+    $r->print(&Apache::loncommon::start_page('The LearningOnline Network with CAPA Login',$js,
 			       { 'redirect'       => [$expire,'/adm/roles'], 
 				 'add_entries' => \%add_entries,
 				 'only_body'   => 1,}));
 
 # ----------------------------------------------------------------------- Texts
 
-my %lt=&Apache::lonlocal::texthash(
+    my %lt=&Apache::lonlocal::texthash(
           'un'       => 'Username',
           'pw'       => 'Password',
           'dom'      => 'Domain',
@@ -372,29 +372,24 @@
        );
 # -------------------------------------------------- Change password field name
 
-my $forgotpw = &forgotpwdisplay(%lt);
-$forgotpw .= '<br />' if $forgotpw;
-my $loginhelp = &loginhelpdisplay($authdomain,%lt);
-$loginhelp .= '<br />' if $loginhelp;
+    my $forgotpw = &forgotpwdisplay(%lt);
+    $forgotpw .= '<br />' if $forgotpw;
+    my $loginhelp = &loginhelpdisplay($authdomain,%lt);
+    $loginhelp .= '<br />' if $loginhelp;
 
 # ---------------------------------------------------- Serve out DES JavaScript
-{
-my $jsh=Apache::File->new($include."/londes.js");
-$r->print(<$jsh>);
-}
+    {
+    my $jsh=Apache::File->new($include."/londes.js");
+    $r->print(<$jsh>);
+    }
 # ---------------------------------------------------------- Serve rest of page
 
-$r->print(
+    $r->print(
     '<div class="LC_Box"'
    .' style="margin:0 auto; padding:10px; width:90%; height: auto; background-color:#FFFFFF;">'
 );
 
-#
-#  If the loadbalancing yielded just http:// because perhaps there's no loadbalancing?
-#  then just us a relative link to authenticate:
-#
-
-$r->print(<<ENDSERVERFORM);
+    $r->print(<<ENDSERVERFORM);
 <form name="server" action="/adm/authenticate" method="post" target="_top">
    <input type="hidden" name="logtoken" value="$logtoken" />
    <input type="hidden" name="serverid" value="$lonhost" />
@@ -407,29 +402,29 @@
    <input type="hidden" name="localres" value="$env{'form.localres'}" />
   </form>
 ENDSERVERFORM
-my $coursecatalog;
-if (($showcoursecat eq '') || ($showcoursecat)) {
-    $coursecatalog = &coursecatalog_link($lt{'catalog'}).'<br />';
-}
-my $newuserlink;
-if ($shownewuserlink) {
-    $newuserlink = &newuser_link($lt{'newuser'}).'<br />';
-}
-my $logintitle =
-    '<h2 class="LC_hcell"'
-   .' style="background:'.$loginbox_header_bgcol.';'
-   .' color:'.$loginbox_header_textcol.'">'
-   .$lt{'log'}
-   .'</h2>';
-
-my $noscript_warning='<noscript><span class="LC_warning"><b>'
-                     .&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.')
-                    .'</b></span></noscript>';
-my $helpdeskscript;
-my $contactblock = &contactdisplay(\%lt,$servadm,$showadminmail,
-                                   $authdomain,\$helpdeskscript);
+    my $coursecatalog;
+    if (($showcoursecat eq '') || ($showcoursecat)) {
+        $coursecatalog = &coursecatalog_link($lt{'catalog'}).'<br />';
+    }
+    my $newuserlink;
+    if ($shownewuserlink) {
+        $newuserlink = &newuser_link($lt{'newuser'}).'<br />';
+    }
+    my $logintitle =
+        '<h2 class="LC_hcell"'
+       .' style="background:'.$loginbox_header_bgcol.';'
+       .' color:'.$loginbox_header_textcol.'">'
+       .$lt{'log'}
+       .'</h2>';
+
+    my $noscript_warning='<noscript><span class="LC_warning"><b>'
+                        .&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.')
+                        .'</b></span></noscript>';
+    my $helpdeskscript;
+    my $contactblock = &contactdisplay(\%lt,$servadm,$showadminmail,
+                                       $authdomain,\$helpdeskscript);
 
-my $loginform=(<<LFORM);
+    my $loginform=(<<LFORM);
 <form name="client" action="" onsubmit="return(send())">
   <input type="hidden" name="lextkey" value="$lextkey" />
   <input type="hidden" name="uextkey" value="$uextkey" />
@@ -533,7 +528,7 @@
 END
     }
 
-$r->print(<<ENDDOCUMENT);
+    $r->print(<<ENDDOCUMENT);
     <div style="float: left;">
      <table border="0" cellspacing="0" cellpadding="0">
 $domainrow


More information about the LON-CAPA-cvs mailing list