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

version 1.108, 2008/11/23 11:01:01 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 $sidebg=      if ($env{'form.role'}) {
 ($fullgraph?&Apache::loncommon::designparm('login.sidebg',$domain):'#FFFFFF');          $tokenextras = '&role='.&escape($env{'form.role'});
 my $textcol =       }
 ($fullgraph?&Apache::loncommon::designparm('login.textcol',$domain):'#000000');      if ($env{'form.symb'}) {
 my $bgcol =          if (!$tokenextras) {
 ($fullgraph?&Apache::loncommon::designparm('login.bgcol',$domain):'#FFFFFF');              $tokenextras = '&';
 my $logo=&Apache::loncommon::designparm('login.logo',$domain);          }
 my $img=&Apache::loncommon::designparm('login.img',$domain);          $tokenextras .= '&symb='.&escape($env{'form.symb'});
 my $domainlogo=&Apache::loncommon::domainlogo($domain);      }
 my $login=&Apache::loncommon::designparm('login.login',$domain);      if ($env{'form.iptoken'}) {
 if ($login eq '') {          if (!$tokenextras) {
 $login = $iconpath.'/'.&mt('userauthentication.gif');              $tokenextras = '&&';
 }          }
 my $showadminmail=&Apache::loncommon::designparm('login.adminmail',$domain);          $tokenextras .= '&iptoken='.&escape($env{'form.iptoken'});
 my $showcoursecat =      }
 &Apache::loncommon::designparm('login.coursecatalog',$domain);      my $logtoken=Apache::lonnet::reply(
 my $loginheader =&Apache::loncommon::designparm('login.loginheader',$domain);         'tmpput:'.$ukey.$lkey.'&'.$firsturl.$tokenextras,
 my $shownewuserlink =          $lonhost);
 &Apache::loncommon::designparm('login.newuser',$domain);  
 my $now=time;  # -- If we cannot talk to ourselves, or hostID does not map to a hostname
 my $js = (<<ENDSCRIPT);  #    we are in serious trouble
   
 <script language="JavaScript">      if (($logtoken eq 'con_lost') || ($logtoken eq 'no_such_host')) {
 function send()          if ($logtoken eq 'no_such_host') {
 {              &Apache::lonnet::logthis('No valid logtoken for log-in page -- unable to determine hostname for hostID: '.$lonhost.'. Check entry in hosts.tab');
 this.document.server.elements.uname.value          }
 =this.document.client.elements.uname.value;          my $spares='';
    my $last;
 this.document.server.elements.udom.value          foreach my $hostid (sort
 =this.document.client.elements.udom.value;      {
    &Apache::lonnet::hostname($a) cmp
 uextkey=this.document.client.elements.uextkey.value;      &Apache::lonnet::hostname($b);
 lextkey=this.document.client.elements.lextkey.value;      }
 initkeys();      keys(%Apache::lonnet::spareid)) {
               next if ($hostid eq $lonhost);
 this.document.server.elements.upass0.value      my $hostname = &Apache::lonnet::hostname($hostid);
     =crypted(this.document.client.elements.upass$now.value.substr(0,15));      next if (($last eq $hostname) || ($hostname eq ''));
 this.document.server.elements.upass1.value              $spares.='<br /><font size="+1"><a href="http://'.
     =crypted(this.document.client.elements.upass$now.value.substr(15,15));                  $hostname.
 this.document.server.elements.upass2.value                  '/adm/login?domain='.$authdomain.'">'.
     =crypted(this.document.client.elements.upass$now.value.substr(30,15));                  $hostname.'</a>'.
                   ' '.&mt('(preferred)').'</font>'.$/;
 this.document.client.elements.uname.value='';      $last=$hostname;
 this.document.client.elements.upass$now.value='';          }
           if ($spares) {
 this.document.server.submit();              $spares.= '<br />';
 return false;          }
 }          my %all_hostnames = &Apache::lonnet::all_hostnames();
 </script>          foreach my $hostid (sort
       {
 ENDSCRIPT   &Apache::lonnet::hostname($a) cmp
       &Apache::lonnet::hostname($b);
 # --------------------------------------------------- Print login screen header      }
       keys(%all_hostnames)) {
 my %add_entries = (topmargin    => "0",              next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid});
        leftmargin   => "0",              my $hostname = &Apache::lonnet::hostname($hostid);
        marginheight => "0",              next if (($last eq $hostname) || ($hostname eq ''));
        marginwidth  => "0",              $spares.='<br /><a href="http://'.
        bgcolor      => "$mainbg",               $hostname.
        text         => "$font",               '/adm/login?domain='.$authdomain.'">'.
        link         => "$link",               $hostname.'</a>';
        vlink        => "$vlink",              $last=$hostname;
        alink        => "$alink",);           }
            $r->print(
 $r->print(&Apache::loncommon::start_page('The LearningOnline Network with CAPA Login',$js,     '<html>'
        { 'redirect'       => [$expire,'/adm/roles'],     .'<head><title>'
  'add_entries' => \%add_entries,    .&mt('The LearningOnline Network with CAPA')
  'only_body'   => 1,}));    .'</title></head>'
     .'<body bgcolor="#FFFFFF">'
 # ----------------------------------------------------------------------- Texts    .'<h1>'.&mt('The LearningOnline Network with CAPA').'</h1>'
     .'<img src="/adm/lonKaputt/lonlogo_broken.gif" align="right" />'
 my %lt=&Apache::lonlocal::texthash(    .'<h3>'.&mt('This LON-CAPA server is temporarily not available for login.').'</h3>');
   'un'  => 'Username',          if ($spares) {
   'pw'  => 'Password',              $r->print('<p>'.&mt('Please attempt to login to one of the following servers:')
   'dom' => 'Domain',                       .'</p>'
   'perc' => 'percent',                       .$spares);
   'load' => 'Server Load',          }
   'userload' => 'User Load',          $r->print('</body>'
   'about'  => 'About LON-CAPA',                   .'</html>'
   'catalog' => 'Course Catalog',          );
   'log' => 'Log in',          return OK;
   'help' => 'Log-in Help',      }
   'serv' => 'Server',  
   'servadm' => 'Server Administration',  # ----------------------------------------------- Apparently we are in business
   'helpdesk' => 'Contact Helpdesk',      $servadm=~s/\,/\<br \/\>/g;
   'forgotpw' => 'Forgot password?',  
   'newuser'  => 'New User?',  # ----------------------------------------------------------- Front page design
   'options_headline' => 'Select Accessibility Options',      my $pgbg=&Apache::loncommon::designparm('login.pgbg',$domain);
   'sprs_img' => 'Suppress rendering of images',      my $font=&Apache::loncommon::designparm('login.font',$domain);
   'sprs_applet' => 'Suppress Java applets',      my $link=&Apache::loncommon::designparm('login.link',$domain);
   'sprs_embed' => 'Suppress rendering of embedded multimedia',      my $vlink=&Apache::loncommon::designparm('login.vlink',$domain);
   'sprs_font' => 'Increase font size',      my $alink=&Apache::loncommon::designparm('login.alink',$domain);
   'sprs_blackwhite' => 'Switch to black and white mode',      my $mainbg=&Apache::loncommon::designparm('login.mainbg',$domain);
   'remember' => 'Remember these settings for next login');      my $loginbox_bg=&Apache::loncommon::designparm('login.sidebg',$domain);
 # -------------------------------------------------- Change password field name      my $loginbox_header_bgcol=&Apache::loncommon::designparm('login.bgcol',$domain);
 my $forgotpw = &forgotpwdisplay(%lt);      my $loginbox_header_textcol=&Apache::loncommon::designparm('login.textcol',$domain);
 my $loginhelp = &loginhelpdisplay(%lt);      my $logo=&Apache::loncommon::designparm('login.logo',$domain);
       my $img=&Apache::loncommon::designparm('login.img',$domain);
 # ---------------------------------------------------- Serve out DES JavaScript      my $domainlogo=&Apache::loncommon::domainlogo($domain);
 {      my $showbanner = 1;
 my $jsh=Apache::File->new($include."/londes.js");      my $showmainlogo = 1;
 $r->print(<$jsh>);      if (defined(&Apache::loncommon::designparm('login.showlogo_img',$domain))) {
 }          $showbanner = &Apache::loncommon::designparm('login.showlogo_img',$domain);
 # ---------------------------------------------------------- Serve rest of page      }
       if (defined(&Apache::loncommon::designparm('login.showlogo_logo',$domain))) {
 if ($fullgraph) {          $showmainlogo = &Apache::loncommon::designparm('login.showlogo_logo',$domain);
 $r->print(      }
   '<div class="LC_loginpage_container">');      my $showadminmail;
 }      my @possdoms = &Apache::lonnet::current_machine_domains();
       if (grep(/^\Q$domain\E$/,@possdoms)) {
 $r->print(<<ENDSERVERFORM);          $showadminmail=&Apache::loncommon::designparm('login.adminmail',$domain);
 <form name="server" action="$otherserver/adm/authenticate" method="post" target="_top">      }
    <input type="hidden" name="logtoken" value="$logtoken" />      my $showcoursecat =
    <input type="hidden" name="serverid" value="$lonhost" />          &Apache::loncommon::designparm('login.coursecatalog',$domain);
    <input type="hidden" name="uname" value="" />      my $shownewuserlink =
    <input type="hidden" name="upass0" value="" />          &Apache::loncommon::designparm('login.newuser',$domain);
    <input type="hidden" name="upass1" value="" />      my $showhelpdesk =
    <input type="hidden" name="upass2" value="" />          &Apache::loncommon::designparm('login.helpdesk',$domain);
    <input type="hidden" name="udom" value="" />      my $now=time;
    <input type="hidden" name="localpath" value="$env{'form.localpath'}" />      my $js = (<<ENDSCRIPT);
    <input type="hidden" name="localres" value="$env{'form.localres'}" />  
   </form>  <script type="text/javascript" language="JavaScript">
 ENDSERVERFORM  // <![CDATA[
 my $coursecatalog;  function send()
 if (($showcoursecat eq '') || ($showcoursecat)) {  {
     $coursecatalog = &coursecatalog_link($lt{'catalog'});  this.document.server.elements.uname.value
 }  =this.document.client.elements.uname.value;
 my $newuserlink;  
 if ($shownewuserlink) {  this.document.server.elements.udom.value
     $newuserlink = &newuser_link($lt{'newuser'});  =this.document.client.elements.udom.value;
 }  
 my $logintitle;  uextkey=this.document.client.elements.uextkey.value;
 if ($loginheader eq 'text') {  lextkey=this.document.client.elements.lextkey.value;
     $logintitle = $lt{'log'};  initkeys();
 } else {  
     $logintitle = '<img src="'.$login.'" alt="'.  if(this.document.server.action.substr(0,5) === 'http:'){
                   &mt('User Authentication').'" />';      this.document.server.elements.upass0.value
 }          =getCrypted(this.document.client.elements.upass$now.value);
   } else {
 my $noscript_warning='<noscript><span class="LC_warning"><b>'      this.document.server.elements.upass0.value
                      .&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.')          =this.document.client.elements.upass$now.value;
                     .'</b></span></noscript>';  }
 my $helpdeskscript;  
 my $contactblock = &contactdisplay(\%lt,$servadm,$showadminmail,  this.document.client.elements.uname.value='';
                             $version,$authdomain,\$helpdeskscript);  this.document.client.elements.upass$now.value='';
 my $loncapaheader=(<<HEADER);  
 <!-- The LON-CAPA Header -->  this.document.server.submit();
 <table border="0" align="left" width="100%" cellspacing="0" cellpadding="1">  return false;
  <tr>  }
   <td align="left" valign="top" bgcolor="$pgbg">  
       <img src="$img" border=0 alt="The Learning Online Network with CAPA" />   function enableInput() {
   </td>      this.document.client.elements.upass$now.removeAttribute("readOnly");
  </tr>      this.document.client.elements.uname.removeAttribute("readOnly");
 </table>      this.document.client.elements.udom.removeAttribute("readOnly");
 HEADER      return;
   }
 my $loginform=(<<LFORM);  
 <form name="client" onsubmit="return(send())">  // ]]>
   <input type="hidden" name="lextkey" value="$lextkey">  </script>
   <input type="hidden" name="uextkey" value="$uextkey">  
   <b><label for="uname">$lt{'un'}</label>:</b><br />  ENDSCRIPT
   <input type="text" name="uname" size="10" value="$authusername" /><br />  
   <b><label for="upass$now">$lt{'pw'}</label>:</b><br />  # --------------------------------------------------- Print login screen header
   <input type="password" name="upass$now" size="10" /><br />  
   <b><label for="udom">$lt{'dom'}</label>:</b><br />      my %add_entries = (
   <input type="text" name="udom" size="10" value="$authdomain" /><br />         bgcolor      => "$mainbg",
   <input type="submit" value="$lt{'log'}" />         text         => "$font",
 </form>         link         => "$link",
 LFORM         vlink        => "$vlink",
          alink        => "$alink",
 if ($fullgraph) {                  onload       => 'javascript:enableInput();',);
 $r->print(<<ENDTOP);  
 $loncapaheader      my ($lonhost_in_use,$headextra,$headextra_exempt,@hosts,%defaultdomconf);
 <div class="LC_loginpage_space">&nbsp;</div>      @hosts = &Apache::lonnet::current_machine_ids();
     <img src="$logo" alt="" />      $lonhost_in_use = $lonhost;
       if (@hosts > 1) {
 <div class="LC_loginpage_loginContainer">          foreach my $hostid (@hosts) {
  <fieldset class="LC_loginpage_fieldset">              if (&Apache::lonnet::host_domain($hostid) eq $defdom) {
   <legend class="LC_loginpage_legend">$logintitle</legend>                  $lonhost_in_use = $hostid;
    <table border="0" align="left" cellspacing="1" cellpadding="1" width="100%">                  last;
       <tr>              }
       <td width="50%" align="center" valign="top">          }
  $domainlogo      }
    </td>      %defaultdomconf = &Apache::loncommon::get_domainconf($defdom);
    <td>      $headextra = $defaultdomconf{$defdom.'.login.headtag_'.$lonhost_in_use};
  $loginform      $headextra_exempt = $defaultdomconf{$domain.'.login.headtag_exempt_'.$lonhost_in_use};
            </td>      if ($headextra) {
       </tr>          my $omitextra;
    </table>            if ($headextra_exempt ne '') {
    $noscript_warning              my @exempt = split(',',$headextra_exempt);
  </fieldset>              my $ip = $ENV{'REMOTE_ADDR'};
 </div>              if (grep(/^\Q$ip\E$/,@exempt)) {
                     $omitextra = 1;
 <div class="LC_loginpage_loginInfo">              }
         $loginhelp<br />          }
         $forgotpw<br /><br />          unless ($omitextra) {
         $newuserlink<br />              my $confname = $defdom.'-domainconfig';
         $coursecatalog<br /><br />              if ($headextra =~ m{^\Q/res/$defdom/$confname/login/headtag/$lonhost_in_use/\E}) {
         <a href="/adm/about.html"><b>$lt{'about'}</b></a><br />                  my $extra = &Apache::lonnet::getfile(&Apache::lonnet::filelocation("",$headextra));
         $helpdeskscript                  unless ($extra eq '-1') {
 </div>                      $js .= "\n".$extra."\n";
                   }
 <div class="LC_loginpage_space">&nbsp;</div>              }
 $announcements          }
 ENDTOP      }
 }  
       $r->print(&Apache::loncommon::start_page('The LearningOnline Network with CAPA Login',$js,
 if($announcements){$r->print('<div class="LC_loginpage_space">&nbsp;</div>');}         { 'redirect'       => [$expire,'/adm/roles'],
    'add_entries' => \%add_entries,
 if ($fullgraph) {   'only_body'   => 1,}));
 $r->print(<<ENDDOCUMENT);  
      <table border=0 cellspacing=0 cellpadding=0>  # ----------------------------------------------------------------------- Texts
       <tr>  
        <td bgcolor="$sidebg" align="left" valign="top">      my %lt=&Apache::lonlocal::texthash(
         <small><b>&nbsp;&nbsp;&nbsp;$lt{'dom'}:&nbsp;</b></small>            'un'       => 'Username',
        </td>            'pw'       => 'Password',
        <td bgcolor="$sidebg" align="left" valign="top">            'dom'      => 'Domain',
         <small><tt>&nbsp;$domain</tt></small>            'perc'     => 'percent',
        </td>            'load'     => 'Server Load',
       </tr>            'userload' => 'User Load',
       <tr>            'catalog'  => 'Course/Community Catalog',
        <td bgcolor="$sidebg" align="left" valign="top">            'log'      => 'Log in',
         <small><b>&nbsp;&nbsp;&nbsp;$lt{'serv'}:&nbsp;</b></small>            'help'     => 'Log-in Help',
        </td>            'serv'     => 'Server',
        <td bgcolor="$sidebg" align="left" valign="top">            'servadm'  => 'Server Administration',
         <small><tt>&nbsp;$lonhost ($role)</tt></small>            'helpdesk' => 'Contact Helpdesk',
        </td>            'forgotpw' => 'Forgot password?',
       </tr>            'newuser'  => 'New User?',
       <tr>         );
        <td bgcolor="$sidebg" align="left" valign="top">  # -------------------------------------------------- Change password field name
         <small><b>&nbsp;&nbsp;&nbsp;$lt{'load'}:&nbsp;</b></small>  
        </td>      my $forgotpw = &forgotpwdisplay(%lt);
        <td bgcolor="$sidebg" align="left" valign="top">      $forgotpw .= '<br />' if $forgotpw;
         <small><tt>&nbsp;$loadpercent $lt{'perc'}</tt></small>      my $loginhelp = &Apache::lonauth::loginhelpdisplay($authdomain);
        </td>      if ($loginhelp) {
       </tr>          $loginhelp = '<a href="'.$loginhelp.'">'.$lt{'help'}.'</a><br />';
       <tr>      }
        <td bgcolor="$sidebg" align="left" valign="top">  
         <small><b>&nbsp;&nbsp;&nbsp;$lt{'userload'}:&nbsp;</b></small>  # ---------------------------------------------------- Serve out DES JavaScript
        </td>      {
        <td bgcolor="$sidebg" align="left" valign="top">      my $jsh=Apache::File->new($include."/londes.js");
         <small><tt>&nbsp;$userloadpercent $lt{'perc'}</tt></small>      $r->print(<$jsh>);
        </td>      }
       </tr>  # ---------------------------------------------------------- Serve rest of page
      </table>  
            $r->print(
     $contactblock      '<div class="LC_Box"'
      .' style="margin:0 auto; padding:10px; width:90%; height: auto; background-color:#FFFFFF;">'
  </div>  );
   
 <script type="text/javascript">      $r->print(<<ENDSERVERFORM);
 // the if prevents the script error if the browser can not handle this  <form name="server" action="/adm/authenticate" method="post" target="_top">
 if ( document.client.uname ) { document.client.uname.focus(); }     <input type="hidden" name="logtoken" value="$logtoken" />
 </script>     <input type="hidden" name="serverid" value="$lonhost" />
 $helpdeskscript     <input type="hidden" name="uname" value="" />
      <input type="hidden" name="upass0" value="" />
 ENDDOCUMENT     <input type="hidden" name="udom" value="" />
 }     <input type="hidden" name="localpath" value="$env{'form.localpath'}" />
     my %endargs = ( 'noredirectlink' => 1, );     <input type="hidden" name="localres" value="$env{'form.localres'}" />
     $r->print(&Apache::loncommon::end_page(\%endargs));    </form>
     return OK;  ENDSERVERFORM
 }      my $coursecatalog;
       if (($showcoursecat eq '') || ($showcoursecat)) {
 sub contactdisplay {          $coursecatalog = &coursecatalog_link($lt{'catalog'}).'<br />';
     my ($lt,$servadm,$showadminmail,$version,$authdomain,$helpdeskscript) = @_;      }
     my $contactblock;      my $newuserlink;
     my $showhelpdesk = 0;      if ($shownewuserlink) {
     my $requestmail = $Apache::lonnet::perlvar{'lonSupportEMail'};          $newuserlink = &newuser_link($lt{'newuser'}).'<br />';
     if ($requestmail =~ m/^[^\@]+\@[^\@]+$/) {      }
         $showhelpdesk = 1;      my $logintitle =
     }          '<h2 class="LC_hcell"'
     if ($servadm && $showadminmail) {         .' style="background:'.$loginbox_header_bgcol.';'
         $contactblock .= '<b>&nbsp;&nbsp;&nbsp;'.$$lt{'servadm'}.':</b><br />'.         .' color:'.$loginbox_header_textcol.'">'
                          '<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$servadm.'</tt><br />&nbsp;<br />';         .$lt{'log'}
     }         .'</h2>';
     if ($showhelpdesk) {  
         $contactblock .= '<b>&nbsp;&nbsp;&nbsp;<a href="javascript:helpdesk()"><font size="+1">'.$lt->{'helpdesk'}.'</font></a></b><br />';      my $noscript_warning='<noscript><span class="LC_warning"><b>'
         my $thisurl = &escape('/adm/login');                          .&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.')
         $$helpdeskscript = <<"ENDSCRIPT";                          .'</b></span></noscript>';
 <script type="text/javascript">      my $helpdeskscript;
 function helpdesk() {      my $contactblock = &contactdisplay(\%lt,$servadm,$showadminmail,
     var codedom = document.client.udom.value;                                         $authdomain,\$helpdeskscript,
     if (codedom == '') {                                         $showhelpdesk,\@possdoms);
         codedom = "$authdomain";  
     }      my $mobileargs;
     var querystr = "origurl=$thisurl&codedom="+codedom;      if ($clientmobile) {
     document.location.href = "/adm/helpdesk?"+querystr;          $mobileargs = 'autocapitalize="off" autocorrect="off"';
     return;      }
 }      my $loginform=(<<LFORM);
 </script>  <form name="client" action="" onsubmit="return(send())">
 ENDSCRIPT    <input type="hidden" name="lextkey" value="$lextkey" />
     }    <input type="hidden" name="uextkey" value="$uextkey" />
     $contactblock .= <<"ENDBLOCK";    <b><label for="uname">$lt{'un'}</label>:</b><br />
      &nbsp;&nbsp;&nbsp;$version    <input type="text" name="uname" id="uname" size="15" value="$authusername" readonly="readonly" $mobileargs /><br />
 ENDBLOCK    <b><label for="upass$now">$lt{'pw'}</label>:</b><br />
     return $contactblock;    <input type="password" name="upass$now" id="upass$now" size="15" readonly="readonly" /><br />
 }    <b><label for="udom">$lt{'dom'}</label>:</b><br />
     <input type="text" name="udom" id="udom" size="15" value="$authdomain" readonly="readonly" $mobileargs /><br />
 sub forgotpwdisplay {    <input type="submit" value="$lt{'log'}" />
     my (%lt) = @_;  </form>
     my $prompt_for_resetpw = 1;   LFORM
     if ($prompt_for_resetpw) {  
         return '<a href="/adm/resetpw">'.$lt{'forgotpw'}.'</a>';      if ($showbanner) {
     }          $r->print(<<HEADER);
     return;  <!-- The LON-CAPA Header -->
 }  <div style="background:$pgbg;margin:0;width:100%;">
     <img src="$img" border="0" alt="The Learning Online Network with CAPA" class="LC_maxwidth" />
 sub loginhelpdisplay {  </div>
     my (%lt) = @_;  HEADER
     my $login_help = 1;      }
     if ($login_help) {      $r->print(<<ENDTOP);
         return '<a href="/adm/loginproblems.html">'.$lt{'help'}.'</a>';  <div style="float:left;margin-top:0;">
     }  <div class="LC_Box" style="background:$loginbox_bg;">
     return;    $logintitle
 }    $loginform
     $noscript_warning
 sub coursecatalog_link {  </div>
     my ($linkname) = @_;   
     return <<"END";  <div class="LC_Box" style="padding-top: 10px;">
       <a href="/adm/coursecatalog">$linkname</a>    $loginhelp
 END    $forgotpw
 }    $contactblock
     $newuserlink
 sub newuser_link {    $coursecatalog
     my ($linkname) = @_;  </div>
     return '&nbsp;&nbsp;&nbsp;<a href="/adm/createaccount"><b>'.$linkname.'</b></a><br />';  </div>
 }  
   <div>
 1;  ENDTOP
 __END__      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.108  
changed lines
  Added in v.1.171


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