Diff for /loncom/auth/lonlogin.pm between versions 1.63 and 1.70

version 1.63, 2005/04/07 06:56:21 version 1.70, 2005/11/23 20:58:31
Line 60  sub handler { Line 60  sub handler {
  my $handle=$lonid->value;   my $handle=$lonid->value;
         $handle=~s/\W//g;          $handle=~s/\W//g;
         my $lonidsdir=$r->dir_config('lonIDsDir');          my $lonidsdir=$r->dir_config('lonIDsDir');
         if ((-e "$lonidsdir/$handle.id") && ($handle ne '')) {   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
    unlink("$lonidsdir/$handle.id");
       } elsif ($handle ne '') {
 # Indeed, a valid token is found  # Indeed, a valid token is found
     my $bodytag=&Apache::loncommon::bodytag('Already logged in');   my $bodytag=&Apache::loncommon::bodytag('Already logged in');
     $r->print(<<ENDFAILED);   $r->print(<<ENDFAILED);
 <html>  <html>
 <head>  <head>
 <title>Already logged in</title>  <title>Already logged in</title>
Line 77  $bodytag Line 82  $bodytag
 </body>  </body>
 </html>  </html>
 ENDFAILED  ENDFAILED
            return OK;                  return OK;
        }  
  }   }
     }      }
   
Line 86  ENDFAILED Line 92  ENDFAILED
     &Apache::loncommon::get_unprocessed_cgi      &Apache::loncommon::get_unprocessed_cgi
      ($ENV{'QUERY_STRING'}.'&'.$env{'request.querystring'},       ($ENV{'QUERY_STRING'}.'&'.$env{'request.querystring'},
       ['interface','username','domain','firsturl','localpath','localres']);        ['interface','username','domain','firsturl','localpath','localres']);
    
   
    # ---------------------------- Not possible to really login to domain "public"
       if ($env{'form.domain'} eq 'public') {
    $env{'form.domain'}='';
    $env{'form.username'}='';
       }
 # ----------------------------------------------------------- Process Interface  # ----------------------------------------------------------- Process Interface
     $env{'form.interface'}=~s/\W//g;      $env{'form.interface'}=~s/\W//g;
   
