--- loncom/auth/lonacc.pm 2013/05/10 17:49:17 1.144 +++ loncom/auth/lonacc.pm 2013/12/01 21:29:10 1.146 @@ -1,7 +1,7 @@ # The LearningOnline Network # Cookie Based Access Handler # -# $Id: lonacc.pm,v 1.144 2013/05/10 17:49:17 raeburn Exp $ +# $Id: lonacc.pm,v 1.146 2013/12/01 21:29:10 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -89,8 +89,6 @@ store attempted access =head1 NOTABLE SUBROUTINES -=over - =cut @@ -230,6 +228,8 @@ sub get_posted_cgi { =pod +=over + =item upload_size_allowed() Perform size checks for file uploads to essayresponse items in course context. @@ -287,7 +287,7 @@ sub sso_login { my $query = $r->args; my %form; if ($query) { - my @items = ('role','symb'); + my @items = ('role','symb','iptoken'); &Apache::loncommon::get_unprocessed_cgi($query,\@items); foreach my $item (@items) { if (defined($env{'form.'.$item})) { @@ -296,6 +296,12 @@ sub sso_login { } } + my %sessiondata; + if ($form{'iptoken'}) { + %sessiondata = &Apache::lonnet::tmpget($form{'iptoken'}); + my $delete = &Apache::lonnet::tmpdel($form{'token'}); + } + my $domain = $r->dir_config('lonSSOUserDomain'); if ($domain eq '') { $domain = $r->dir_config('lonDefDomain'); @@ -303,8 +309,18 @@ sub sso_login { my $home=&Apache::lonnet::homeserver($user,$domain); if ($home !~ /(con_lost|no_host|no_such_host)/) { &Apache::lonnet::logthis(" SSO authorized user $user "); - my ($is_balancer,$otherserver) = - &Apache::lonnet::check_loadbalancing($user,$domain); + my ($is_balancer,$otherserver,$hosthere); + if ($form{'iptoken'}) { + if (($sessiondata{'domain'} eq $form{'udom'}) && + ($sessiondata{'username'} eq $form{'uname'})) { + $hosthere = 1; + } + } + unless ($hosthere) { + ($is_balancer,$otherserver) = + &Apache::lonnet::check_loadbalancing($user,$domain); + } + if ($is_balancer) { # login but immediately go to switch server to find us a new # machine @@ -477,6 +493,9 @@ sub handler { $checkexempt = 1; } } + if ($env{'user.noloadbalance'} eq $r->dir_config('lonHostID')) { + $checkexempt = 1; + } unless ($checkexempt) { ($is_balancer,$otherserver) = &Apache::lonnet::check_loadbalancing($env{'user.name'},