Annotation of loncom/auth/lonlogin.pm, revision 1.1.1.1

1.1       albertel    1: # The LearningOnline Network
                      2: # Login Screen
                      3: # 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14 Gerd Kortemeyer
                      4: #
                      5: package Apache::lonlogin;
                      6: 
                      7: use strict;
                      8: use Apache::Constants qw(:common);
                      9: use Apache::File ();
                     10: use Apache::lonnet();
                     11: 
                     12: sub handler {
                     13:     my $r = shift;
                     14:     $r->content_type('text/html');
                     15:     $r->send_http_header;
                     16:     return OK if $r->header_only;
                     17: 
                     18:     my $iconpath= $r->dir_config('lonIconsURL');
                     19:     my $domain  = $r->dir_config('lonDefDomain');
                     20:     my $role    = $r->dir_config('lonRole');
                     21:     my $loadlim = $r->dir_config('lonLoadLim');
                     22:     my $servadm = $r->dir_config('lonAdmEMail');
                     23:     my $sysadm  = $r->dir_config('lonSysEMail');
                     24:     my $lonhost = $r->dir_config('lonHostID');
                     25:     my $tabdir  = $r->dir_config('lonTabDir');
                     26: 
                     27:     my $loadavg;
                     28:    {
                     29:        my $loadfile=Apache::File->new('/proc/loadavg');
                     30:        $loadavg=<$loadfile>;
                     31:    }
                     32:     $loadavg =~ s/\s.*//g;
                     33:     my $loadpercent=100*$loadavg/$loadlim;
                     34: 
                     35:     my $otherserver='';
                     36: # ---------------------------------------- Are we access server and overloaded?
                     37:     if (($role eq 'access') && ($loadpercent>100.0)) {
                     38:         $otherserver=Apache::lonnet::spareserver();
                     39:     }
                     40: # ---------------------------------------------------------- Print login screen
                     41:     $r->print(<<ENDDOCUMENT);
                     42: <html>
                     43: <head>
                     44: <title>The LearningOnline Network Login</title>
                     45: </head>
                     46: <body bgcolor="#FFFFFF">
                     47: <table width=600>
                     48: <tr><td><img src="$iconpath/lonlogo.gif"></td>
                     49: <td bgcolor="#DDDDDD">
                     50:  <form action="$otherserver/adm/authenticate" method="post" target="_top">
                     51:  <table border=2 bgcolor="#BBBBBB">
                     52:  <tr><td>Username:</td><td><input type=text size=10 name=uname></td></tr>
                     53:  <tr><td>Password:</td><td><input type=password size=10 name=upass></td></tr>
                     54:  <tr><td>Domain:</td><td><input type=text size=10 value=$domain name=udom></td>
                     55:  </tr>
                     56:  <tr><td colspan=2><input type=submit value=Login></td></tr>
                     57:  </table>
                     58:  </form><p>
                     59: 
                     60:  <form action="$otherserver/adm/newkey" method="post" target="_top">
                     61:  <table border=2 bgcolor="#BBBBBB">
                     62:  <tr><td>Key:</td><td><input type=text size=22 name=ukey></td></tr>
                     63:  <tr><td>Class:</td><td><input type=password size=10 name=uclass></td></tr>
                     64:  <tr><td>Domain:</td><td><input type=text size=10 value=$domain name=udom></td>
                     65:  </tr><tr><td colspan=2><input type=submit value="Register New Key"></td></tr>
                     66:  </table>
                     67:  </form>
                     68: </td>
                     69: </tr><tr><td bgcolor="#DDDDDD">
                     70: <table border=1 bgcolor="#BBBBBB">
                     71: <tr><td><font size="-2"><b>Domain:</b></font></td>
                     72:     <td><font size="-2"><tt>$domain</tt></font></td>
                     73:     <td rowspan=3><font size="-2"><b>LON System Administration:</b><br>
                     74:                   <tt>$sysadm</tt><br>
                     75:                   <b>Server Administration:</b><br>
                     76:                   <tt>$servadm</tt></font></td></tr>
                     77: <tr><td><font size="-2"><b>Server:</b></font></td>
                     78:     <td><font size="-2"><tt>$lonhost ($role)</tt></font></td></tr>
                     79: <tr><td><font size="-2"><b>Load:</b></font></td>
                     80:     <td><font size="-2"><tt>$loadpercent</tt> percent</font></td></tr>
                     81: </table><p><font size="-1">
                     82: The Learning<i>Online</i> Network is a MSU College of Natural Science 
                     83: collaboration involving Competency Based
                     84: Instruction (<b>CBI</b>), 
                     85: Lecture<i>Online</i> (<b>LOL</b>) and Computer-Assisted Personalized 
                     86: Approach (<b>CAPA</b>).<br>
                     87: Copyright 1999, Michigan State University Board of Trustees</font>
                     88: </td><td>
                     89: <table align=right><tr><td><font size="+1">
                     90: <b>L</b>aboratory for <br><b>I</b>nstructional<br><b>T</b>echnology in<br>
                     91: <b>E</b>ducation</td><td>
                     92: <img src="$iconpath/liteani.gif"></font></td></tr></table></tr></table>
                     93: </body>
                     94: </html>
                     95: ENDDOCUMENT
                     96:     return OK;
                     97: } 
                     98: 
                     99: 1;
                    100: __END__

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>