version 1.2, 2005/10/24 21:35:16
|
version 1.4, 2005/10/28 21:51:43
|
Line 65 sub handler {
|
Line 65 sub handler {
|
|
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['otherserver','role']); |
['otherserver','role']); |
|
|
my $switch_to=$Apache::lonnet::hostname{$env{'form.otherserver'}}; |
my $switch_to=$Apache::lonnet::hostname{$env{'form.otherserver'}}; |
|
if (!$env{'form.otherserver'}) { |
|
$env{'form.otherserver'}=&Apache::lonnet::spareserver(30000,undef,1); |
|
$switch_to=$Apache::lonnet::hostname{$env{'form.otherserver'}}; |
|
} |
if (!defined($switch_to)) { return FORBIDDEN; } |
if (!defined($switch_to)) { return FORBIDDEN; } |
if (!exists($env{'user.role.'.$env{'form.role'}})) { return FORBIDDEN; } |
|
|
if ($env{'form.role'} && |
|
!exists($env{'user.role.'.$env{'form.role'}})) { return FORBIDDEN; } |
|
|
#remove session env, and log event |
#remove session env, and log event |
unlink($r->dir_config('lonIDsDir')."/$handle.id"); |
unlink($r->dir_config('lonIDsDir')."/$handle.id"); |
Line 87 sub handler {
|
Line 94 sub handler {
|
$windowinfo.=&Apache::lonnavmaps::close(); |
$windowinfo.=&Apache::lonnavmaps::close(); |
# ---------------------------------------------------------------- Get handover |
# ---------------------------------------------------------------- Get handover |
|
|
my $token = &Apache::lonnet::reply('tmpput:'.join('&',$ENV{'REMOTE_ADDR'},$env{'user.domain'},$env{'user.name'},$env{'form.role'}),$env{'form.otherserver'}); |
my %info=('ip' => $ENV{'REMOTE_ADDR'}, |
|
'domain' => $env{'user.domain'}, |
|
'username' => $env{'user.name'}, |
|
'role' => $env{'form.role'}, |
|
'server' => $r->dir_config('lonHostID')); |
|
my $token = &Apache::lonnet::tmpput(\%info,$env{'form.otherserver'}); |
my $switch='<meta HTTP-EQUIV="Refresh" CONTENT="0.5; url=http://'.$switch_to.'/adm/migrateuser?token='.$token.'">'; |
my $switch='<meta HTTP-EQUIV="Refresh" CONTENT="0.5; url=http://'.$switch_to.'/adm/migrateuser?token='.$token.'">'; |
my $bodytag=&Apache::loncommon::bodytag('Switching Server ...'); |
my $bodytag=&Apache::loncommon::bodytag('Switching Server ...'); |
# --------------------------------------------------------------- Screen Output |
# --------------------------------------------------------------- Screen Output |