Diff for /loncom/auth/lonauth.pm between versions 1.129 and 1.132

version 1.129, 2013/12/20 14:54:34 version 1.132, 2014/01/22 18:00:37
Line 108  sub success { Line 108  sub success {
             }              }
             $desturl = &HTML::Entities::encode($desturl,'"<>&');              $desturl = &HTML::Entities::encode($desturl,'"<>&');
             $destsymb = &HTML::Entities::encode($destsymb,'"<>&');              $destsymb = &HTML::Entities::encode($destsymb,'"<>&');
             $destination .= '&destinationurl='.$desturl.              $destination .= 'destinationurl='.$desturl.
                             '&destsymb='.$destsymb;                              '&destsymb='.$destsymb;
         } else {          } else {
             $destsymb = &HTML::Entities::encode($destsymb,'"<>&');              $destsymb = &HTML::Entities::encode($destsymb,'"<>&');
             $destination .= '&destinationurl='.$destsymb;              $destination .= 'destinationurl='.$destsymb;
         }          }
     }      }
     if ($destination =~ m{^/adm/roles}) {      if ($destination =~ m{^/adm/roles}) {
Line 173  sub failed { Line 173  sub failed {
     my $udom = &Apache::loncommon::cleanup_html($form->{'udom'});      my $udom = &Apache::loncommon::cleanup_html($form->{'udom'});
     if (&Apache::lonnet::domain($udom,'description') eq '') {      if (&Apache::lonnet::domain($udom,'description') eq '') {
         undef($udom);          undef($udom);
     }        }
     my $retry = '/adm/login';      my $retry = '/adm/login';
     if ($uname eq $form->{'uname'}) {      if ($uname eq $form->{'uname'}) {
         $retry .= '?username='.$uname;          $retry .= '?username='.$uname;
Line 183  sub failed { Line 183  sub failed {
     }      }
     if (exists($form->{role})) {      if (exists($form->{role})) {
         my $role = &Apache::loncommon::cleanup_html($form->{role});          my $role = &Apache::loncommon::cleanup_html($form->{role});
         if ($role ne '') {           if ($role ne '') {
             $retry .= (($retry=~/\?/)?'&amp;':'?').'role='.$role;              $retry .= (($retry=~/\?/)?'&amp;':'?').'role='.$role;
         }          }
     }      }
Line 196  sub failed { Line 196  sub failed {
     my $end_page = &Apache::loncommon::end_page();      my $end_page = &Apache::loncommon::end_page();
     &Apache::loncommon::content_type($r,'text/html');      &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;      $r->send_http_header;
       my @actions =
            (&mt('Please [_1]log in again[_2].','<a href="'.$retry.'">','</a>'));
     my $loginhelp = &loginhelpdisplay($udom);      my $loginhelp = &loginhelpdisplay($udom);
     if ($loginhelp) {      if ($loginhelp) {
         $loginhelp = '<p><a href="'.$loginhelp.'">'.&mt('Login problems?').'</a></p>';          push(@actions, '<a href="'.$loginhelp.'">'.&mt('Login problems?').'</a>');
     }      }
       #FIXME: link to helpdesk might be added here
   
     $r->print(      $r->print(
        $start_page         $start_page
       .'<h1>'.&mt('Sorry ...').'</h1>'        .'<h2>'.&mt('Sorry ...').'</h2>'
       .'<p class="LC_warning">'.&mt($message).'</p>'        .&Apache::lonhtmlcommon::confirm_success(&mt($message),1).'<br /><br />'
       .'<p>'.&mt('Please [_1]log in again[_2].','<a href="'.$retry.'">','</a>')        .&Apache::lonhtmlcommon::actionbox(\@actions)
       .'</p>'  
       .$loginhelp  
       .$end_page        .$end_page
     );      );
  }   }
Line 471  sub handler { Line 472  sub handler {
         if ($otherserver) {          if ($otherserver) {
             &success($r,$form{'uname'},$form{'udom'},$authhost,'noredirect',undef,              &success($r,$form{'uname'},$form{'udom'},$authhost,'noredirect',undef,
                      \%form);                       \%form);
     $r->internal_redirect('/adm/switchserver?otherserver='.$otherserver.'&origurl='.$firsturl);              my $switchto = '/adm/switchserver?otherserver='.$otherserver;
               if (($firsturl) && ($firsturl ne '/adm/switchserver') && ($firsturl ne '/adm/roles')) {
                   $switchto .= '&origurl='.$firsturl;
               }
               if ($form{'role'}) {
                   $switchto .= '&role='.$form{'role'};
               }
               if ($form{'symb'}) {
                   $switchto .= '&symb='.$form{'symb'};
               }
               $r->internal_redirect($switchto);
         } else {          } else {
             $r->print(&noswitch());              $r->print(&noswitch());
         }          }
Line 482  sub handler { Line 493  sub handler {
             if ($otherserver) {              if ($otherserver) {
                 &success($r,$form{'uname'},$form{'udom'},$authhost,'noredirect',undef,                  &success($r,$form{'uname'},$form{'udom'},$authhost,'noredirect',undef,
                          \%form);                           \%form);
                 $r->internal_redirect('/adm/switchserver?otherserver='.$otherserver.'&origurl='.$firsturl);                  my $switchto = '/adm/switchserver?otherserver='.$otherserver;
                   if (($firsturl) && ($firsturl ne '/adm/switchserver') && ($firsturl ne '/adm/roles')) {
                       $switchto .= '&origurl='.$firsturl;
                   }
                   if ($form{'role'}) {
                       $switchto .= '&role='.$form{'role'};
                   }
                   if ($form{'symb'}) {
                       $switchto .= '&symb='.$form{'symb'};
                   }
                   $r->internal_redirect($switchto);
             } else {              } else {
                 $r->print(&noswitch());                  $r->print(&noswitch());
             }              }

Removed from v.1.129  
changed lines
  Added in v.1.132


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