Diff for /loncom/auth/lonlogin.pm between versions 1.87 and 1.102

version 1.87, 2007/01/14 02:00:04 version 1.102, 2008/03/08 02:53:25
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 48  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 69  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 120  ENDFAILED Line 112  ENDFAILED
     }      }
   
     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.  
                   $r->dir_config('lonIconsURL');  
     my $domain = &Apache::lonnet::default_login_domain();      my $domain = &Apache::lonnet::default_login_domain();
     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 159  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 200  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>'.$/;                  ' (preferred)</font>'.$/;
     $last=$Apache::lonnet::hostname{$hostid};      $last=$hostname;
         }          }
         $spares.= '<br />';          $spares.= '<br />';
    my %all_hostnames = &Apache::lonnet::all_hostnames();
         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::hostname)) {      keys(%all_hostnames)) {
             next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid});              next if ($hostid eq $lonhost || $Apache::lonnet::spareid{$hostid});
             next if ($last eq $Apache::lonnet::hostname{$hostid});      my $hostname = &Apache::lonnet::hostname($hostid);
               next if ($last eq $hostname);
             $spares.='<br /><a href="http://'.              $spares.='<br /><a href="http://'.
                 $Apache::lonnet::hostname{$hostid}.                  $hostname.
                 '/adm/login?domain='.$authdomain.'">'.                  '/adm/login?domain='.$authdomain.'">'.
                 $Apache::lonnet::hostname{$hostid}.'</a>';                  $hostname.'</a>';
     $last=$Apache::lonnet::hostname{$hostid};      $last=$hostname;
         }          }
  $r->print(<<ENDTROUBLE);   $r->print(<<ENDTROUBLE);
 <html>  <html>
Line 242  ENDTROUBLE Line 235  ENDTROUBLE
     }      }
   
 # ----------------------------------------------- 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=
