Diff for /loncom/auth/lonacc.pm between versions 1.106 and 1.110.2.1

version 1.106, 2007/01/12 15:44:27 version 1.110.2.1, 2007/11/06 18:07:35
Line 64  sub get_posted_cgi { Line 64  sub get_posted_cgi {
     if ($r->header_in('Content-length')) {      if ($r->header_in('Content-length')) {
  $r->read($buffer,$r->header_in('Content-length'),0);   $r->read($buffer,$r->header_in('Content-length'),0);
     }      }
     unless ($buffer=~/^(\-+\w+)\s+Content\-Disposition\:\s*form\-data/si) {      my $content_type = $r->header_in('Content-type');
       if ($content_type !~ m{^multipart/form-data}) {
  my @pairs=split(/&/,$buffer);   my @pairs=split(/&/,$buffer);
  my $pair;   my $pair;
  foreach $pair (@pairs) {   foreach $pair (@pairs) {
Line 76  sub get_posted_cgi { Line 77  sub get_posted_cgi {
     &Apache::loncommon::add_to_env("form.$name",$value);      &Apache::loncommon::add_to_env("form.$name",$value);
  }   }
     } else {      } else {
  my $contentsep=$1;   my ($contentsep) = ($content_type =~ /boundary=\"?([^\";,]+)\"?/);
  my @lines = split (/\n/,$buffer);   my @lines = split (/\n/,$buffer);
  my $name='';   my $name='';
  my $value='';   my $value='';
Line 84  sub get_posted_cgi { Line 85  sub get_posted_cgi {
  my $fmime='';   my $fmime='';
  my $i;   my $i;
  for ($i=0;$i<=$#lines;$i++) {   for ($i=0;$i<=$#lines;$i++) {
     if ($lines[$i]=~/^$contentsep/) {      if ($lines[$i]=~/^--\Q$contentsep\E/) {
  if ($name) {   if ($name) {
     chomp($value);      chomp($value);
     if ($fname) {      if ($fname) {
Line 160  sub sso_login { Line 161  sub sso_login {
     my $domain = $r->dir_config('lonDefDomain');      my $domain = $r->dir_config('lonDefDomain');
     my $home=&Apache::lonnet::homeserver($user,$domain);      my $home=&Apache::lonnet::homeserver($user,$domain);
     if ($home !~ /(con_lost|no_host|no_such_host)/) {      if ($home !~ /(con_lost|no_host|no_such_host)/) {
    &Apache::lonnet::logthis(" SSO authorized user $user ");
  if ($r->dir_config("lonBalancer") eq 'yes') {   if ($r->dir_config("lonBalancer") eq 'yes') {
     # login but immeaditly go to switch server to find us a new       # login but immeaditly go to switch server to find us a new 
     # machine      # machine
Line 193  sub sso_login { Line 195  sub sso_login {
  }   }
  return OK;   return OK;
     } elsif (defined($r->dir_config('lonSSOUserUnknownRedirect'))) {      } elsif (defined($r->dir_config('lonSSOUserUnknownRedirect'))) {
    &Apache::lonnet::logthis(" SSO authorized unknown user $user ");
         $r->subprocess_env->set('SSOUserUnknown' => $user);          $r->subprocess_env->set('SSOUserUnknown' => $user);
         $r->subprocess_env->set('SSOUserDomain' => $domain);          $r->subprocess_env->set('SSOUserDomain' => $domain);
  $r->internal_redirect($r->dir_config('lonSSOUserUnknownRedirect'));   $r->internal_redirect($r->dir_config('lonSSOUserUnknownRedirect'));
Line 205  sub sso_login { Line 208  sub sso_login {
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
     my $requrl=$r->uri;      my $requrl=$r->uri;
       if (&Apache::lonnet::is_domainimage($requrl)) {
           return OK;
       }
     my %cookies=CGI::Cookie->parse($r->header_in('Cookie'));      my %cookies=CGI::Cookie->parse($r->header_in('Cookie'));
     my $lonid=$cookies{'lonID'};      my $lonid=$cookies{'lonID'};
     my $cookie;      my $cookie;
Line 282  sub handler { Line 288  sub handler {
  $env{'user.domain'};   $env{'user.domain'};
     if ($requrl !~ /^\Q$start\E/) {      if ($requrl !~ /^\Q$start\E/) {
  $env{'user.error.msg'}="$requrl:bre:1:1:Access Denied";   $env{'user.error.msg'}="$requrl:bre:1:1:Access Denied";
    return HTTP_NOT_ACCEPTABLE;
       }
    }
    if ($requrl =~ m|^/zipspool/|) {
       my $start='/zipspool/zipout/'.$env{'user.name'}.":".
    $env{'user.domain'};
       if ($requrl !~ /^\Q$start\E/) {
    $env{'user.error.msg'}="$requrl:bre:1:1:Access Denied";
  return HTTP_NOT_ACCEPTABLE;   return HTTP_NOT_ACCEPTABLE;
     }      }
  }   }

Removed from v.1.106  
changed lines
  Added in v.1.110.2.1


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