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

version 1.85, 2006/12/05 02:55:56 version 1.107, 2008/11/22 19:07:02
Line 30  package Apache::lonlogin; Line 30  package Apache::lonlogin;
   
 use strict;  use strict;
 use Apache::Constants qw(:common);  use Apache::Constants qw(:common);
 use CGI::Cookie();  
 use Apache::File ();  use Apache::File ();
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::loncommon();  use Apache::loncommon();
Line 40  use Apache::migrateuser(); Line 39  use Apache::migrateuser();
 use lib '/home/httpd/lib/perl/';  use lib '/home/httpd/lib/perl/';
 use LONCAPA;  use LONCAPA;
     
   
 sub additional_machine_domains {  
     my @domains;  
     open(my $fh,"<".$Apache::lonnet::perlvar{'lonTabDir'}.'/expected_domains.tab');  
     while( my $line = <$fh>) {  
  $line =~ s/\s//g;  
  push(@domains,$line);  
     }  
     return @domains;  
 }  
   
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
   
Line 59  sub handler { Line 47  sub handler {
       $ENV{'REDIRECT_QUERY_STRING'}),        $ENV{'REDIRECT_QUERY_STRING'}),
  ['interface','username','domain','firsturl','localpath','localres',   ['interface','username','domain','firsturl','localpath','localres',
   'token']);    'token']);
       if (!defined($env{'form.firsturl'})) {
           &Apache::lonacc::get_posted_cgi($r,['firsturl']);
       }
   
 # -- check if they are a migrating user  # -- check if they are a migrating user
     if (defined($env{'form.token'})) {      if (defined($env{'form.token'})) {
Line 80  sub handler { Line 71  sub handler {
   
   
 # -------------------------------- Prevent users from attempting to login twice  # -------------------------------- Prevent users from attempting to login twice
     my %cookies=CGI::Cookie->parse($r->header_in('Cookie'));      my $handle = &Apache::lonnet::check_for_valid_session($r);
     my $lonid=$cookies{'lonID'};      if ($handle=~/^publicuser\_/) {
     my $cookie;  
     if ($lonid) {  
  my $handle=&LONCAPA::clean_handle($lonid->value);  
         my $lonidsdir=$r->dir_config('lonIDsDir');  
  if (-e "$lonidsdir/$handle.id") {  
 # Is there an existing token file?  
     if ($handle=~/^publicuser\_/) {  
 # For "public user" - remove it, we apparently really want to login  # For "public user" - remove it, we apparently really want to login
  unlink("$lonidsdir/$handle.id");   unlink($r->dir_config('lonIDsDir')."/$handle.id");
     } elsif ($handle ne '') {      } elsif ($handle ne '') {
 # Indeed, a valid token is found  # Indeed, a valid token is found
  my $start_page =    my $start_page = 
     &Apache::loncommon::start_page('Already logged in');      &Apache::loncommon::start_page('Already logged in');
  my $end_page =    my $end_page = 
     &Apache::loncommon::end_page();      &Apache::loncommon::end_page();
  $r->print(<<ENDFAILED);   $r->print(
 $start_page                    $start_page
 <h1>You are already logged in</h1>                   .'<h1>'.&mt('You are already logged in!').'</h1>'
 <p>Please either <a href="/adm/roles">continue the current session</a> or                   .'<p>'.&mt('Please either [_1]continue the current session[_2] or [_3]logout[_4].',
 <a href="/adm/logout">logout</a>.</p>                    '<a href="/adm/roles">','</a>','<a href="/adm/logout">','</a>').'</p>'
 <p>                   .'<p><a href="/adm/loginproblems.html">'.&mt('Login problems?').'</a></p>'
 <a href="/adm/loginproblems.html">Problems?</a></p>                   .$end_page
 $end_page                   );
 ENDFAILED          return OK;
                 return OK;  
      }    
  }  
     }      }
   
 # ---------------------------------------------------- No valid token, continue  # ---------------------------------------------------- No valid token, continue
Line 121  ENDFAILED Line 102  ENDFAILED
 # ----------------------------------------------------------- Process Interface  # ----------------------------------------------------------- Process Interface
     $env{'form.interface'}=~s/\W//g;      $env{'form.interface'}=~s/\W//g;
   
     my $textbrowsers=$r->dir_config('lonTextBrowsers');     # my $textbrowsers=$r->dir_config('lonTextBrowsers');
     my $httpbrowser=$ENV{"HTTP_USER_AGENT"};      my $httpbrowser=$ENV{"HTTP_USER_AGENT"};
           
     foreach (split(/\:/,$textbrowsers)) {     # foreach (split(/\:/,$textbrowsers)) {
  if ($httpbrowser=~/$_/i) {  # if ($httpbrowser=~/$_/i) {
     $env{'form.interface'}='textual';  #    $env{'form.interface'}='textual';
         }  #        }
     }  #    }
   
     my $fullgraph=($env{'form.interface'} ne 'textual');      my $fullgraph=($env{'form.interface'} ne 'textual');
     my $port_to_use=$r->dir_config('lonhttpdPort');  
     if (!defined($port_to_use)) {      my $iconpath= 
  $port_to_use='8080';   &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));
     }  
     my $iconpath= 'http://'.$ENV{'HTTP_HOST'}.':'.$port_to_use.      my $domain = &Apache::lonnet::default_login_domain();
                   $r->dir_config('lonIconsURL');  
     my $domain  = $r->dir_config('lonDefDomain');  
     my $testdomain=(split(/\./,$ENV{'HTTP_HOST'}))[0];  
     foreach my $posdom (&Apache::lonnet::current_machine_domains(),  
  &additional_machine_domains()) {  
  if (lc($posdom) eq lc($testdomain)) { $domain=$posdom; }  
     }  
     if (($env{'form.domain'}) &&       if (($env{'form.domain'}) && 
  ($Apache::lonnet::domaindescription{$env{'form.domain'}})) {   (&Apache::lonnet::domain($env{'form.domain'},'description'))) {
  $domain=$env{'form.domain'};   $domain=$env{'form.domain'};
     }      }
     my $role    = $r->dir_config('lonRole');      my $role    = $r->dir_config('lonRole');
     my $loadlim = $r->dir_config('lonLoadLim');      my $loadlim = $r->dir_config('lonLoadLim');
       my $servadm = $r->dir_config('lonAdmEMail');
     my $lonhost = $r->dir_config('lonHostID');      my $lonhost = $r->dir_config('lonHostID');
     my $tabdir  = $r->dir_config('lonTabDir');      my $tabdir  = $r->dir_config('lonTabDir');
     my $include = $r->dir_config('lonIncludes');      my $include = $r->dir_config('lonIncludes');
     my $expire  = $r->dir_config('lonExpire');      my $expire  = $r->dir_config('lonExpire');
     my $version = $r->dir_config('lonVersion');      my $version = $r->dir_config('lonVersion');
     my $host_name = $Apache::lonnet::hostname{$lonhost};      my $host_name = &Apache::lonnet::hostname($lonhost);
   
 # --------------------------------------------- Default values for login fields  # --------------------------------------------- Default values for login fields
   
Line 175  ENDFAILED Line 150  ENDFAILED
     my $otherserver= &Apache::lonnet::absolute_url($host_name);      my $otherserver= &Apache::lonnet::absolute_url($host_name);
     my $firsturl=      my $firsturl=
     ($env{'request.firsturl'}?$env{'request.firsturl'}:$env{'form.firsturl'});      ($env{'request.firsturl'}?$env{'request.firsturl'}:$env{'form.firsturl'});
 # ---------------------------------------- Are we access server and overloaded?  # ---------------------------------------------------------- Are we overloaded?
     if (($role eq 'access') &&      if ((($userloadpercent>100.0)||($loadpercent>100.0))) {
  (($userloadpercent>100.0)||($loadpercent>100.0))) {  
         my $unloaded=Apache::lonnet::spareserver($loadpercent,$userloadpercent);          my $unloaded=Apache::lonnet::spareserver($loadpercent,$userloadpercent);
  if ($unloaded) { $otherserver=$unloaded; }   if ($unloaded) { $otherserver=$unloaded; }
     }      }
Line 216  ENDFAILED Line 190  ENDFAILED
  my $last;   my $last;
         foreach my $hostid (sort          foreach my $hostid (sort
     {      {
  $Apache::lonnet::hostname{$a} cmp   &Apache::lonnet::hostname($a) cmp
     $Apache::lonnet::hostname{$b};      &Apache::lonnet::hostname($b);
     }      }
     keys(%Apache::lonnet::spareid)) {      keys(%Apache::lonnet::spareid)) {
             next if ($hostid eq $lonhost);              next if ($hostid eq $lonhost);
             next if ($last eq $Apache::lonnet::hostname{$hostid});      my $hostname = &Apache::lonnet::hostname($hostid);
       next if ($last eq $hostname);
             $spares.='<br /><font size="+1"><a href="http://'.              $spares.='<br /><font size="+1"><a href="http://'.
                 $Apache::lonnet::hostname{$hostid}.                  $hostname.
                 '/adm/login?domain='.$authdomain.'">'.                  '/adm/login?domain='.$authdomain.'">'.
                 $Apache::lonnet::hostname{$hostid}.'</a>'.                  $hostname.'</a>'.
                 ' (preferred)</font>'.$/;                  ' '.&mt('(preferred)').'</font>'.$/;
     $last=$Apache::lonnet::hostname{$hostid};      $last=$hostname;
         }          }
         $spares.= '<br />';  $spares.= '<br />';
         foreach my $hostid (sort  my %all_hostnames = &Apache::lonnet::all_hostnames();
     {  foreach my $hostid (sort
  $Apache::lonnet::hostname{$a} cmp      {
     $Apache::lonnet::hostname{$b};   &Apache::lonnet::hostname($a) cmp
     }      &Apache::lonnet::hostname($b);
     keys(%Apache::lonnet::hostname)) {      }
             next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid});      keys(%all_hostnames)) {
             next if ($last eq $Apache::lonnet::hostname{$hostid});      next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid});
             $spares.='<br /><a href="http://'.      my $hostname = &Apache::lonnet::hostname($hostid);
                 $Apache::lonnet::hostname{$hostid}.      next if ($last eq $hostname);
                 '/adm/login?domain='.$authdomain.'">'.      $spares.='<br /><a href="http://'.
                 $Apache::lonnet::hostname{$hostid}.'</a>';   $hostname.
     $last=$Apache::lonnet::hostname{$hostid};   '/adm/login?domain='.$authdomain.'">'.
         }   $hostname.'</a>';
  $r->print(<<ENDTROUBLE);      $last=$hostname;
 <html>  }
 <head><title>The LearningOnline Network with CAPA</title></head>  $r->print(
 <body bgcolor="#FFFFFF">     '<html>'
 <img src="/adm/lonKaputt/lonlogo_broken.gif" align="right" />    .'<head><title>'
 <h3>This LON-CAPA server is temporarily not available for login</h3>    .&mt('The LearningOnline Network with CAPA')
 <p>Please attempt to login to one of the following servers:</p>$spares    .'</title></head>'
 </body>    .'<body bgcolor="#FFFFFF">'
 </html>    .'<h1>'.&mt('The LearningOnline Network with CAPA').'</h1>'
 ENDTROUBLE    .'<img src="/adm/lonKaputt/lonlogo_broken.gif" align="right" />'
         return OK;    .'<h3>'.&mt('This LON-CAPA server is temporarily not available for login.').'</h3>'
     }    .'<p>'.&mt('Please attempt to login to one of the following servers:').'</p>'
     .$spares
     .'</body>'
     .'</html>'
   );
   return OK;
   }
   
 # ----------------------------------------------- Apparently we are in business  # ----------------------------------------------- Apparently we are in business
   $servadm=~s/\,/\<br \/\>/g;
     my $domainlogo=&Apache::loncommon::domainlogo($domain);  
   
 # --------------------------------------------------- Print login screen header  
     $r->print(<<ENDHEADER);  
 <html>  
 <head>  
 <meta HTTP-EQUIV="Refresh" CONTENT="$expire; url=/adm/roles" />  
 <title>The LearningOnline Network with CAPA Login</title>  
 </head>  
 ENDHEADER  
 # ---------------------------------------------------- Serve out DES JavaScript  
     {  
  my $jsh=Apache::File->new($include."/londes.js");  
         $r->print(<$jsh>);  
     }  
   
 # ----------------------------------------------------------- Front page design  # ----------------------------------------------------------- Front page design
     my $pgbg=  my $pgbg=
       ($fullgraph?&Apache::loncommon::designparm('login.pgbg',$domain):'#FFFFFF');  ($fullgraph?&Apache::loncommon::designparm('login.pgbg',$domain):'#FFFFFF');
     my $font=  my $font=
       ($fullgraph?&Apache::loncommon::designparm('login.font',$domain):'#000000');  ($fullgraph?&Apache::loncommon::designparm('login.font',$domain):'#000000');
     my $link=  my $link=
       ($fullgraph?&Apache::loncommon::designparm('login.link',$domain):'#0000FF');  ($fullgraph?&Apache::loncommon::designparm('login.link',$domain):'#0000FF');
     my $vlink=  my $vlink=
       ($fullgraph?&Apache::loncommon::designparm('login.vlink',$domain):'#0000FF');  ($fullgraph?&Apache::loncommon::designparm('login.vlink',$domain):'#0000FF');
     my $alink=&Apache::loncommon::designparm('login.alink',$domain);  my $alink=&Apache::loncommon::designparm('login.alink',$domain);
     my $mainbg=  my $mainbg=
       ($fullgraph?&Apache::loncommon::designparm('login.mainbg',$domain):'#FFFFFF');  ($fullgraph?&Apache::loncommon::designparm('login.mainbg',$domain):'#FFFFFF');
     my $sidebg=  my $sidebg=
       ($fullgraph?&Apache::loncommon::designparm('login.sidebg',$domain):'#FFFFFF');  ($fullgraph?&Apache::loncommon::designparm('login.sidebg',$domain):'#FFFFFF');
     my $logo=&Apache::loncommon::designparm('login.logo',$domain);  my $textcol = 
     my $img=&Apache::loncommon::designparm('login.img',$domain);  ($fullgraph?&Apache::loncommon::designparm('login.textcol',$domain):'#000000');
   my $bgcol =
 # ----------------------------------------------------------------------- Texts  ($fullgraph?&Apache::loncommon::designparm('login.bgcol',$domain):'#FFFFFF');
   my $logo=&Apache::loncommon::designparm('login.logo',$domain);
 my %lt=&Apache::lonlocal::texthash(  my $img=&Apache::loncommon::designparm('login.img',$domain);
   'un'  => 'Username',  my $domainlogo=&Apache::loncommon::domainlogo($domain);
   'pw'  => 'Password',  my $login=&Apache::loncommon::designparm('login.login',$domain);
   'dom' => 'Domain',  if ($login eq '') {
   'perc' => 'percent',  $login = $iconpath.'/'.&mt('userauthentication.gif');
   'load' => 'Load',  }
                   'userload' => 'User Load',  my $showadminmail=&Apache::loncommon::designparm('login.adminmail',$domain);
                   'about'  => 'About LON-CAPA',  my $showcoursecat =
                   'access' => 'Accessibility Options',  &Apache::loncommon::designparm('login.coursecatalog',$domain);
                   'catalog' => 'Course Catalog',  my $loginheader =&Apache::loncommon::designparm('login.loginheader',$domain);
   'auth' => 'userauthentication.gif',  my $shownewuserlink = 
   'log' => 'Log in',  &Apache::loncommon::designparm('login.newuser',$domain);
   'help' => 'Log-in Help',  my $now=time;
   'serv' => 'Server',  my $js = (<<ENDSCRIPT);
                   'helpdesk' => 'Contact Helpdesk',  
                   'forgotpw' => 'Forgot password?');  <script language="JavaScript">
 # -------------------------------------------------- Change password field name  function send()
     my $now=time;  {
     my $forgotpw = &forgotpwdisplay(%lt);  this.document.server.elements.uname.value
     my $loginhelp = &loginhelpdisplay(%lt);  =this.document.client.elements.uname.value;
 # ---------------------------------------------------------- Serve rest of page  
     $r->print(<<ENDSCRIPT);  this.document.server.elements.udom.value
   =this.document.client.elements.udom.value;
 <body bgcolor="$pgbg" text="$font" link="$link" vlink="$vlink" alink="$alink"  
   topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>  uextkey=this.document.client.elements.uextkey.value;
   lextkey=this.document.client.elements.lextkey.value;
  <script language="JavaScript">  initkeys();
     function send()  
     {  this.document.server.elements.upass0.value
  this.document.server.elements.uname.value      =crypted(this.document.client.elements.upass$now.value.substr(0,15));
        =this.document.client.elements.uname.value;  this.document.server.elements.upass1.value
       =crypted(this.document.client.elements.upass$now.value.substr(15,15));
         this.document.server.elements.udom.value  this.document.server.elements.upass2.value
        =this.document.client.elements.udom.value;      =crypted(this.document.client.elements.upass$now.value.substr(30,15));
   
         this.document.server.elements.imagesuppress.value  
        =this.document.client.elements.imagesuppress.checked;  
   
         this.document.server.elements.embedsuppress.value  
        =this.document.client.elements.embedsuppress.checked;  
   
         this.document.server.elements.appletsuppress.value  this.document.client.elements.uname.value='';
        =this.document.client.elements.appletsuppress.checked;  this.document.client.elements.upass$now.value='';
   
         this.document.server.elements.fontenhance.value  this.document.server.submit();
        =this.document.client.elements.fontenhance.checked;  return false;
   }
   </script>
   
         this.document.server.elements.blackwhite.value  ENDSCRIPT
        =this.document.client.elements.blackwhite.checked;  
   
         this.document.server.elements.remember.value  # --------------------------------------------------- Print login screen header
        =this.document.client.elements.remember.checked;  
   
         uextkey=this.document.client.elements.uextkey.value;  my %add_entries = (topmargin    => "0",
         lextkey=this.document.client.elements.lextkey.value;         leftmargin   => "0",
         initkeys();         marginheight => "0",
          marginwidth  => "0",
          bgcolor      => "$pgbg",
          text         => "$font",
          link         => "$link",
          vlink        => "$vlink",
          alink        => "$alink",);
   
   $r->print(&Apache::loncommon::start_page('The LearningOnline Network with CAPA Login',$js,
          { 'redirect'       => [$expire,'/adm/roles'], 
    'add_entries' => \%add_entries,
    'only_body'   => 1,}));
   
         this.document.server.elements.upass0.value  # ----------------------------------------------------------------------- Texts
     =crypted(this.document.client.elements.upass$now.value.substr(0,15));  
  this.document.server.elements.upass1.value  
     =crypted(this.document.client.elements.upass$now.value.substr(15,15));  
  this.document.server.elements.upass2.value  
     =crypted(this.document.client.elements.upass$now.value.substr(30,15));  
   
         this.document.client.elements.uname.value='';  my %lt=&Apache::lonlocal::texthash(
         this.document.client.elements.upass$now.value='';    'un'  => 'Username',
     'pw'  => 'Password',
     'dom' => 'Domain',
     'perc' => 'percent',
     'load' => 'Server Load',
     'userload' => 'User Load',
     'about'  => 'About LON-CAPA',
     'catalog' => 'Course Catalog',
     'log' => 'Log in',
     'help' => 'Log-in Help',
     'serv' => 'Server',
     'servadm' => 'Server Administration',
     'helpdesk' => 'Contact Helpdesk',
     'forgotpw' => 'Forgot password?',
     'newuser'  => 'New User?',
     'options_headline' => 'Select Accessibility Options',
     'sprs_img' => 'Suppress rendering of images',
     'sprs_applet' => 'Suppress Java applets',
     'sprs_embed' => 'Suppress rendering of embedded multimedia',
     'sprs_font' => 'Increase font size',
     'sprs_blackwhite' => 'Switch to black and white mode',
     'remember' => 'Remember these settings for next login');
   # -------------------------------------------------- Change password field name
   my $forgotpw = &forgotpwdisplay(%lt);
   my $loginhelp = &loginhelpdisplay(%lt);
   
         this.document.server.submit();  # ---------------------------------------------------- Serve out DES JavaScript
  return false;  {
     }  my $jsh=Apache::File->new($include."/londes.js");
  </script>  $r->print(<$jsh>);
 ENDSCRIPT  }
   # ---------------------------------------------------------- Serve rest of page
   
     if ($fullgraph) {  if ($fullgraph) {
  $r->print(  $r->print(
   '<table width="100%" cellpadding=0 cellspacing=0 border=0>');    '<div class="LC_loginpage_container">');
     }  }
   
     $r->print(<<ENDSERVERFORM);  $r->print(<<ENDSERVERFORM);
   <form name="server" action="$otherserver/adm/authenticate" method="post" target="_top">  <form name="server" action="$otherserver/adm/authenticate" method="post" target="_top">
    <input type="hidden" name="logtoken" value="$logtoken" />     <input type="hidden" name="logtoken" value="$logtoken" />
    <input type="hidden" name="serverid" value="$lonhost" />     <input type="hidden" name="serverid" value="$lonhost" />
    <input type="hidden" name="interface" value="$env{'form.interface'}" />  
    <input type="hidden" name="uname" value="" />     <input type="hidden" name="uname" value="" />
    <input type="hidden" name="upass0" value="" />     <input type="hidden" name="upass0" value="" />
    <input type="hidden" name="upass1" value="" />     <input type="hidden" name="upass1" value="" />
    <input type="hidden" name="upass2" value="" />     <input type="hidden" name="upass2" value="" />
    <input type="hidden" name="udom" value="" />     <input type="hidden" name="udom" value="" />
    <input type="hidden" name="imagesuppress"  value="" />  
    <input type="hidden" name="appletsuppress"  value="" />  
    <input type="hidden" name="embedsuppress"  value="" />  
    <input type="hidden" name="fontenhance"  value="" />  
    <input type="hidden" name="blackwhite"  value="" />  
    <input type="hidden" name="remember"  value="" />  
    <input type="hidden" name="localpath" value="$env{'form.localpath'}" />     <input type="hidden" name="localpath" value="$env{'form.localpath'}" />
    <input type="hidden" name="localres" value="$env{'form.localres'}" />     <input type="hidden" name="localres" value="$env{'form.localres'}" />
   </form>    </form>
 ENDSERVERFORM  ENDSERVERFORM
     if ($fullgraph) { $r->print(<<ENDTOP);      my $coursecatalog;
       if (($showcoursecat eq '') || ($showcoursecat)) {
           $coursecatalog = &coursecatalog_link($lt{'catalog'});
       }
       my $newuserlink;
       if ($shownewuserlink) {
           $newuserlink = &newuser_link($lt{'newuser'});
       }
       my $logintitle;
       if ($loginheader eq 'text') {
           $logintitle = $lt{'log'};
       } else {
           $logintitle = '<img src="'.$login.'" alt="'.
                         &mt('User Authentication').'" />';
       }
       
        my $noscript_warning='<noscript>'
                           .&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.')
                           .'</noscript>';
         my $helpdeskscript;
         my $contactblock = &contactdisplay(\%lt,$servadm,$showadminmail,
                                     $version,$authdomain,\$helpdeskscript);
                    
       if ($fullgraph) { 
       $r->print(<<ENDTOP);
   <!-- The LON-CAPA Header -->    <!-- The LON-CAPA Header -->
   <tr>  <table border="0" align="left" width="100%" cellspacing="0" cellpadding="1">
   <tr>
    <!-- Row 1 Columns 2-4 -->  <td align="left" valign="top" bgcolor="$pgbg"> <img src="$img" border=0 alt="The Learning Online Network with CAPA" /> </td>
    <td width="100%" height=75 colspan=4 align="left" valign="top" bgcolor="$pgbg"><img src="$img" border=0 alt="The Learning Online Network with CAPA" /></td>  </tr>
   </tr>  </table>
   
   <!-- The gray bar that starts the two table frames -->   <div class="LC_loginpage_space">&nbsp;</div>
   <tr>      <img src="$logo" alt="" />
    <div class="LC_loginpage_loginContainer"><fieldset class="LC_loginpage_fieldset">
    <!-- Row 2 Column 1 -->  <legend class="LC_loginpage_legend">$logintitle</legend>
    <td width=182 height=27 bgcolor="$sidebg">&nbsp;</td>  <table border="0" align="left" cellspacing="1" cellpadding="1" width="100%">
    <tr>
    <!-- Row 2 Column 2 -->   <td width="50%" align="center" valign="top">$domainlogo</td>
    <td width=27 height=27 align="left" background="$iconpath/filltop.gif"><img src="$iconpath/upperleft.gif" border=0 alt="" /></td>   <td>
   
    <!-- Row 2 Column 3 -->  
    <td height=27 background="$iconpath/filltop.gif"><img src="$iconpath/filltop.gif" alt="" /></td>  
   
    <!-- Row 2 Column 4 -->  
    <td width=27 height=27 align="right" background="$iconpath/filltop.gif"><img src="$iconpath/upperright.gif" border=0 alt="" /></td>  
   </tr>  
   <tr>  
      
    <!-- A cell that will hold the 'access', 'about', and 'catalog' links -->  
    <!-- Row 3 Column 1 -->  
    <td valign="top" height=60 align="left" bgcolor="$sidebg">  
     <table cellpadding="0" cellspacing="2" border="0">  
      <tr>  
       <td>&nbsp;</td>  
       <td><a href="/adm/login?interface=textual"><b>$lt{'access'}</b></a></td>  
     </tr>  
     <tr>  
      <td>&nbsp;</td>  
      <td><a href="/adm/about.html"><b>$lt{'about'}</b></a></td>  
     </tr>  
     <tr>  
      <td>&nbsp;</td>  
      <td><a href="/adm/coursecatalog"><b>$lt{'catalog'}</b></a></td>  
     </tr>  
     <tr>  
       <td colspan="2">&nbsp;</td>  
     </tr>  
    </table>  
    <!-- The shaded space between the two main columns -->  
    <!-- Row 3 Column 2 -->  
    <td width=27 height=60 background="$iconpath/fillleft.gif"><img src="$iconpath/fillleft.gif" alt="" /></td>  
   
    <!-- The right main column holding the large LON-CAPA logo-->  
    <!-- Rows 3-4 Column 3 -->  
    <td align="center" valign="top" width="100%" height="100%" bgcolor="$mainbg">  
     <center>  
      <img src="$logo" alt="" />  
     </center>  
    </td>  
   
    <!-- Row 3 Column 4 -->  
    <td width=27 background="$iconpath/fillright.gif"><img src="$iconpath/fillright.gif" alt="" /></td>  
   </tr>  
   <tr>  
   
    <!-- The entry form -->  
    <!-- Row 4 Column 1 -->  
    <td align="center" valign="middle" bgcolor="$sidebg">  
 ENDTOP  ENDTOP
 } else {  
     $r->print('<h1>The Learning<i>Online</i> Network with CAPA</h1><h2>Text-based Interface Login</h2>'.$announcements);  $r->print('<form name="client" onsubmit="return(send())">');
 }  
     $r->print('<form name="client" onsubmit="return(send())">');  
     unless ($fullgraph) {  
         $r->print(<<ENDACCESSOPTIONS);  
 <h3>Select Accessibility Options</h3>  
 <label><input type="checkbox" name="imagesuppress" /> Suppress rendering of images</label><br />  
 <label><input type="checkbox" name="appletsuppress" /> Suppress Java applets</label><br />  
 <label><input type="checkbox" name="embedsuppress" /> Suppress rendering of embedded multimedia</label><br />  
 <label><input type="checkbox" name="fontenhance" /> Increase font size</label><br />  
 <label><input type="checkbox" name="blackwhite" /> Switch to black and white mode</label><br />  
 <input type="checkbox" name="remember" /> Remember these settings for next login<hr />  
 ENDACCESSOPTIONS  
 } else {  
     $r->print(<<ENDNOOPT);  
 <input type="hidden" name="imagesuppress"  value="" />  
 <input type="hidden" name="embedsuppress"  value="" />  
 <input type="hidden" name="appletsuppress"  value="" />  
 <input type="hidden" name="fontenhance"  value="" />  
 <input type="hidden" name="blackwhite"  value="" />  
 <input type="hidden" name="remember"  value="" />  
 ENDNOOPT  
 }  
     $r->print(<<ENDLOGIN);  
      <input type="hidden" name="lextkey" value="$lextkey">  
      <input type="hidden" name="uextkey" value="$uextkey">  
   
      <!-- Start the sub-table for text and input alignment -->  $r->print(<<ENDTOPP)
      <table border=0 cellspacing=0 cellpadding=0>   <input type="hidden" name="lextkey" value="$lextkey">
       <tr><td bgcolor="$sidebg" colspan=2><img src="$iconpath/$lt{'auth'}" alt="User Authentication" /></td></tr>        <input type="hidden" name="uextkey" value="$uextkey">
       <tr>        <b><label for="uname">$lt{'un'}</label>:</b><br />
        <td bgcolor="$mainbg"><br /><font size=-1><b>&nbsp;&nbsp;&nbsp;$lt{'un'}:</b></font></td>          <input type="text" name="uname" size="10" value="$authusername" /><br />
        <td bgcolor="$mainbg"><br /><input type="text" name="uname" size="10" value="$authusername" /></td>          <b><label for="upass$now">$lt{'pw'}</label>:</b><br />
       </tr>        <input type="password" name="upass$now" size="10" /><br />
       <tr>        <b><label for="udom">$lt{'dom'}</label>:</b><br />
        <td bgcolor="$mainbg"><font size=-1><b>&nbsp;&nbsp;&nbsp;$lt{'pw'}:</b></font></td>          <input type="text" name="udom" size="10" value="$authdomain" /><br />
        <td bgcolor="$mainbg"><input type="password" name="upass$now" size="10" /></td>          <input type="submit" value="$lt{'log'}" />
       </tr>          </form>
       <tr>   </td>
        <td bgcolor="$mainbg"><font size=-1><b>&nbsp;&nbsp;&nbsp;$lt{'dom'}:</b></font></td>   </tr>
        <td bgcolor="$mainbg"><input type="text" name="udom" size="10" value="$authdomain" /></td>  </table>  
       </tr>  $noscript_warning
       <tr>  </fieldset></div>
        <td bgcolor="$mainbg">&nbsp;</td>    
        <td bgcolor="$mainbg" valign="bottom" align="center">  <div class="LC_loginpage_loginInfo">
         <br />          $loginhelp<br />
         <input type="submit" value="$lt{'log'}" />          $forgotpw<br /><br />
        </td>          $newuserlink<br />
       </tr>          $coursecatalog<br /><br />
       <tr>          <a href="/adm/about.html"><b>$lt{'about'}</b></a><br />
        <td bgcolor="$mainbg" valign="bottom" align="left" colspan="2">          $helpdeskscript
         $loginhelp  </div>
         $forgotpw  <div class="LC_loginpage_space">&nbsp;</div>
        </td>  $announcements
       </tr>  ENDTOPP
      </table>  }
      <!-- End sub-table -->  if($announcements){$r->print('<div class="LC_loginpage_space">&nbsp;</div>');}
     </form>  
 ENDLOGIN  
     if ($fullgraph) {  
         my $helpdeskscript;  
         my $contactblock = &contactdisplay(\%lt,$version,$authdomain,\$helpdeskscript);  
  $r->print(<<ENDDOCUMENT);  
    </td>  
   
    <!-- Row 4 Column 2 -->  
    <td width=27 background="$iconpath/fillleft.gif"><img src="$iconpath/fillleft.gif" alt="" /></td>  
   
    <!-- Row 4 Column 3 -->     if ($fullgraph) {
 <td bgcolor="$mainbg">$announcements</td>        
    $r->print(<<ENDDOCUMENT);
      
   
    <!-- Row 4 Column 4 -->  
    <td width=27 background="$iconpath/fillright.gif"><img src="$iconpath/fillright.gif" alt="" /></td>  
   </tr>  
   <tr>  
   
    <!-- Row 5 Column 1 -->  
    <td bgcolor="$sidebg" valign="middle" align="left">  
      <br />  
      <table border=0 cellspacing=0 cellpadding=0>       <table border=0 cellspacing=0 cellpadding=0>
       <tr>        <tr>
        <td bgcolor="$sidebg" align="left" valign="top">         <td bgcolor="$sidebg" align="left" valign="top">
Line 572  ENDLOGIN Line 491  ENDLOGIN
        </td>         </td>
       </tr>        </tr>
      </table>       </table>
      <br />       
     $contactblock      $contactblock
    </td>  
   
    <!-- Row 5 Column 2 -->  
    <td width=27 background="$iconpath/fillleft.gif"><img src="$iconpath/fillleft.gif" alt="" /></td>  
   
    <!-- Row 5 Column 3 -->   </div>
    <td width="100%" valign="bottom" bgcolor="$mainbg">  
 $domainlogo  
 </td>  
   
    <!-- Row 5 Column 4 -->  
    <td width=27 background="$iconpath/fillright.gif"><img src="$iconpath/fillright.gif" alt="" /></td>  
   </tr>  
   <tr>  
   
    <!-- Row 6 Column 1 -->  
    <td bgcolor="$sidebg">&nbsp;</td>  
   
    <!-- Row 6 Column 2 -->  
    <td align="left" background="$iconpath/fillbottom.gif"><img src="$iconpath/lowerleft.gif" alt="" /></td>  
   
    <!-- Row 6 Column 3 -->  
    <td background="$iconpath/fillbottom.gif"><img src="$iconpath/fillbottom.gif" alt="" /></td>  
   
    <!-- Row 6 Column 4 -->  
    <td align="right" background="$iconpath/fillbottom.gif"><img src="$iconpath/lowerright.gif" alt="" /></td>  
   </tr>  
  </table>  
   
 <script type="text/javascript">  <script type="text/javascript">
 // the if prevents the script error if the browser can not handle this  // the if prevents the script error if the browser can not handle this
Line 611  $helpdeskscript Line 504  $helpdeskscript
   
 ENDDOCUMENT  ENDDOCUMENT
 }  }
     $r->print('</body></html>');      my %endargs = ( 'noredirectlink' => 1, );
       $r->print(&Apache::loncommon::end_page(\%endargs));
     return OK;      return OK;
 }  }
   
 sub contactdisplay {  sub contactdisplay {
     my ($lt,$version,$authdomain,$helpdeskscript) = @_;      my ($lt,$servadm,$showadminmail,$version,$authdomain,$helpdeskscript) = @_;
     my $contactblock;      my $contactblock;
     my $showhelpdesk = 0;      my $showhelpdesk = 0;
     my $requestmail = $Apache::lonnet::perlvar{'lonSupportEMail'};      my $requestmail = $Apache::lonnet::perlvar{'lonSupportEMail'};
     if ($requestmail =~ m/^[^\@]+\@[^\@]+$/) {      if ($requestmail =~ m/^[^\@]+\@[^\@]+$/) {
         $showhelpdesk = 1;          $showhelpdesk = 1;
     }      }
       if ($servadm && $showadminmail) {
           $contactblock .= '<b>&nbsp;&nbsp;&nbsp;'.$$lt{'servadm'}.':</b><br />'.
                            '<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$servadm.'</tt><br />&nbsp;<br />';
       }
     if ($showhelpdesk) {      if ($showhelpdesk) {
         $contactblock .= '<b>&nbsp;&nbsp;&nbsp;<a href="javascript:helpdesk()"><font size="+1">'.$lt->{'helpdesk'}.'</font></a></b><br />';          $contactblock .= '<b>&nbsp;&nbsp;&nbsp;<a href="javascript:helpdesk()"><font size="+1">'.$lt->{'helpdesk'}.'</font></a></b><br />';
         my $thisurl = &escape('/adm/login');          my $thisurl = &escape('/adm/login');
Line 650  sub forgotpwdisplay { Line 548  sub forgotpwdisplay {
     my (%lt) = @_;      my (%lt) = @_;
     my $prompt_for_resetpw = 1;       my $prompt_for_resetpw = 1; 
     if ($prompt_for_resetpw) {      if ($prompt_for_resetpw) {
         return '<br />&nbsp;&nbsp;&nbsp;<a href="/adm/resetpw">'.$lt{'forgotpw'}.'</a></b><br /><br />';          return '<a href="/adm/resetpw">'.$lt{'forgotpw'}.'</a>';
     }      }
     return;      return;
 }  }
Line 659  sub loginhelpdisplay { Line 557  sub loginhelpdisplay {
     my (%lt) = @_;      my (%lt) = @_;
     my $login_help = 1;      my $login_help = 1;
     if ($login_help) {      if ($login_help) {
         return '&nbsp;&nbsp;&nbsp;<a href="/adm/loginproblems.html">'.$lt{'help'}.'</a></b>';          return '<a href="/adm/loginproblems.html">'.$lt{'help'}.'</a>';
     }      }
     return;      return;
 }  }
   
   sub coursecatalog_link {
       my ($linkname) = @_;
       return <<"END";
         <a href="/adm/coursecatalog">$linkname</a>
   END
   }
   
   sub newuser_link {
       my ($linkname) = @_;
       return '&nbsp;&nbsp;&nbsp;<a href="/adm/createaccount"><b>'.$linkname.'</b></a><br />';
   }
   
 1;  1;
 __END__  __END__

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


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.