--- loncom/auth/lonacc.pm 2017/01/21 20:40:46 1.159.2.5 +++ loncom/auth/lonacc.pm 2019/02/06 15:14:10 1.159.2.5.2.3 @@ -1,7 +1,7 @@ # The LearningOnline Network # Cookie Based Access Handler # -# $Id: lonacc.pm,v 1.159.2.5 2017/01/21 20:40:46 raeburn Exp $ +# $Id: lonacc.pm,v 1.159.2.5.2.3 2019/02/06 15:14:10 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -159,7 +159,7 @@ sub get_posted_cgi { if (length($value) == 1) { $value=~s/[\r\n]$//; } - } elsif ($fname =~ /\.(xls|doc|ppt)x$/i) { + } elsif ($fname =~ /\.(xls|doc|ppt)(x|m)$/i) { $value=~s/[\r\n]$//; } if (ref($fields) eq 'ARRAY') { @@ -281,7 +281,6 @@ sub upload_size_allowed { sub sso_login { my ($r,$handle,$username) = @_; - my $lonidsdir=$r->dir_config('lonIDsDir'); if (($r->user eq '') || ($username ne '') || ($r->user eq 'public:public') || (defined($env{'user.name'}) && (defined($env{'user.domain'})) && ($handle ne ''))) { @@ -352,6 +351,14 @@ sub sso_login { # login but immediately go to switch server to find us a new # machine &Apache::lonauth::success($r,$user,$domain,$home,'noredirect'); + foreach my $item (keys(%form)) { + $env{'form.'.$item} = $form{$item}; + } + unless ($form{'symb'}) { + unless (($r->uri eq '/adm/roles') || ($r->uri eq '/adm/sso')) { + $env{'form.origurl'} = $r->uri; + } + } $env{'request.sso.login'} = 1; if (defined($r->dir_config("lonSSOReloginServer"))) { $env{'request.sso.reloginserver'} = @@ -517,7 +524,8 @@ sub handler { } } elsif ($env{'request.course.id'} && (($requrl =~ m{^/adm/$match_domain/$match_username/aboutme$}) || - ($requrl =~ m{^/public/$cdom/$cnum/syllabus$}))) { + ($requrl =~ m{^/public/$cdom/$cnum/syllabus$}) || + ($requrl =~ m{^/adm/$cdom/$cnum/\d+/ext\.tool$}))) { my $query = $r->args; if ($query) { foreach my $pair (split(/&/,$query)) { @@ -538,6 +546,7 @@ sub handler { my $lonhost = &Apache::lonnet::host_from_dns($hostname); if ($lonhost) { my $actual = &Apache::lonnet::absolute_url($hostname); + my $exphostname = &Apache::lonnet::hostname($lonhost); my $expected = $Apache::lonnet::protocol{$lonhost}.'://'.$hostname; unless ($actual eq $expected) { $env{'request.use_absolute'} = $expected; @@ -575,6 +584,9 @@ sub handler { $env{'form.origurl'} = $r->uri; } } + if ($requrl=~m{^/+tiny/+$match_domain/+\w+$}) { + return OK; + } # ---------------------------------------------------------------- Check access my $now = time; @@ -665,7 +677,8 @@ sub handler { ($requrl=~m|\.problem/smpedit$|) || ($requrl=~/^\/public\/.*\/syllabus$/) || ($requrl=~/^\/adm\/(viewclasslist|navmaps)$/) || - ($requrl=~/^\/adm\/.*\/aboutme\/portfolio(\?|$)/)) { + ($requrl=~/^\/adm\/.*\/aboutme\/portfolio(\?|$)/) || + ($requrl=~m{^/adm/$cdom/$cnum/\d+/ext\.tool$})) { # ------------------------------------- This is serious stuff, get symb and log my $symb; if ($query) {