version 1.28, 2010/07/22 21:44:25
|
version 1.28.2.4, 2011/08/02 14:20:42
|
Line 59 sub do_redirect {
|
Line 59 sub do_redirect {
|
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Switching Server ...',undef, |
&Apache::loncommon::start_page('Switching Server ...',undef, |
{'redirect' => [0.5,$url], |
{'redirect' => [0.5,$url], |
|
'no_inline_link' => 1, |
'only_body' => $only_body,}); |
'only_body' => $only_body,}); |
my $end_page = &Apache::loncommon::end_page(); |
my $end_page = &Apache::loncommon::end_page(); |
$r->print($start_page.$extra_text.$end_page); |
$r->print($start_page.$extra_text.$end_page); |
|
unless ($env{'user.name'} eq 'public' && ($env{'user.domain'} eq 'public')) { |
|
$r->register_cleanup(\&flush_course_logs); |
|
} |
return OK; |
return OK; |
|
|
} |
} |
|
|
|
sub flush_course_logs { |
|
&Apache::lonnet::flushcourselogs(); |
|
return OK; |
|
} |
|
|
sub handler { |
sub handler { |
my ($r) = @_; |
my ($r) = @_; |
|
|
Line 108 sub handler {
|
Line 117 sub handler {
|
if (&Apache::lonnet::homeserver($env{'user.name'},$env{'user.domain'}) eq $env{'form.otherserver'}) { |
if (&Apache::lonnet::homeserver($env{'user.name'},$env{'user.domain'}) eq $env{'form.otherserver'}) { |
$skip_canhost_check = 1; |
$skip_canhost_check = 1; |
} |
} |
} elsif ($env{'form.role'} =~ m{^[ac]a\./($match_domain)/($match_username)/$}) { |
} elsif ($env{'form.role'} =~ m{^[ac]a\./($match_domain)/($match_username)$}) { |
if (&Apache::lonnet::homeserver($2,$1) eq $env{'form.otherserver'}) { |
if (&Apache::lonnet::homeserver($2,$1) eq $env{'form.otherserver'}) { |
$skip_canhost_check = 1; |
$skip_canhost_check = 1; |
} |
} |
Line 120 sub handler {
|
Line 129 sub handler {
|
my $canhost = 1; |
my $canhost = 1; |
my $uprimary_id = &Apache::lonnet::domain($env{'user.domain'},'primary'); |
my $uprimary_id = &Apache::lonnet::domain($env{'user.domain'},'primary'); |
my $uint_dom = &Apache::lonnet::internet_dom($uprimary_id); |
my $uint_dom = &Apache::lonnet::internet_dom($uprimary_id); |
my @intdoms = &Apache::lonnet::get_internet_names($env{'form.otherserver'}); |
my @intdoms; |
|
my $internet_names = &Apache::lonnet::get_internet_names($env{'form.otherserver'}); |
|
if (ref($internet_names) eq 'ARRAY') { |
|
@intdoms = @{$internet_names}; |
|
} |
unless ($uint_dom ne '' && grep(/^\Q$uint_dom\E$/,@intdoms)) { |
unless ($uint_dom ne '' && grep(/^\Q$uint_dom\E$/,@intdoms)) { |
my $serverhomeID = &Apache::lonnet::get_server_homeID($switch_to); |
my $serverhomeID = &Apache::lonnet::get_server_homeID($switch_to); |
my $serverhomedom = &Apache::lonnet::host_domain($serverhomeID); |
my $serverhomedom = &Apache::lonnet::host_domain($serverhomeID); |
Line 159 sub handler {
|
Line 172 sub handler {
|
return OK; |
return OK; |
} |
} |
# -------------------------------------------------------- Menu script and info |
# -------------------------------------------------------- Menu script and info |
|
|
|
my $windowinfo= |
|
&Apache::lonmenu::close(). |
|
&Apache::lonnavmaps::close(); |
# ---------------------------------------------------------------- Get handover |
# ---------------------------------------------------------------- Get handover |
|
|
my %info=('ip' => $ENV{'REMOTE_ADDR'}, |
my %info=('ip' => $ENV{'REMOTE_ADDR'}, |
Line 185 sub handler {
|
Line 201 sub handler {
|
'&username='.$env{'user.name'}. |
'&username='.$env{'user.name'}. |
'&token='.$token; |
'&token='.$token; |
# --------------------------------------------------------------- Screen Output |
# --------------------------------------------------------------- Screen Output |
&Apache::lonnet::flushcourselogs(); |
return &do_redirect($r,$url,0,$windowinfo); |
return &do_redirect($r, $url, 0); |
|
} |
} |
|
|
1; |
1; |