version 1.25, 2010/03/22 20:11:08
|
version 1.26, 2010/07/17 20:02:02
|
Line 83 sub handler {
|
Line 83 sub handler {
|
$env{'form.otherserver'} = |
$env{'form.otherserver'} = |
&Apache::lonnet::spareserver(30000,undef,1); |
&Apache::lonnet::spareserver(30000,undef,1); |
} |
} |
|
|
$switch_to=&Apache::lonnet::hostname($env{'form.otherserver'}); |
$switch_to=&Apache::lonnet::hostname($env{'form.otherserver'}); |
} |
} |
|
|
Line 95 sub handler {
|
Line 95 sub handler {
|
return &do_redirect($r,$url,1) |
return &do_redirect($r,$url,1) |
} |
} |
|
|
|
my $canhost = 1; |
|
my @machinedoms = &Apache::lonnet::machine_domains($switch_to); |
|
unless (grep(/^\Q$env{'user.domain'}\E/,@machinedoms)) { |
|
my $machinedom = &Apache::lonnet::host_domain($env{'form.otherserver'}); |
|
my %defdomdefaults = &Apache::lonnet::get_domain_defaults($machinedom); |
|
my %udomdefaults = &Apache::lonnet::get_domain_defaults($env{'user.domain'}); |
|
my $remoterev = &Apache::lonnet::get_server_loncaparev($env{'user.domain'},$env{'form.otherserver'}); |
|
$canhost = &Apache::lonnet::can_host_session($env{'user.domain'},$machinedom, |
|
$remoterev,$udomdefaults{'remotesessions'}, |
|
$defdomdefaults{'hostedsessions'}); |
|
} |
|
|
|
unless ($canhost) { return FORBIDDEN; } |
|
|
if ($env{'form.role'} && |
if ($env{'form.role'} && |
!exists($env{'user.role.'.$env{'form.role'}})) { return FORBIDDEN; } |
!exists($env{'user.role.'.$env{'form.role'}})) { return FORBIDDEN; } |
|
|