Diff for /loncom/auth/lonlogin.pm between versions 1.107 and 1.172

version 1.107, 2008/11/22 19:07:02 version 1.172, 2018/01/12 15:26:39
Line 1 Line 1
 # The LearningOnline Network  # The LearningOnline Network
 # Login Screen  # Login Screen
 #  #
 # $Id$  # $Id$
 #  #
 # Copyright Michigan State University Board of Trustees  # Copyright Michigan State University Board of Trustees
 #  #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).  # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
 #  #
 # LON-CAPA is free software; you can redistribute it and/or modify  # LON-CAPA is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by  # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or  # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.  # (at your option) any later version.
 #  #
 # LON-CAPA is distributed in the hope that it will be useful,  # LON-CAPA is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of  # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.  # GNU General Public License for more details.
 #  #
 # You should have received a copy of the GNU General Public License  # You should have received a copy of the GNU General Public License
 # along with LON-CAPA; if not, write to the Free Software  # along with LON-CAPA; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #  #
 # /home/httpd/html/adm/gpl.txt  # /home/httpd/html/adm/gpl.txt
 #  #
 # http://www.lon-capa.org/  # http://www.lon-capa.org/
 #  #
   
 package Apache::lonlogin;  package Apache::lonlogin;
   
 use strict;  use strict;
 use Apache::Constants qw(:common);  use Apache::Constants qw(:common);
 use Apache::File ();  use Apache::File ();
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::loncommon();  use Apache::loncommon();
 use Apache::lonauth();  use Apache::lonauth();
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::migrateuser();  use Apache::migrateuser();
 use lib '/home/httpd/lib/perl/';  use lib '/home/httpd/lib/perl/';
 use LONCAPA;  use LONCAPA;
    use CGI::Cookie();
 sub handler {   
     my $r = shift;  sub handler {
       my $r = shift;
     &Apache::loncommon::get_unprocessed_cgi  
  (join('&',$ENV{'QUERY_STRING'},$env{'request.querystring'},      &Apache::loncommon::get_unprocessed_cgi
       $ENV{'REDIRECT_QUERY_STRING'}),   (join('&',$ENV{'QUERY_STRING'},$env{'request.querystring'},
  ['interface','username','domain','firsturl','localpath','localres',        $ENV{'REDIRECT_QUERY_STRING'}),
   'token']);   ['interface','username','domain','firsturl','localpath','localres',
     if (!defined($env{'form.firsturl'})) {    'token','role','symb','iptoken']);
         &Apache::lonacc::get_posted_cgi($r,['firsturl']);      if (!defined($env{'form.firsturl'})) {
     }          &Apache::lonacc::get_posted_cgi($r,['firsturl']);
       }
 # -- check if they are a migrating user      if (!defined($env{'form.firsturl'})) {
     if (defined($env{'form.token'})) {          if ($ENV{'REDIRECT_URL'} =~ m{^/+tiny/+$LONCAPA::match_domain/+\w+$}) {
  return &Apache::migrateuser::handler($r);              $env{'form.firsturl'} = $ENV{'REDIRECT_URL'};
     }          }
       }
     &Apache::loncommon::no_cache($r);  
     &Apache::lonlocal::get_language_handle($r);  # -- check if they are a migrating user
     &Apache::loncommon::content_type($r,'text/html');      if (defined($env{'form.token'})) {
     $r->send_http_header;   return &Apache::migrateuser::handler($r);
     return OK if $r->header_only;      }
   
   # For "public user" - remove any exising "public" cookie, as user really wants to log-in
 # Are we re-routing?      my ($handle,$lonidsdir,$expirepub,$userdom);
     if (-e '/home/httpd/html/lon-status/reroute.txt') {      unless ($r->header_only) {
  &Apache::lonauth::reroute($r);          $handle = &Apache::lonnet::check_for_valid_session($r,'lonID',undef,\$userdom);
  return OK;          if ($handle ne '') {
     }              $lonidsdir=$r->dir_config('lonIDsDir');
               if ($handle=~/^publicuser\_/) {
                   unlink($r->dir_config('lonIDsDir')."/$handle.id");
 # -------------------------------- Prevent users from attempting to login twice                  undef($handle);
     my $handle = &Apache::lonnet::check_for_valid_session($r);                  undef($userdom);
     if ($handle=~/^publicuser\_/) {                  $expirepub = 1;
 # For "public user" - remove it, we apparently really want to login              }
  unlink($r->dir_config('lonIDsDir')."/$handle.id");          }
     } elsif ($handle ne '') {      }
 # Indeed, a valid token is found  
  my $start_page =       &Apache::loncommon::no_cache($r);
     &Apache::loncommon::start_page('Already logged in');      &Apache::lonlocal::get_language_handle($r);
  my $end_page =       &Apache::loncommon::content_type($r,'text/html');
     &Apache::loncommon::end_page();      if ($expirepub) {
  $r->print(          my $c = new CGI::Cookie(-name    => 'lonPubID',
                   $start_page                                  -value   => '',
                  .'<h1>'.&mt('You are already logged in!').'</h1>'                                  -expires => '-10y',);
                  .'<p>'.&mt('Please either [_1]continue the current session[_2] or [_3]logout[_4].',          $r->header_out('Set-cookie' => $c);
                   '<a href="/adm/roles">','</a>','<a href="/adm/logout">','</a>').'</p>'      } elsif (($handle eq '') && ($userdom ne '')) {
                  .'<p><a href="/adm/loginproblems.html">'.&mt('Login problems?').'</a></p>'          my $c = new CGI::Cookie(-name    => 'lonID',
                  .$end_page                                  -value   => '',
                  );                                  -expires => '-10y',);
         return OK;          $r->headers_out->add('Set-cookie' => $c);
     }      }
       $r->send_http_header;
 # ---------------------------------------------------- No valid token, continue      return OK if $r->header_only;
   
  # ---------------------------- Not possible to really login to domain "public"  
     if ($env{'form.domain'} eq 'public') {  # Are we re-routing?
  $env{'form.domain'}='';      my $londocroot = $r->dir_config('lonDocRoot');
  $env{'form.username'}='';      if (-e "$londocroot/lon-status/reroute.txt") {
     }   &Apache::lonauth::reroute($r);
 # ----------------------------------------------------------- Process Interface   return OK;
     $env{'form.interface'}=~s/\W//g;      }
   
    # my $textbrowsers=$r->dir_config('lonTextBrowsers');  #
     my $httpbrowser=$ENV{"HTTP_USER_AGENT"};  # If browser sent an old cookie for which the session file had been removed
       # check if configuration for user's domain has a portal URL set.  If so
    # foreach (split(/\:/,$textbrowsers)) {  # switch user's log-in to the portal.
 # if ($httpbrowser=~/$_/i) {  #
 #    $env{'form.interface'}='textual';  
 #        }      if (($handle eq '') && ($userdom ne '')) {
 #    }          my %domdefaults = &Apache::lonnet::get_domain_defaults($userdom);
           if ($domdefaults{'portal_def'} =~ /^https?\:/) {
     my $fullgraph=($env{'form.interface'} ne 'textual');              my $start_page = &Apache::loncommon::start_page('Switching Server ...',undef,
                                             {'redirect' => [0,$domdefaults{'portal_def'}],});
     my $iconpath=               my $end_page   = &Apache::loncommon::end_page();
  &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));              $r->print($start_page.$end_page);
               return OK;
     my $domain = &Apache::lonnet::default_login_domain();          }
     if (($env{'form.domain'}) &&       }
  (&Apache::lonnet::domain($env{'form.domain'},'description'))) {  
  $domain=$env{'form.domain'};      $env{'form.firsturl'} =~ s/(`)/'/g;
     }  
     my $role    = $r->dir_config('lonRole');  # -------------------------------- Prevent users from attempting to login twice
     my $loadlim = $r->dir_config('lonLoadLim');      if ($handle ne '') {
     my $servadm = $r->dir_config('lonAdmEMail');          &Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle);
     my $lonhost = $r->dir_config('lonHostID');   my $start_page =
     my $tabdir  = $r->dir_config('lonTabDir');      &Apache::loncommon::start_page('Already logged in');
     my $include = $r->dir_config('lonIncludes');   my $end_page =
     my $expire  = $r->dir_config('lonExpire');      &Apache::loncommon::end_page();
     my $version = $r->dir_config('lonVersion');          my $dest = '/adm/roles';
     my $host_name = &Apache::lonnet::hostname($lonhost);          if ($env{'form.firsturl'} ne '') {
               $dest = $env{'form.firsturl'};
 # --------------------------------------------- Default values for login fields          }
    $r->print(
     my $authusername=($env{'form.username'}?$env{'form.username'}:'');                    $start_page
     my $authdomain=($env{'form.domain'}?$env{'form.domain'}:$domain);                   .'<p class="LC_warning">'.&mt('You are already logged in!').'</p>'
                    .'<p>'.&mt('Please either [_1]continue the current session[_2] or [_3]log out[_4].',
 # ---------------------------------------------------------- Determine own load                    '<a href="'.$dest.'">','</a>','<a href="/adm/logout">','</a>').'</p>'
     my $loadavg;                   .$end_page
     {                   );
  my $loadfile=Apache::File->new('/proc/loadavg');          return OK;
  $loadavg=<$loadfile>;      }
     }  
     $loadavg =~ s/\s.*//g;  # ---------------------------------------------------- No valid token, continue
     my $loadpercent=sprintf("%.1f",100*$loadavg/$loadlim);  
     my $userloadpercent=&Apache::lonnet::userload();  # ---------------------------- Not possible to really login to domain "public"
       if ($env{'form.domain'} eq 'public') {
 # ------------------------------------------------------- Do the load balancing   $env{'form.domain'}='';
     my $otherserver= &Apache::lonnet::absolute_url($host_name);   $env{'form.username'}='';
     my $firsturl=      }
     ($env{'request.firsturl'}?$env{'request.firsturl'}:$env{'form.firsturl'});  
 # ---------------------------------------------------------- Are we overloaded?  # ------ Is this page requested because /adm/migrateuser detected an IP change?
     if ((($userloadpercent>100.0)||($loadpercent>100.0))) {      my %sessiondata;
         my $unloaded=Apache::lonnet::spareserver($loadpercent,$userloadpercent);      if ($env{'form.iptoken'}) {
  if ($unloaded) { $otherserver=$unloaded; }          %sessiondata = &Apache::lonnet::tmpget($env{'form.iptoken'});
     }          unless ($sessiondata{'sessionserver'}) {
               my $delete = &Apache::lonnet::tmpdel($env{'form.iptoken'});
 # ----------------------------------------------------------- Get announcements              delete($env{'form.iptoken'});
     my $announcements=&Apache::lonnet::getannounce();          }
 # -------------------------------------------------------- Set login parameters      }
   # ----------------------------------------------------------- Process Interface
     my @hexstr=('0','1','2','3','4','5','6','7',      $env{'form.interface'}=~s/\W//g;
                 '8','9','a','b','c','d','e','f');  
     my $lkey='';      (undef,undef,undef,undef,undef,undef,my $clientmobile) =
     for (0..7) {          &Apache::loncommon::decode_user_agent();
         $lkey.=$hexstr[rand(15)];  
     }      my $iconpath=
    &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));
     my $ukey='';  
     for (0..7) {      my $lonhost = $r->dir_config('lonHostID');
         $ukey.=$hexstr[rand(15)];      my $domain = &Apache::lonnet::default_login_domain();
     }      my $defdom = $domain;
       if ($lonhost ne '') {
     my $lextkey=hex($lkey);          unless ($sessiondata{'sessionserver'}) {
     if ($lextkey>2147483647) { $lextkey-=4294967296; }              my $redirect = &check_loginvia($domain,$lonhost);
               if ($redirect) {
     my $uextkey=hex($ukey);                  $r->print($redirect);
     if ($uextkey>2147483647) { $uextkey-=4294967296; }                  return OK;
               }
 # -------------------------------------------------------- Store away log token          }
     my $logtoken=Apache::lonnet::reply(      }
        'tmpput:'.$ukey.$lkey.'&'.$firsturl,  
        $lonhost);      if (($sessiondata{'domain'}) &&
           (&Apache::lonnet::domain($env{'form.domain'},'description'))) {
 # ------------------- If we cannot talk to ourselves, we are in serious trouble          $domain=$sessiondata{'domain'};
       } elsif (($env{'form.domain'}) &&
     if ($logtoken eq 'con_lost') {   (&Apache::lonnet::domain($env{'form.domain'},'description'))) {
         my $spares='';   $domain=$env{'form.domain'};
  my $last;      }
         foreach my $hostid (sort  
     {      my $role    = $r->dir_config('lonRole');
  &Apache::lonnet::hostname($a) cmp      my $loadlim = $r->dir_config('lonLoadLim');
     &Apache::lonnet::hostname($b);      my $uloadlim= $r->dir_config('lonUserLoadLim');
     }      my $servadm = $r->dir_config('lonAdmEMail');
     keys(%Apache::lonnet::spareid)) {      my $tabdir  = $r->dir_config('lonTabDir');
             next if ($hostid eq $lonhost);      my $include = $r->dir_config('lonIncludes');
     my $hostname = &Apache::lonnet::hostname($hostid);      my $expire  = $r->dir_config('lonExpire');
     next if ($last eq $hostname);      my $version = $r->dir_config('lonVersion');
             $spares.='<br /><font size="+1"><a href="http://'.      my $host_name = &Apache::lonnet::hostname($lonhost);
                 $hostname.  
                 '/adm/login?domain='.$authdomain.'">'.  # --------------------------------------------- Default values for login fields
                 $hostname.'</a>'.     
                 ' '.&mt('(preferred)').'</font>'.$/;      my ($authusername,$authdomain);
     $last=$hostname;      if ($sessiondata{'username'}) {
         }          $authusername=$sessiondata{'username'};
 $spares.= '<br />';      } else {
 my %all_hostnames = &Apache::lonnet::all_hostnames();          $env{'form.username'} = &Apache::loncommon::cleanup_html($env{'form.username'});
 foreach my $hostid (sort          $authusername=($env{'form.username'}?$env{'form.username'}:'');
     {      }
  &Apache::lonnet::hostname($a) cmp      if ($sessiondata{'domain'}) {
     &Apache::lonnet::hostname($b);          $authdomain=$sessiondata{'domain'};
     }      } else {
     keys(%all_hostnames)) {          $env{'form.domain'} = &Apache::loncommon::cleanup_html($env{'form.domain'});
     next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid});          $authdomain=($env{'form.domain'}?$env{'form.domain'}:$domain);
     my $hostname = &Apache::lonnet::hostname($hostid);      }
     next if ($last eq $hostname);  
     $spares.='<br /><a href="http://'.  # ---------------------------------------------------------- Determine own load
  $hostname.      my $loadavg;
  '/adm/login?domain='.$authdomain.'">'.      {
  $hostname.'</a>';   my $loadfile=Apache::File->new('/proc/loadavg');
     $last=$hostname;   $loadavg=<$loadfile>;
 }      }
 $r->print(      $loadavg =~ s/\s.*//g;
    '<html>'  
   .'<head><title>'      my ($loadpercent,$userloadpercent);
   .&mt('The LearningOnline Network with CAPA')      if ($loadlim) {
   .'</title></head>'          $loadpercent=sprintf("%.1f",100*$loadavg/$loadlim);
   .'<body bgcolor="#FFFFFF">'      }
   .'<h1>'.&mt('The LearningOnline Network with CAPA').'</h1>'      if ($uloadlim) {
   .'<img src="/adm/lonKaputt/lonlogo_broken.gif" align="right" />'          $userloadpercent=&Apache::lonnet::userload();
   .'<h3>'.&mt('This LON-CAPA server is temporarily not available for login.').'</h3>'      }
   .'<p>'.&mt('Please attempt to login to one of the following servers:').'</p>'  
   .$spares      my $firsturl=
   .'</body>'      ($env{'request.firsturl'}?$env{'request.firsturl'}:$env{'form.firsturl'});
   .'</html>'  
 );  # ----------------------------------------------------------- Get announcements
 return OK;      my $announcements=&Apache::lonnet::getannounce();
 }  # -------------------------------------------------------- Set login parameters
   
 # ----------------------------------------------- Apparently we are in business      my @hexstr=('0','1','2','3','4','5','6','7',
 $servadm=~s/\,/\<br \/\>/g;                  '8','9','a','b','c','d','e','f');
       my $lkey='';
 # ----------------------------------------------------------- Front page design      for (0..7) {
 my $pgbg=          $lkey.=$hexstr[rand(15)];
 ($fullgraph?&Apache::loncommon::designparm('login.pgbg',$domain):'#FFFFFF');      }
 my $font=  
 ($fullgraph?&Apache::loncommon::designparm('login.font',$domain):'#000000');      my $ukey='';
 my $link=      for (0..7) {
 ($fullgraph?&Apache::loncommon::designparm('login.link',$domain):'#0000FF');          $ukey.=$hexstr[rand(15)];
 my $vlink=      }
 ($fullgraph?&Apache::loncommon::designparm('login.vlink',$domain):'#0000FF');  
 my $alink=&Apache::loncommon::designparm('login.alink',$domain);      my $lextkey=hex($lkey);
 my $mainbg=      if ($lextkey>2147483647) { $lextkey-=4294967296; }
 ($fullgraph?&Apache::loncommon::designparm('login.mainbg',$domain):'#FFFFFF');  
 my $sidebg=      my $uextkey=hex($ukey);
 ($fullgraph?&Apache::loncommon::designparm('login.sidebg',$domain):'#FFFFFF');      if ($uextkey>2147483647) { $uextkey-=4294967296; }
 my $textcol =   
 ($fullgraph?&Apache::loncommon::designparm('login.textcol',$domain):'#000000');  # -------------------------------------------------------- Store away log token
 my $bgcol =      my $tokenextras;
 ($fullgraph?&Apache::loncommon::designparm('login.bgcol',$domain):'#FFFFFF');      if ($env{'form.role'}) {
 my $logo=&Apache::loncommon::designparm('login.logo',$domain);          $tokenextras = '&role='.&escape($env{'form.role'});
 my $img=&Apache::loncommon::designparm('login.img',$domain);      }
 my $domainlogo=&Apache::loncommon::domainlogo($domain);      if ($env{'form.symb'}) {
 my $login=&Apache::loncommon::designparm('login.login',$domain);          if (!$tokenextras) {
 if ($login eq '') {              $tokenextras = '&';
 $login = $iconpath.'/'.&mt('userauthentication.gif');          }
 }          $tokenextras .= '&symb='.&escape($env{'form.symb'});
 my $showadminmail=&Apache::loncommon::designparm('login.adminmail',$domain);      }
 my $showcoursecat =      if ($env{'form.iptoken'}) {
 &Apache::loncommon::designparm('login.coursecatalog',$domain);          if (!$tokenextras) {
 my $loginheader =&Apache::loncommon::designparm('login.loginheader',$domain);              $tokenextras = '&&';
 my $shownewuserlink =           }
 &Apache::loncommon::designparm('login.newuser',$domain);          $tokenextras .= '&iptoken='.&escape($env{'form.iptoken'});
 my $now=time;      }
 my $js = (<<ENDSCRIPT);      my $logtoken=Apache::lonnet::reply(
          'tmpput:'.$ukey.$lkey.'&'.$firsturl.$tokenextras,
 <script language="JavaScript">         $lonhost);
 function send()  
 {  # -- If we cannot talk to ourselves, or hostID does not map to a hostname
 this.document.server.elements.uname.value  #    we are in serious trouble
 =this.document.client.elements.uname.value;  
       if (($logtoken eq 'con_lost') || ($logtoken eq 'no_such_host')) {
 this.document.server.elements.udom.value          if ($logtoken eq 'no_such_host') {
 =this.document.client.elements.udom.value;              &Apache::lonnet::logthis('No valid logtoken for log-in page -- unable to determine hostname for hostID: '.$lonhost.'. Check entry in hosts.tab');
           }
 uextkey=this.document.client.elements.uextkey.value;          my $spares='';
 lextkey=this.document.client.elements.lextkey.value;   my $last;
 initkeys();          foreach my $hostid (sort
       {
 this.document.server.elements.upass0.value   &Apache::lonnet::hostname($a) cmp
     =crypted(this.document.client.elements.upass$now.value.substr(0,15));      &Apache::lonnet::hostname($b);
 this.document.server.elements.upass1.value      }
     =crypted(this.document.client.elements.upass$now.value.substr(15,15));      keys(%Apache::lonnet::spareid)) {
 this.document.server.elements.upass2.value              next if ($hostid eq $lonhost);
     =crypted(this.document.client.elements.upass$now.value.substr(30,15));      my $hostname = &Apache::lonnet::hostname($hostid);
       next if (($last eq $hostname) || ($hostname eq ''));
 this.document.client.elements.uname.value='';              $spares.='<br /><font size="+1"><a href="http://'.
 this.document.client.elements.upass$now.value='';                  $hostname.
                   '/adm/login?domain='.$authdomain.'">'.
 this.document.server.submit();                  $hostname.'</a>'.
 return false;                  ' '.&mt('(preferred)').'</font>'.$/;
 }      $last=$hostname;
 </script>          }
           if ($spares) {
 ENDSCRIPT              $spares.= '<br />';
           }
 # --------------------------------------------------- Print login screen header          my %all_hostnames = &Apache::lonnet::all_hostnames();
           foreach my $hostid (sort
 my %add_entries = (topmargin    => "0",      {
        leftmargin   => "0",   &Apache::lonnet::hostname($a) cmp
        marginheight => "0",      &Apache::lonnet::hostname($b);
        marginwidth  => "0",      }
        bgcolor      => "$pgbg",      keys(%all_hostnames)) {
        text         => "$font",              next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid});
        link         => "$link",              my $hostname = &Apache::lonnet::hostname($hostid);
        vlink        => "$vlink",              next if (($last eq $hostname) || ($hostname eq ''));
        alink        => "$alink",);              $spares.='<br /><a href="http://'.
                $hostname.
 $r->print(&Apache::loncommon::start_page('The LearningOnline Network with CAPA Login',$js,               '/adm/login?domain='.$authdomain.'">'.
        { 'redirect'       => [$expire,'/adm/roles'],                $hostname.'</a>';
  'add_entries' => \%add_entries,              $last=$hostname;
  'only_body'   => 1,}));           }
            $r->print(
 # ----------------------------------------------------------------------- Texts     '<html>'
     .'<head><title>'
 my %lt=&Apache::lonlocal::texthash(    .&mt('The LearningOnline Network with CAPA')
   'un'  => 'Username',    .'</title></head>'
   'pw'  => 'Password',    .'<body bgcolor="#FFFFFF">'
   'dom' => 'Domain',    .'<h1>'.&mt('The LearningOnline Network with CAPA').'</h1>'
   'perc' => 'percent',    .'<img src="/adm/lonKaputt/lonlogo_broken.gif" align="right" />'
   'load' => 'Server Load',    .'<h3>'.&mt('This LON-CAPA server is temporarily not available for login.').'</h3>');
   'userload' => 'User Load',          if ($spares) {
   'about'  => 'About LON-CAPA',              $r->print('<p>'.&mt('Please attempt to login to one of the following servers:')
   'catalog' => 'Course Catalog',                       .'</p>'
   'log' => 'Log in',                       .$spares);
   'help' => 'Log-in Help',          }
   'serv' => 'Server',          $r->print('</body>'
   'servadm' => 'Server Administration',                   .'</html>'
   'helpdesk' => 'Contact Helpdesk',          );
   'forgotpw' => 'Forgot password?',          return OK;
   'newuser'  => 'New User?',      }
   'options_headline' => 'Select Accessibility Options',  
   'sprs_img' => 'Suppress rendering of images',  # ----------------------------------------------- Apparently we are in business
   'sprs_applet' => 'Suppress Java applets',      $servadm=~s/\,/\<br \/\>/g;
   'sprs_embed' => 'Suppress rendering of embedded multimedia',  
   'sprs_font' => 'Increase font size',  # ----------------------------------------------------------- Front page design
   'sprs_blackwhite' => 'Switch to black and white mode',      my $pgbg=&Apache::loncommon::designparm('login.pgbg',$domain);
   'remember' => 'Remember these settings for next login');      my $font=&Apache::loncommon::designparm('login.font',$domain);
 # -------------------------------------------------- Change password field name      my $link=&Apache::loncommon::designparm('login.link',$domain);
 my $forgotpw = &forgotpwdisplay(%lt);      my $vlink=&Apache::loncommon::designparm('login.vlink',$domain);
 my $loginhelp = &loginhelpdisplay(%lt);      my $alink=&Apache::loncommon::designparm('login.alink',$domain);
       my $mainbg=&Apache::loncommon::designparm('login.mainbg',$domain);
 # ---------------------------------------------------- Serve out DES JavaScript      my $loginbox_bg=&Apache::loncommon::designparm('login.sidebg',$domain);
 {      my $loginbox_header_bgcol=&Apache::loncommon::designparm('login.bgcol',$domain);
 my $jsh=Apache::File->new($include."/londes.js");      my $loginbox_header_textcol=&Apache::loncommon::designparm('login.textcol',$domain);
 $r->print(<$jsh>);      my $logo=&Apache::loncommon::designparm('login.logo',$domain);
 }      my $img=&Apache::loncommon::designparm('login.img',$domain);
 # ---------------------------------------------------------- Serve rest of page      my $domainlogo=&Apache::loncommon::domainlogo($domain);
       my $showbanner = 1;
 if ($fullgraph) {      my $showmainlogo = 1;
 $r->print(      if (defined(&Apache::loncommon::designparm('login.showlogo_img',$domain))) {
   '<div class="LC_loginpage_container">');          $showbanner = &Apache::loncommon::designparm('login.showlogo_img',$domain);
 }      }
       if (defined(&Apache::loncommon::designparm('login.showlogo_logo',$domain))) {
 $r->print(<<ENDSERVERFORM);          $showmainlogo = &Apache::loncommon::designparm('login.showlogo_logo',$domain);
 <form name="server" action="$otherserver/adm/authenticate" method="post" target="_top">      }
    <input type="hidden" name="logtoken" value="$logtoken" />      my $showadminmail;
    <input type="hidden" name="serverid" value="$lonhost" />      my @possdoms = &Apache::lonnet::current_machine_domains();
    <input type="hidden" name="uname" value="" />      if (grep(/^\Q$domain\E$/,@possdoms)) {
    <input type="hidden" name="upass0" value="" />          $showadminmail=&Apache::loncommon::designparm('login.adminmail',$domain);
    <input type="hidden" name="upass1" value="" />      }
    <input type="hidden" name="upass2" value="" />      my $showcoursecat =
    <input type="hidden" name="udom" value="" />          &Apache::loncommon::designparm('login.coursecatalog',$domain);
    <input type="hidden" name="localpath" value="$env{'form.localpath'}" />      my $shownewuserlink =
    <input type="hidden" name="localres" value="$env{'form.localres'}" />          &Apache::loncommon::designparm('login.newuser',$domain);
   </form>      my $showhelpdesk =
 ENDSERVERFORM          &Apache::loncommon::designparm('login.helpdesk',$domain);
     my $coursecatalog;      my $now=time;
     if (($showcoursecat eq '') || ($showcoursecat)) {      my $js = (<<ENDSCRIPT);
         $coursecatalog = &coursecatalog_link($lt{'catalog'});  
     }  <script type="text/javascript" language="JavaScript">
     my $newuserlink;  // <![CDATA[
     if ($shownewuserlink) {  function send()
         $newuserlink = &newuser_link($lt{'newuser'});  {
     }  this.document.server.elements.uname.value
     my $logintitle;  =this.document.client.elements.uname.value;
     if ($loginheader eq 'text') {  
         $logintitle = $lt{'log'};  this.document.server.elements.udom.value
     } else {  =this.document.client.elements.udom.value;
         $logintitle = '<img src="'.$login.'" alt="'.  
                       &mt('User Authentication').'" />';  uextkey=this.document.client.elements.uextkey.value;
     }  lextkey=this.document.client.elements.lextkey.value;
       initkeys();
      my $noscript_warning='<noscript>'  
                         .&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.')  if(this.document.server.action.substr(0,5) === 'http:'){
                         .'</noscript>';      this.document.server.elements.upass0.value
       my $helpdeskscript;          =getCrypted(this.document.client.elements.upass$now.value);
       my $contactblock = &contactdisplay(\%lt,$servadm,$showadminmail,  } else {
                                   $version,$authdomain,\$helpdeskscript);      this.document.server.elements.upass0.value
                            =this.document.client.elements.upass$now.value;
     if ($fullgraph) {   }
     $r->print(<<ENDTOP);  
   <!-- The LON-CAPA Header -->  this.document.client.elements.uname.value='';
 <table border="0" align="left" width="100%" cellspacing="0" cellpadding="1">  this.document.client.elements.upass$now.value='';
 <tr>  
 <td align="left" valign="top" bgcolor="$pgbg"> <img src="$img" border=0 alt="The Learning Online Network with CAPA" /> </td>  this.document.server.submit();
 </tr>  return false;
 </table>  }
   
  <div class="LC_loginpage_space">&nbsp;</div>  function enableInput() {
     <img src="$logo" alt="" />      this.document.client.elements.upass$now.removeAttribute("readOnly");
  <div class="LC_loginpage_loginContainer"><fieldset class="LC_loginpage_fieldset">      this.document.client.elements.uname.removeAttribute("readOnly");
 <legend class="LC_loginpage_legend">$logintitle</legend>      this.document.client.elements.udom.removeAttribute("readOnly");
 <table border="0" align="left" cellspacing="1" cellpadding="1" width="100%">      return;
  <tr>  }
  <td width="50%" align="center" valign="top">$domainlogo</td>  
  <td>  // ]]>
 ENDTOP  </script>
   
 $r->print('<form name="client" onsubmit="return(send())">');  ENDSCRIPT
   
 $r->print(<<ENDTOPP)  # --------------------------------------------------- Print login screen header
  <input type="hidden" name="lextkey" value="$lextkey">  
       <input type="hidden" name="uextkey" value="$uextkey">      my %add_entries = (
       <b><label for="uname">$lt{'un'}</label>:</b><br />         bgcolor      => "$mainbg",
         <input type="text" name="uname" size="10" value="$authusername" /><br />         text         => "$font",
         <b><label for="upass$now">$lt{'pw'}</label>:</b><br />         link         => "$link",
       <input type="password" name="upass$now" size="10" /><br />         vlink        => "$vlink",
       <b><label for="udom">$lt{'dom'}</label>:</b><br />         alink        => "$alink",
         <input type="text" name="udom" size="10" value="$authdomain" /><br />                 onload       => 'javascript:enableInput();',);
         <input type="submit" value="$lt{'log'}" />  
         </form>      my ($lonhost_in_use,$headextra,$headextra_exempt,@hosts,%defaultdomconf);
  </td>      @hosts = &Apache::lonnet::current_machine_ids();
  </tr>      $lonhost_in_use = $lonhost;
 </table>        if (@hosts > 1) {
 $noscript_warning          foreach my $hostid (@hosts) {
 </fieldset></div>              if (&Apache::lonnet::host_domain($hostid) eq $defdom) {
                     $lonhost_in_use = $hostid;
 <div class="LC_loginpage_loginInfo">                  last;
         $loginhelp<br />              }
         $forgotpw<br /><br />          }
         $newuserlink<br />      }
         $coursecatalog<br /><br />      %defaultdomconf = &Apache::loncommon::get_domainconf($defdom);
         <a href="/adm/about.html"><b>$lt{'about'}</b></a><br />      $headextra = $defaultdomconf{$defdom.'.login.headtag_'.$lonhost_in_use};
         $helpdeskscript      $headextra_exempt = $defaultdomconf{$domain.'.login.headtag_exempt_'.$lonhost_in_use};
 </div>      if ($headextra) {
 <div class="LC_loginpage_space">&nbsp;</div>          my $omitextra;
 $announcements          if ($headextra_exempt ne '') {
 ENDTOPP              my @exempt = split(',',$headextra_exempt);
 }              my $ip = $ENV{'REMOTE_ADDR'};
 if($announcements){$r->print('<div class="LC_loginpage_space">&nbsp;</div>');}              if (grep(/^\Q$ip\E$/,@exempt)) {
                   $omitextra = 1;
               }
    if ($fullgraph) {          }
                 unless ($omitextra) {
  $r->print(<<ENDDOCUMENT);              my $confname = $defdom.'-domainconfig';
                  if ($headextra =~ m{^\Q/res/$defdom/$confname/login/headtag/$lonhost_in_use/\E}) {
                   my $extra = &Apache::lonnet::getfile(&Apache::lonnet::filelocation("",$headextra));
      <table border=0 cellspacing=0 cellpadding=0>                  unless ($extra eq '-1') {
       <tr>                      $js .= "\n".$extra."\n";
        <td bgcolor="$sidebg" align="left" valign="top">                  }
         <small><b>&nbsp;&nbsp;&nbsp;$lt{'dom'}:&nbsp;</b></small>              }
        </td>          }
        <td bgcolor="$sidebg" align="left" valign="top">      }
         <small><tt>&nbsp;$domain</tt></small>  
        </td>      $r->print(&Apache::loncommon::start_page('The LearningOnline Network with CAPA Login',$js,
       </tr>         { 'redirect'       => [$expire,'/adm/roles'],
       <tr>   'add_entries' => \%add_entries,
        <td bgcolor="$sidebg" align="left" valign="top">   'only_body'   => 1,}));
         <small><b>&nbsp;&nbsp;&nbsp;$lt{'serv'}:&nbsp;</b></small>  
        </td>  # ----------------------------------------------------------------------- Texts
        <td bgcolor="$sidebg" align="left" valign="top">  
         <small><tt>&nbsp;$lonhost ($role)</tt></small>      my %lt=&Apache::lonlocal::texthash(
        </td>            'un'       => 'Username',
       </tr>            'pw'       => 'Password',
       <tr>            'dom'      => 'Domain',
        <td bgcolor="$sidebg" align="left" valign="top">            'perc'     => 'percent',
         <small><b>&nbsp;&nbsp;&nbsp;$lt{'load'}:&nbsp;</b></small>            'load'     => 'Server Load',
        </td>            'userload' => 'User Load',
        <td bgcolor="$sidebg" align="left" valign="top">            'catalog'  => 'Course/Community Catalog',
         <small><tt>&nbsp;$loadpercent $lt{'perc'}</tt></small>            'log'      => 'Log in',
        </td>            'help'     => 'Log-in Help',
       </tr>            'serv'     => 'Server',
       <tr>            'servadm'  => 'Server Administration',
        <td bgcolor="$sidebg" align="left" valign="top">            'helpdesk' => 'Contact Helpdesk',
         <small><b>&nbsp;&nbsp;&nbsp;$lt{'userload'}:&nbsp;</b></small>            'forgotpw' => 'Forgot password?',
        </td>            'newuser'  => 'New User?',
        <td bgcolor="$sidebg" align="left" valign="top">         );
         <small><tt>&nbsp;$userloadpercent $lt{'perc'}</tt></small>  # -------------------------------------------------- Change password field name
        </td>  
       </tr>      my $forgotpw = &forgotpwdisplay(%lt);
      </table>      $forgotpw .= '<br />' if $forgotpw;
            my $loginhelp = &Apache::lonauth::loginhelpdisplay($authdomain);
     $contactblock      if ($loginhelp) {
           $loginhelp = '<a href="'.$loginhelp.'">'.$lt{'help'}.'</a><br />';
  </div>      }
   
 <script type="text/javascript">  # ---------------------------------------------------- Serve out DES JavaScript
 // the if prevents the script error if the browser can not handle this      {
 if ( document.client.uname ) { document.client.uname.focus(); }      my $jsh=Apache::File->new($include."/londes.js");
 </script>      $r->print(<$jsh>);
 $helpdeskscript      }
   # ---------------------------------------------------------- Serve rest of page
 ENDDOCUMENT  
 }      $r->print(
     my %endargs = ( 'noredirectlink' => 1, );      '<div class="LC_Box"'
     $r->print(&Apache::loncommon::end_page(\%endargs));     .' style="margin:0 auto; padding:10px; width:90%; height: auto; background-color:#FFFFFF;">'
     return OK;  );
 }  
       $r->print(<<ENDSERVERFORM);
 sub contactdisplay {  <form name="server" action="/adm/authenticate" method="post" target="_top">
     my ($lt,$servadm,$showadminmail,$version,$authdomain,$helpdeskscript) = @_;     <input type="hidden" name="logtoken" value="$logtoken" />
     my $contactblock;     <input type="hidden" name="serverid" value="$lonhost" />
     my $showhelpdesk = 0;     <input type="hidden" name="uname" value="" />
     my $requestmail = $Apache::lonnet::perlvar{'lonSupportEMail'};     <input type="hidden" name="upass0" value="" />
     if ($requestmail =~ m/^[^\@]+\@[^\@]+$/) {     <input type="hidden" name="udom" value="" />
         $showhelpdesk = 1;     <input type="hidden" name="localpath" value="$env{'form.localpath'}" />
     }     <input type="hidden" name="localres" value="$env{'form.localres'}" />
     if ($servadm && $showadminmail) {    </form>
         $contactblock .= '<b>&nbsp;&nbsp;&nbsp;'.$$lt{'servadm'}.':</b><br />'.  ENDSERVERFORM
                          '<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$servadm.'</tt><br />&nbsp;<br />';      my $coursecatalog;
     }      if (($showcoursecat eq '') || ($showcoursecat)) {
     if ($showhelpdesk) {          $coursecatalog = &coursecatalog_link($lt{'catalog'}).'<br />';
         $contactblock .= '<b>&nbsp;&nbsp;&nbsp;<a href="javascript:helpdesk()"><font size="+1">'.$lt->{'helpdesk'}.'</font></a></b><br />';      }
         my $thisurl = &escape('/adm/login');      my $newuserlink;
         $$helpdeskscript = <<"ENDSCRIPT";      if ($shownewuserlink) {
 <script type="text/javascript">          $newuserlink = &newuser_link($lt{'newuser'}).'<br />';
 function helpdesk() {      }
     var codedom = document.client.udom.value;      my $logintitle =
     if (codedom == '') {          '<h2 class="LC_hcell"'
         codedom = "$authdomain";         .' style="background:'.$loginbox_header_bgcol.';'
     }         .' color:'.$loginbox_header_textcol.'">'
     var querystr = "origurl=$thisurl&codedom="+codedom;         .$lt{'log'}
     document.location.href = "/adm/helpdesk?"+querystr;         .'</h2>';
     return;  
 }      my $noscript_warning='<noscript><span class="LC_warning"><b>'
 </script>                          .&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.')
 ENDSCRIPT                          .'</b></span></noscript>';
     }      my $helpdeskscript;
     $contactblock .= <<"ENDBLOCK";      my $contactblock = &contactdisplay(\%lt,$servadm,$showadminmail,
      &nbsp;&nbsp;&nbsp;$version                                         $authdomain,\$helpdeskscript,
 ENDBLOCK                                         $showhelpdesk,\@possdoms);
     return $contactblock;  
 }      my $mobileargs;
       if ($clientmobile) {
 sub forgotpwdisplay {          $mobileargs = 'autocapitalize="off" autocorrect="off"';
     my (%lt) = @_;      }
     my $prompt_for_resetpw = 1;       my $loginform=(<<LFORM);
     if ($prompt_for_resetpw) {  <form name="client" action="" onsubmit="return(send())">
         return '<a href="/adm/resetpw">'.$lt{'forgotpw'}.'</a>';    <input type="hidden" name="lextkey" value="$lextkey" />
     }    <input type="hidden" name="uextkey" value="$uextkey" />
     return;    <b><label for="uname">$lt{'un'}</label>:</b><br />
 }    <input type="text" name="uname" id="uname" size="15" value="$authusername" readonly="readonly" $mobileargs /><br />
     <b><label for="upass$now">$lt{'pw'}</label>:</b><br />
 sub loginhelpdisplay {    <input type="password" name="upass$now" id="upass$now" size="15" readonly="readonly" /><br />
     my (%lt) = @_;    <b><label for="udom">$lt{'dom'}</label>:</b><br />
     my $login_help = 1;    <input type="text" name="udom" id="udom" size="15" value="$authdomain" readonly="readonly" $mobileargs /><br />
     if ($login_help) {    <input type="submit" value="$lt{'log'}" />
         return '<a href="/adm/loginproblems.html">'.$lt{'help'}.'</a>';  </form>
     }  LFORM
     return;  
 }      if ($showbanner) {
           $r->print(<<HEADER);
 sub coursecatalog_link {  <!-- The LON-CAPA Header -->
     my ($linkname) = @_;  <div style="background:$pgbg;margin:0;width:100%;">
     return <<"END";    <img src="$img" border="0" alt="The Learning Online Network with CAPA" class="LC_maxwidth" />
       <a href="/adm/coursecatalog">$linkname</a>  </div>
 END  HEADER
 }      }
       $r->print(<<ENDTOP);
 sub newuser_link {  <div style="float:left;margin-top:0;">
     my ($linkname) = @_;  <div class="LC_Box" style="background:$loginbox_bg;">
     return '&nbsp;&nbsp;&nbsp;<a href="/adm/createaccount"><b>'.$linkname.'</b></a><br />';    $logintitle
 }    $loginform
     $noscript_warning
 1;  </div>
 __END__   
   <div class="LC_Box" style="padding-top: 10px;">
     $loginhelp
     $forgotpw
     $contactblock
     $newuserlink
     $coursecatalog
   </div>
   </div>
   
   <div>
   ENDTOP
       if ($showmainlogo) {
           $r->print(' <img src="'.$logo.'" alt="" class="LC_maxwidth" />'."\n");
       }
   $r->print(<<ENDTOP);
   $announcements
   </div>
   <hr style="clear:both;" />
   ENDTOP
       my ($domainrow,$serverrow,$loadrow,$userloadrow,$versionrow);
       $domainrow = <<"END";
         <tr>
          <td  align="left" valign="top">
           <small><b>$lt{'dom'}:&nbsp;</b></small>
          </td>
          <td  align="left" valign="top">
           <small><tt>&nbsp;$domain</tt></small>
          </td>
         </tr>
   END
       $serverrow = <<"END";
         <tr>
          <td  align="left" valign="top">
           <small><b>$lt{'serv'}:&nbsp;</b></small>
          </td>
          <td align="left" valign="top">
           <small><tt>&nbsp;$lonhost ($role)</tt></small>
          </td>
         </tr>
   END
       if ($loadlim) {
           $loadrow = <<"END";
         <tr>
          <td align="left" valign="top">
           <small><b>$lt{'load'}:&nbsp;</b></small>
          </td>
          <td align="left" valign="top">
           <small><tt>&nbsp;$loadpercent $lt{'perc'}</tt></small>
          </td>
         </tr>
   END
       }
       if ($uloadlim) {
           $userloadrow = <<"END";
         <tr>
          <td align="left" valign="top">
           <small><b>$lt{'userload'}:&nbsp;</b></small>
          </td>
          <td align="left" valign="top">
           <small><tt>&nbsp;$userloadpercent $lt{'perc'}</tt></small>
          </td>
         </tr>
   END
       }
       if (($version ne '') && ($version ne '<!-- VERSION -->')) {
           $versionrow = <<"END";
         <tr>
          <td colspan="2" align="left">
           <small>$version</small>
          </td>
         </tr>
   END
       }
   
       $r->print(<<ENDDOCUMENT);
       <div style="float: left;">
        <table border="0" cellspacing="0" cellpadding="0">
   $domainrow
   $serverrow
   $loadrow    
   $userloadrow
   $versionrow
        </table>
       </div>
       <div style="float: right;">
       $domainlogo
       </div>
       <br style="clear:both;" />
    </div>
   
   <script type="text/javascript">
   // <![CDATA[
   // the if prevents the script error if the browser can not handle this
   if ( document.client.uname ) { document.client.uname.focus(); }
   // ]]>
   </script>
   $helpdeskscript
   
   ENDDOCUMENT
       my %endargs = ( 'noredirectlink' => 1, );
       $r->print(&Apache::loncommon::end_page(\%endargs));
       return OK;
   }
   
   sub check_loginvia {
       my ($domain,$lonhost) = @_;
       if ($domain eq '' || $lonhost eq '') {
           return;
       }
       my %domconfhash = &Apache::loncommon::get_domainconf($domain);
       my $loginvia = $domconfhash{$domain.'.login.loginvia_'.$lonhost};
       my $loginvia_exempt = $domconfhash{$domain.'.login.loginvia_exempt_'.$lonhost};
       my $output;
       if ($loginvia ne '') {
           my $noredirect;
           my $ip = $ENV{'REMOTE_ADDR'};
           if ($ip eq '127.0.0.1') {
               $noredirect = 1;
           } else {
               if ($loginvia_exempt ne '') {
                   my @exempt = split(',',$loginvia_exempt);
                   if (grep(/^\Q$ip\E$/,@exempt)) {
                       $noredirect = 1;
                   }
               }
           }
           unless ($noredirect) {
               my ($newhost,$path);
               if ($loginvia =~ /:/) {
                   ($newhost,$path) = split(':',$loginvia);
               } else {
                   $newhost = $loginvia;
               }
               if ($newhost ne $lonhost) {
                   if (&Apache::lonnet::hostname($newhost) ne '') {
                       $output = &redirect_page($newhost,$path);
                   }
               }
           }
       }
       return $output;
   }
   
   sub redirect_page {
       my ($desthost,$path) = @_;
       my $protocol = $Apache::lonnet::protocol{$desthost};
       $protocol = 'http' if ($protocol ne 'https');
       unless ($path =~ m{^/}) {
           $path = '/'.$path;
       }
       my $url = $protocol.'://'.&Apache::lonnet::hostname($desthost).$path;
       if ($env{'form.firsturl'} ne '') {
           $url .='?firsturl='.$env{'form.firsturl'};
       }
       my $start_page = &Apache::loncommon::start_page('Switching Server ...',undef,
                                                       {'redirect' => [0,$url],});
       my $end_page   = &Apache::loncommon::end_page();
       return $start_page.$end_page;
   }
   
   sub contactdisplay {
       my ($lt,$servadm,$showadminmail,$authdomain,$helpdeskscript,$showhelpdesk,
           $possdoms) = @_;
       my $contactblock;
       my $origmail;
       if (ref($possdoms) eq 'ARRAY') {
           if (grep(/^\Q$authdomain\E$/,@{$possdoms})) {
               $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'};
           }
       }
       my $requestmail =
           &Apache::loncommon::build_recipient_list(undef,'helpdeskmail',
                                                    $authdomain,$origmail);
       unless ($showhelpdesk eq '0') {
           if ($requestmail =~ m/[^\@]+\@[^\@]+/) {
               $showhelpdesk = 1;
           } else {
               $showhelpdesk = 0;
           }
       }
       if ($servadm && $showadminmail) {
           $contactblock .= $$lt{'servadm'}.':<br />'.
                            '<tt>'.$servadm.'</tt><br />';
       }
       if ($showhelpdesk) {
           $contactblock .= '<a href="javascript:helpdesk()">'.$lt->{'helpdesk'}.'</a><br />';
           my $thisurl = &escape('/adm/login');
           $$helpdeskscript = <<"ENDSCRIPT";
   <script type="text/javascript">
   // <![CDATA[
   function helpdesk() {
       var possdom = document.client.udom.value;
       var codedom = possdom.replace( new RegExp("[^A-Za-z0-9.\\-]","g"),'');
       if (codedom == '') {
           codedom = "$authdomain";
       }
       var querystr = "origurl=$thisurl&codedom="+codedom;
       document.location.href = "/adm/helpdesk?"+querystr;
       return;
   }
   // ]]>
   </script>
   ENDSCRIPT
       }
       return $contactblock;
   }
   
   sub forgotpwdisplay {
       my (%lt) = @_;
       my $prompt_for_resetpw = 1;
       if ($prompt_for_resetpw) {
           return '<a href="/adm/resetpw">'.$lt{'forgotpw'}.'</a>';
       }
       return;
   }
   
   sub coursecatalog_link {
       my ($linkname) = @_;
       return <<"END";
         <a href="/adm/coursecatalog">$linkname</a>
   END
   }
   
   sub newuser_link {
       my ($linkname) = @_;
       return '<a href="/adm/createaccount">'.$linkname.'</a>';
   }
   
   1;
   __END__

Removed from v.1.107  
changed lines
  Added in v.1.172


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