--- loncom/auth/lonacc.pm 2011/08/09 01:35:31 1.137 +++ loncom/auth/lonacc.pm 2012/08/21 17:51:58 1.139 @@ -1,7 +1,7 @@ # The LearningOnline Network # Cookie Based Access Handler # -# $Id: lonacc.pm,v 1.137 2011/08/09 01:35:31 raeburn Exp $ +# $Id: lonacc.pm,v 1.139 2012/08/21 17:51:58 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -156,7 +156,13 @@ sub get_posted_cgi { for ($i=0;$i<=$#lines;$i++) { if ($lines[$i]=~/^--\Q$contentsep\E/) { if ($name) { - $value=~s/[\r\n]+$//; + chomp($value); + if (($r->uri eq '/adm/portfolio') && + ($name eq 'uploaddoc')) { + if (length($value) == 1) { + $value=~s/[\r\n]$//; + } + } if (ref($fields) eq 'ARRAY') { next if (!grep(/^\Q$name\E$/,@{$fields})); } @@ -438,9 +444,17 @@ sub handler { # ------------------------------------------------------ Check if load balancer - ($is_balancer,$otherserver) = - &Apache::lonnet::check_loadbalancing($env{'user.name'}, - $env{'user.domain'}); + my $checkexempt; + if ($env{'user.loadbalexempt'} eq $r->dir_config('lonHostID')) { + if ($env{'user.loadbalcheck.time'} + 600 > time) { + $checkexempt = 1; + } + } + unless ($checkexempt) { + ($is_balancer,$otherserver) = + &Apache::lonnet::check_loadbalancing($env{'user.name'}, + $env{'user.domain'}); + } if ($is_balancer) { $r->set_handlers('PerlResponseHandler'=> [\&Apache::switchserver::handler]);