Line 273  ENDHEADER Line 251  ENDHEADER
       ($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 $textcol = 
         ($fullgraph?&Apache::loncommon::designparm('login.textcol',$domain):'#000000');
       my $bgcol =
         ($fullgraph?&Apache::loncommon::designparm('login.bgcol',$domain):'#FFFFFF');
     my $logo=&Apache::loncommon::designparm('login.logo',$domain);      my $logo=&Apache::loncommon::designparm('login.logo',$domain);
     my $img=&Apache::loncommon::designparm('login.img',$domain);      my $img=&Apache::loncommon::designparm('login.img',$domain);
       my $domainlogo=&Apache::loncommon::domainlogo($domain);
 # ----------------------------------------------------------------------- Texts      my $login=&Apache::loncommon::designparm('login.login',$domain);
       if ($login eq '') {
 my %lt=&Apache::lonlocal::texthash(          $login = $iconpath.'/'.&mt('userauthentication.gif');
   'un'  => 'Username',      }
   'pw'  => 'Password',      my $showadminmail=&Apache::loncommon::designparm('login.adminmail',$domain);
   'dom' => 'Domain',      my $showcoursecat =
   'perc' => 'percent',          &Apache::loncommon::designparm('login.coursecatalog',$domain);
   'load' => 'Load',      my $loginheader =&Apache::loncommon::designparm('login.loginheader',$domain);
                   'userload' => 'User Load',      my $shownewuserlink = 
                   'about'  => 'About LON-CAPA',          &Apache::loncommon::designparm('login.newuser',$domain);
                   'access' => 'Accessibility Options',  
                   'catalog' => 'Course Catalog',  
   'auth' => 'userauthentication.gif',  
   'log' => 'Log in',  
   'help' => 'Log-in Help',  
   'serv' => 'Server',  
                   'helpdesk' => 'Contact Helpdesk',  
                   'forgotpw' => 'Forgot password?');  
 # -------------------------------------------------- Change password field name  
     my $now=time;      my $now=time;
     my $forgotpw = &forgotpwdisplay(%lt);      my $js = (<<ENDSCRIPT);
     my $loginhelp = &loginhelpdisplay(%lt);  
 # ---------------------------------------------------------- Serve rest of page  
     $r->print(<<ENDSCRIPT);  
   
 <body bgcolor="$pgbg" text="$font" link="$link" vlink="$vlink" alink="$alink"  
   topmargin=0 leftmargin=0 marginwidth=0 marginheight=0>  
   
  <script language="JavaScript">   <script language="JavaScript">
     function send()      function send()
     {      {
  this.document.server.elements.uname.value          this.document.server.elements.uname.value
        =this.document.client.elements.uname.value;         =this.document.client.elements.uname.value;
   
         this.document.server.elements.udom.value          this.document.server.elements.udom.value
Line 336  my %lt=&Apache::lonlocal::texthash( Line 303  my %lt=&Apache::lonlocal::texthash(
         initkeys();          initkeys();
   
         this.document.server.elements.upass0.value          this.document.server.elements.upass0.value
     =crypted(this.document.client.elements.upass$now.value.substr(0,15));              =crypted(this.document.client.elements.upass$now.value.substr(0,15));
  this.document.server.elements.upass1.value          this.document.server.elements.upass1.value
     =crypted(this.document.client.elements.upass$now.value.substr(15,15));              =crypted(this.document.client.elements.upass$now.value.substr(15,15));
  this.document.server.elements.upass2.value          this.document.server.elements.upass2.value
     =crypted(this.document.client.elements.upass$now.value.substr(30,15));              =crypted(this.document.client.elements.upass$now.value.substr(30,15));
   
         this.document.client.elements.uname.value='';          this.document.client.elements.uname.value='';
         this.document.client.elements.upass$now.value='';          this.document.client.elements.upass$now.value='';
   
         this.document.server.submit();          this.document.server.submit();
  return false;          return false;
     }      }
  </script>   </script>
   
 ENDSCRIPT  ENDSCRIPT
   
   # --------------------------------------------------- Print login screen header
   
       my %add_entries = (topmargin    => "0",
                          leftmargin   => "0",
                          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,}));
   
   # ----------------------------------------------------------------------- Texts
   
   my %lt=&Apache::lonlocal::texthash(
     'un'  => 'Username',
     'pw'  => 'Password',
     'dom' => 'Domain',
     'perc' => 'percent',
     'load' => 'Load',
                     'userload' => 'User Load',
                     'about'  => 'About LON-CAPA',
                     'access' => 'Accessibility Options',
                     '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);
   
   # ---------------------------------------------------- Serve out DES JavaScript
       {
           my $jsh=Apache::File->new($include."/londes.js");
           $r->print(<$jsh>);
       }
   # ---------------------------------------------------------- Serve rest of page
   
     if ($fullgraph) {      if ($fullgraph) {
  $r->print(   $r->print(
   '<table width="100%" cellpadding=0 cellspacing=0 border=0>');    '<table width="100%" cellpadding=0 cellspacing=0 border=0>');
Line 376  ENDSCRIPT Line 398  ENDSCRIPT
    <input type="hidden" name="localres" value="$env{'form.localres'}" />     <input type="hidden" name="localres" value="$env{'form.localres'}" />
   </form>    </form>
 ENDSERVERFORM  ENDSERVERFORM
       my $coursecatalog;
       if (($showcoursecat eq '') || ($showcoursecat)) {
           $coursecatalog = &coursecatalog_link($lt{'catalog'});
       }
       my $newuserlink;
       if ($shownewuserlink) {
           $newuserlink = &newuser_link($lt{'newuser'});
       }
     if ($fullgraph) { $r->print(<<ENDTOP);      if ($fullgraph) { $r->print(<<ENDTOP);
   <!-- The LON-CAPA Header -->    <!-- The LON-CAPA Header -->
   <tr>    <tr>
Line 412  ENDSERVERFORM Line 442  ENDSERVERFORM
      <tr>       <tr>
       <td>&nbsp;</td>        <td>&nbsp;</td>
       <td><a href="/adm/about.html"><b>$lt{'about'}</b></a></td>        <td><a href="/adm/about.html"><b>$lt{'about'}</b></a></td>
      </tr>       </tr>$coursecatalog
      <tr>  
       <td>&nbsp;</td>  
       <td><a href="/adm/coursecatalog"><b>$lt{'catalog'}</b></a></td>  
      </tr>  
      <tr>       <tr>
       <td colspan="2">&nbsp;</td>        <td colspan="2">&nbsp;</td>
      </tr>       </tr>
Line 444  ENDSERVERFORM Line 470  ENDSERVERFORM
    <td align="center" valign="middle" bgcolor="$sidebg">     <td align="center" valign="middle" bgcolor="$sidebg">
 ENDTOP  ENDTOP
 } else {  } else {
     $r->print('<h1>The Learning<i>Online</i> Network with CAPA</h1><h2>Text-based Interface Login</h2>'.$announcements);      $r->print('<h1>The Learning<i>Online</i> Network with CAPA</h1>'
                .'<h2>'.&mt('Text-based Interface Login').'</h2>'
                .$announcements);
 }  }
     $r->print('<form name="client" onsubmit="return(send())">');      $r->print('<form name="client" onsubmit="return(send())">');
     unless ($fullgraph) {      unless ($fullgraph) {
         $r->print(<<ENDACCESSOPTIONS);          $r->print(<<ENDACCESSOPTIONS);
 <h3>Select Accessibility Options</h3>  <h3>$lt{'options_headline'}</h3>
 <label><input type="checkbox" name="imagesuppress" /> Suppress rendering of images</label><br />  <label><input type="checkbox" name="imagesuppress" /> $lt{'sprs_img'}</label><br />
 <label><input type="checkbox" name="appletsuppress" /> Suppress Java applets</label><br />  <label><input type="checkbox" name="appletsuppress" /> $lt{'sprs_applet'}</label><br />
 <label><input type="checkbox" name="embedsuppress" /> Suppress rendering of embedded multimedia</label><br />  <label><input type="checkbox" name="embedsuppress" /> $lt{'sprs_embed'}</label><br />
 <label><input type="checkbox" name="fontenhance" /> Increase font size</label><br />  <label><input type="checkbox" name="fontenhance" /> $lt{'sprs_font'}</label><br />
 <label><input type="checkbox" name="blackwhite" /> Switch to black and white mode</label><br />  <label><input type="checkbox" name="blackwhite" /> $lt{'sprs_blackwhite'}</label><br />
 <input type="checkbox" name="remember" /> Remember these settings for next login<hr />  <br />
   <input type="checkbox" name="remember" /> $lt{'remember'}<hr />
 ENDACCESSOPTIONS  ENDACCESSOPTIONS
 } else {  } else {
     $r->print(<<ENDNOOPT);      $r->print(<<ENDNOOPT);
Line 467  ENDACCESSOPTIONS Line 496  ENDACCESSOPTIONS
 <input type="hidden" name="remember"  value="" />  <input type="hidden" name="remember"  value="" />
 ENDNOOPT  ENDNOOPT
 }  }
       my $logintitle;
       if ($loginheader eq 'text') {
           $logintitle = '<td bgcolor="'.$bgcol.'" colspan="2">&nbsp;&nbsp;&nbsp;<b><font size="+1" color="'.$textcol.'">'.$lt{'log'}.'</font></b></td>';
       } else {
           $logintitle = '<td bgcolor="'.$sidebg.'" colspan="2"><img src="'.$login.'" alt="'.
                         &mt('User Authentication').'" /></td>';
       }
     $r->print(<<ENDLOGIN);      $r->print(<<ENDLOGIN);
      <input type="hidden" name="lextkey" value="$lextkey">       <input type="hidden" name="lextkey" value="$lextkey">
      <input type="hidden" name="uextkey" value="$uextkey">       <input type="hidden" name="uextkey" value="$uextkey">
   
      <!-- Start the sub-table for text and input alignment -->       <!-- Start the sub-table for text and input alignment -->
      <table border=0 cellspacing=0 cellpadding=0>       <table border=0 cellspacing=0 cellpadding=0>
       <tr><td bgcolor="$sidebg" colspan=2><img src="$iconpath/$lt{'auth'}" alt="User Authentication" /></td></tr>        <tr>$logintitle</tr>
       <tr>        <tr>
        <td bgcolor="$mainbg"><br /><font size=-1><b>&nbsp;&nbsp;&nbsp;$lt{'un'}:</b></font></td>         <td bgcolor="$mainbg"><br /><font size=-1><b>&nbsp;&nbsp;&nbsp;<label for="uname">$lt{'un'}</label>:</b></font></td>
        <td bgcolor="$mainbg"><br /><input type="text" name="uname" size="10" value="$authusername" /></td>         <td bgcolor="$mainbg"><br /><input type="text" name="uname" size="10" value="$authusername" /></td>
       </tr>        </tr>
       <tr>        <tr>
        <td bgcolor="$mainbg"><font size=-1><b>&nbsp;&nbsp;&nbsp;$lt{'pw'}:</b></font></td>         <td bgcolor="$mainbg"><font size=-1><b>&nbsp;&nbsp;&nbsp;<label for="upass$now">$lt{'pw'}</label>:</b></font></td>
        <td bgcolor="$mainbg"><input type="password" name="upass$now" size="10" /></td>         <td bgcolor="$mainbg"><input type="password" name="upass$now" size="10" /></td>
       </tr>        </tr>
       <tr>        <tr>
        <td bgcolor="$mainbg"><font size=-1><b>&nbsp;&nbsp;&nbsp;$lt{'dom'}:</b></font></td>         <td bgcolor="$mainbg"><font size=-1><b>&nbsp;&nbsp;&nbsp;<label for="udom">$lt{'dom'}</label>:</b></font></td>
        <td bgcolor="$mainbg"><input type="text" name="udom" size="10" value="$authdomain" /></td>         <td bgcolor="$mainbg"><input type="text" name="udom" size="10" value="$authdomain" /></td>
       </tr>        </tr>
       <tr>        <tr>
Line 497  ENDNOOPT Line 533  ENDNOOPT
        <td bgcolor="$mainbg" valign="bottom" align="left" colspan="2">         <td bgcolor="$mainbg" valign="bottom" align="left" colspan="2">
         $loginhelp          $loginhelp
         $forgotpw          $forgotpw
           $newuserlink
           <br />
        </td>         </td>
       </tr>        </tr>
      </table>       </table>
Line 505  ENDNOOPT Line 543  ENDNOOPT
 ENDLOGIN  ENDLOGIN
     if ($fullgraph) {      if ($fullgraph) {
         my $helpdeskscript;          my $helpdeskscript;
         my $contactblock = &contactdisplay(\%lt,$version,$authdomain,\$helpdeskscript);          my $contactblock = &contactdisplay(\%lt,$servadm,$showadminmail,
                                     $version,$authdomain,\$helpdeskscript);
  $r->print(<<ENDDOCUMENT);   $r->print(<<ENDDOCUMENT);
    </td>     </td>
   
Line 596  $helpdeskscript Line 635  $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 635  sub forgotpwdisplay { Line 679  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 '<br />&nbsp;&nbsp;&nbsp;<a href="/adm/resetpw">'.$lt{'forgotpw'}.'</a></b><br />';
     }      }
     return;      return;
 }  }
Line 649  sub loginhelpdisplay { Line 693  sub loginhelpdisplay {
     return;      return;
 }  }
   
   sub coursecatalog_link {
       my ($linkname) = @_;
       return <<"END";
        <tr>
         <td>&nbsp;</td>
         <td><a href="/adm/coursecatalog"><b>$linkname</b></a></td>
        </tr>
   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.87  
changed lines
  Added in v.1.102


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