version 1.20, 2013/12/30 20:55:42
|
version 1.22, 2014/10/05 13:49:11
|
Line 72 sub ip_changed {
|
Line 72 sub ip_changed {
|
if (ref($dataref) eq 'HASH') { |
if (ref($dataref) eq 'HASH') { |
my $title = 'LON-CAPA Session redirected'; |
my $title = 'LON-CAPA Session redirected'; |
my $message = &mt('Your internet address has changed since you logged in.'); |
my $message = &mt('Your internet address has changed since you logged in.'); |
my $camefrom = &Apache::lonnet::hostname($dataref->{'server'}); |
|
my $frombalancer = $dataref->{'balancer'}; |
|
my $rule_in_effect; |
my $rule_in_effect; |
if ($frombalancer) { |
if ($dataref->{'balancer'}) { |
my $balancerdom = &Apache::lonnet::host_domain($dataref->{'server'}); |
my $baldom = &Apache::lonnet::host_domain($camefrom); |
my ($result,$cached)=&Apache::lonnet::is_cached_new('loadbalancing',$balancerdom); |
my $balprimaryid = &Apache::lonnet::domain($baldom,'primary'); |
|
my $balintdom = &Apache::lonnet::internet_dom($balprimaryid); |
|
my $uprimaryid = &Apache::lonnet::domain($udom,'primary'); |
|
my $uintdom = &Apache::lonnet::internet_dom($uprimaryid); |
|
my $dom_in_use; |
|
if (($uintdom ne '') && ($uintdom eq $balintdom)) { |
|
$dom_in_use = $udom; |
|
} else { |
|
$dom_in_use = $baldom; |
|
} |
|
my ($result,$cached)=&Apache::lonnet::is_cached_new('loadbalancing',$dom_in_use); |
unless (defined($cached)) { |
unless (defined($cached)) { |
my $cachetime = 60*60*24; |
my $cachetime = 60*60*24; |
my %domconfig = |
my %domconfig = |
&Apache::lonnet::get_dom('configuration',['loadbalancing'],$balancerdom); |
&Apache::lonnet::get_dom('configuration',['loadbalancing'],$dom_in_use); |
if (ref($domconfig{'loadbalancing'}) eq 'HASH') { |
if (ref($domconfig{'loadbalancing'}) eq 'HASH') { |
$result = &Apache::lonnet::do_cache_new('loadbalancing',$balancerdom, |
$result = &Apache::lonnet::do_cache_new('loadbalancing',$dom_in_use, |
$domconfig{'loadbalancing'},$cachetime); |
$domconfig{'loadbalancing'},$cachetime); |
} |
} |
} |
} |
Line 140 sub ip_changed {
|
Line 148 sub ip_changed {
|
} |
} |
} |
} |
if ($dataref->{'sso.login'}) { |
if ($dataref->{'sso.login'}) { |
$url .= '/adm/roles?'; |
$url .= '/adm/roles'; |
} else { |
} else { |
$url .= '/adm/login?'; |
$url .= '/adm/login'; |
$message .= '<br />'.&mt('You will need to provide your password one more time.'); |
$message .= '<br />'.&mt('You will need to provide your password one more time.'); |
} |
} |
my %info= ( |
my %info= ( |
Line 159 sub ip_changed {
|
Line 167 sub ip_changed {
|
} |
} |
my $iptoken = &Apache::lonnet::tmpput(\%info,$switchto); |
my $iptoken = &Apache::lonnet::tmpput(\%info,$switchto); |
unless ($iptoken eq 'conlost') { |
unless ($iptoken eq 'conlost') { |
$url .= 'iptoken='.$iptoken; |
$url .= '?iptoken='.$iptoken; |
} |
} |
$r->print(&Apache::loncommon::start_page($title,undef, |
$r->print(&Apache::loncommon::start_page($title,undef, |
{'redirect' => |
{'redirect' => |
Line 206 sub handler {
|
Line 214 sub handler {
|
if ($data{'symb'} ne '') { |
if ($data{'symb'} ne '') { |
$form{'symb'} = $data{'symb'}; |
$form{'symb'} = $data{'symb'}; |
} |
} |
|
if ($data{'iptoken'} ne '') { |
|
$form{'iptoken'} = $data{'iptoken'}; |
|
} |
|
|
if (!$data{'role'}) { |
if (!$data{'role'}) { |
my $handle = &Apache::lonnet::check_for_valid_session($r); |
my $handle = &Apache::lonnet::check_for_valid_session($r); |