Diff for /loncom/auth/lonlogin.pm between versions 1.110 and 1.171

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


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