Line 108  ENDFAILED Line 118  ENDFAILED
     my $iconpath= 'http://'.$ENV{'HTTP_HOST'}.':'.$port_to_use.      my $iconpath= 'http://'.$ENV{'HTTP_HOST'}.':'.$port_to_use.
                   $r->dir_config('lonIconsURL');                    $r->dir_config('lonIconsURL');
     my $domain  = $r->dir_config('lonDefDomain');      my $domain  = $r->dir_config('lonDefDomain');
       my $testdomain=(split(/\./,$ENV{'HTTP_HOST'}))[0];
       foreach my $posdom (&Apache::lonnet::current_machine_domains()) {
    if ($posdom eq $testdomain) { $domain=$testdomain; }
       }
     if (($env{'form.domain'}) &&       if (($env{'form.domain'}) && 
  ($Apache::lonnet::domaindescription{$env{'form.domain'}})) {   ($Apache::lonnet::domaindescription{$env{'form.domain'}})) {
  $domain=$env{'form.domain'};   $domain=$env{'form.domain'};
Line 179  ENDFAILED Line 193  ENDFAILED
   
     if ($logtoken eq 'con_lost') {      if ($logtoken eq 'con_lost') {
         my $spares='';          my $spares='';
    my $last;
         foreach my $hostid (keys(%Apache::lonnet::spareid)) {          foreach my $hostid (sort
       {
    $Apache::lonnet::hostname{$a} cmp
       $Apache::lonnet::hostname{$b};
       }
       keys(%Apache::lonnet::spareid)) {
             next if ($hostid eq $lonhost);              next if ($hostid eq $lonhost);
               next if ($last eq $Apache::lonnet::hostname{$hostid});
             $spares.='<br /><font size="+1"><a href="http://'.              $spares.='<br /><font size="+1"><a href="http://'.
                 $Apache::lonnet::hostname{$hostid}.                  $Apache::lonnet::hostname{$hostid}.
                 '/adm/login?domain='.$authdomain.'">'.                  '/adm/login?domain='.$authdomain.'">'.
                 $Apache::lonnet::hostname{$hostid}.'</a>'.                  $Apache::lonnet::hostname{$hostid}.'</a>'.
                 ' (preferred)</font>'.$/;                  ' (preferred)</font>'.$/;
       $last=$Apache::lonnet::hostname{$hostid};
         }          }
         $spares.= '<br />';          $spares.= '<br />';
         foreach my $hostid (keys(%Apache::lonnet::hostname)) {          foreach my $hostid (sort
       {
    $Apache::lonnet::hostname{$a} cmp
       $Apache::lonnet::hostname{$b};
       }
       keys(%Apache::lonnet::hostname)) {
             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});
             $spares.='<br /><a href="http://'.              $spares.='<br /><a href="http://'.
                 $Apache::lonnet::hostname{$hostid}.                  $Apache::lonnet::hostname{$hostid}.
                 '/adm/login?domain='.$authdomain.'">'.                  '/adm/login?domain='.$authdomain.'">'.
                 $Apache::lonnet::hostname{$hostid}.'</a>';                  $Apache::lonnet::hostname{$hostid}.'</a>';
       $last=$Apache::lonnet::hostname{$hostid};
         }          }
  $r->print(<<ENDTROUBLE);   $r->print(<<ENDTROUBLE);
 <html>  <html>
Line 265  my %lt=&Apache::lonlocal::texthash( Line 293  my %lt=&Apache::lonlocal::texthash(
                   'servadm' => 'Server Administration',                    'servadm' => 'Server Administration',
                   'sysadm' => 'System Administration',                    'sysadm' => 'System Administration',
                   'helpdesk' => 'Contact Helpdesk');                    'helpdesk' => 'Contact Helpdesk');
   # -------------------------------------------------- Change password field name
       my $now=time;
 # ---------------------------------------------------------- Serve rest of page  # ---------------------------------------------------------- Serve rest of page
     $r->print(<<ENDSCRIPT);      $r->print(<<ENDSCRIPT);
   
Line 303  my %lt=&Apache::lonlocal::texthash( Line 332  my %lt=&Apache::lonlocal::texthash(
         lextkey=this.document.client.elements.lextkey.value;          lextkey=this.document.client.elements.lextkey.value;
         initkeys();          initkeys();
   
         this.document.server.elements.upass.value          this.document.server.elements.upass0.value
     =crypted(this.document.client.elements.upass.value);      =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='';
           this.document.client.elements.upass$now.value='';
   
         this.document.server.submit();          this.document.server.submit();
  return false;   return false;
Line 323  ENDSCRIPT Line 359  ENDSCRIPT
    <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="interface" value="$env{'form.interface'}" />
    <input type="hidden" name="uname" value="" />     <input type="hidden" name="uname" value="" />
    <input type="hidden" name="upass" value="" />     <input type="hidden" name="upass0" value="" />
      <input type="hidden" name="upass1" 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="imagesuppress"  value="" />
    <input type="hidden" name="appletsuppress"  value="" />     <input type="hidden" name="appletsuppress"  value="" />
Line 396  ENDTOP Line 434  ENDTOP
     unless ($fullgraph) {      unless ($fullgraph) {
         $r->print(<<ENDACCESSOPTIONS);          $r->print(<<ENDACCESSOPTIONS);
 <h3>Select Accessibility Options</h3>  <h3>Select Accessibility Options</h3>
 <input type="checkbox" name="imagesuppress" /> Suppress rendering of images<br />  <label><input type="checkbox" name="imagesuppress" /> Suppress rendering of images</label><br />
 <input type="checkbox" name="appletsuppress" /> Suppress Java applets<br />  <label><input type="checkbox" name="appletsuppress" /> Suppress Java applets</label><br />
 <input type="checkbox" name="embedsuppress" /> Suppress rendering of embedded multimedia<br />  <label><input type="checkbox" name="embedsuppress" /> Suppress rendering of embedded multimedia</label><br />
 <input type="checkbox" name="fontenhance" /> Increase font size<br />  <label><input type="checkbox" name="fontenhance" /> Increase font size</label><br />
 <input type="checkbox" name="blackwhite" /> Switch to black and white mode<br />  <label><input type="checkbox" name="blackwhite" /> Switch to black and white mode</label><br />
 <p>If you have accessibility needs that are not addressed by this interface,   <p>If you have accessibility needs that are not addressed by this interface, 
 please  please
 contact the system administrator at <tt>$sysadm</tt>.</p><br />  contact the system administrator at <tt>$sysadm</tt>.</p><br />
Line 429  ENDNOOPT Line 467  ENDNOOPT
       </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;$lt{'pw'}:</b></font></td>
        <td bgcolor="$mainbg"><input type="password" name="upass" 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;$lt{'dom'}:</b></font></td>

Removed from v.1.63  
changed lines
  Added in v.1.70


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