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

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

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