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

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.5     ! www         4: # 1/14/00,5/29,5/30,6/1 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='';
1.5     ! www        37:     my $firsturl=$ENV{'request.firsturl'};
1.1       albertel   38: # ---------------------------------------- Are we access server and overloaded?
                     39:     if (($role eq 'access') && ($loadpercent>100.0)) {
                     40:         $otherserver=Apache::lonnet::spareserver();
                     41:     }
                     42: # ---------------------------------------------------------- Print login screen
                     43:     $r->print(<<ENDDOCUMENT);
                     44: <html>
                     45: <head>
1.2       www        46: <title>The LearningOnline Network with CAPA Login</title>
1.1       albertel   47: </head>
                     48: <body bgcolor="#FFFFFF">
                     49: <table width=600>
                     50: <tr><td><img src="$iconpath/lonlogo.gif"></td>
                     51: <td bgcolor="#DDDDDD">
1.2       www        52: <font size=+1><b>User Authentication</b></font><p>
                     53: 
1.1       albertel   54:  <form action="$otherserver/adm/authenticate" method="post" target="_top">
                     55:  <table border=2 bgcolor="#BBBBBB">
                     56:  <tr><td>Username:</td><td><input type=text size=10 name=uname></td></tr>
                     57:  <tr><td>Password:</td><td><input type=password size=10 name=upass></td></tr>
                     58:  <tr><td>Domain:</td><td><input type=text size=10 value=$domain name=udom></td>
                     59:  </tr>
                     60:  <tr><td colspan=2><input type=submit value=Login></td></tr>
                     61:  </table>
1.5     ! www        62:  <input type=hidden name=firsturl value="$firsturl">
1.1       albertel   63:  </form>
                     64: </td>
                     65: </tr><tr><td bgcolor="#DDDDDD">
                     66: <table border=1 bgcolor="#BBBBBB">
1.2       www        67: <tr><td><font size="-1"><b>Domain:</b></font></td>
                     68:     <td><font size="-1"><tt>$domain</tt></font></td>
                     69:     <td rowspan=3><font size="-1"><b>LON System Administration:</b><br>
1.1       albertel   70:                   <tt>$sysadm</tt><br>
                     71:                   <b>Server Administration:</b><br>
                     72:                   <tt>$servadm</tt></font></td></tr>
1.2       www        73: <tr><td><font size="-1"><b>Server:</b></font></td>
                     74:     <td><font size="-1"><tt>$lonhost ($role)</tt></font></td></tr>
                     75: <tr><td><font size="-1"><b>Load:</b></font></td>
                     76:     <td><font size="-1"><tt>$loadpercent</tt> percent</font></td></tr>
                     77: </table>
1.1       albertel   78: </td><td>
                     79: <table align=right><tr><td><font size="+1">
1.3       www        80: <b>L</b>aboratory&nbsp;for<br>
                     81: <b>I</b>nstructional<br>
                     82: <b>T</b>echnology&nbsp;in<br>
1.1       albertel   83: <b>E</b>ducation</td><td>
1.4       www        84: <img src="$iconpath/liteani.gif"></font></td></tr></table></td></tr></table>
1.1       albertel   85: </body>
                     86: </html>
                     87: ENDDOCUMENT
                     88:     return OK;
                     89: } 
                     90: 
                     91: 1;
                     92: __END__

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