version 1.109, 2010/08/25 16:34:32
|
version 1.110, 2010/09/23 23:47:33
|
Line 352 sub handler {
|
Line 352 sub handler {
|
&Apache::lonnet::get_dom('configuration',['usercreation'],$form{'udom'}); |
&Apache::lonnet::get_dom('configuration',['usercreation'],$form{'udom'}); |
if (grep(/^login$/,@cancreate)) { |
if (grep(/^login$/,@cancreate)) { |
my $domdesc = &Apache::lonnet::domain($form{'udom'},'description'); |
my $domdesc = &Apache::lonnet::domain($form{'udom'},'description'); |
&check_can_host($r,\%form,'no_account_on_host',$domdesc); |
unless (&check_can_host($r,\%form,'no_account_on_host',$domdesc)) { |
|
return OK; |
|
} |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Create a user account in LON-CAPA'); |
&Apache::loncommon::start_page('Create a user account in LON-CAPA'); |
my $lonhost = $r->dir_config('lonHostID'); |
my $lonhost = $r->dir_config('lonHostID'); |
Line 404 sub handler {
|
Line 406 sub handler {
|
} |
} |
} |
} |
|
|
&check_can_host($r,\%form,$authhost); |
unless (&check_can_host($r,\%form,$authhost)) { |
|
return OK; |
|
} |
|
|
if ($r->dir_config("lonBalancer") eq 'yes') { |
if ($r->dir_config("lonBalancer") eq 'yes') { |
&success($r,$form{'uname'},$form{'udom'},$authhost,'noredirect',undef, |
&success($r,$form{'uname'},$form{'udom'},$authhost,'noredirect',undef, |
\%form); |
\%form); |
my ($otherserver) = &Apache::lonnet::choose_server($form{'udom'}); |
my ($otherserver) = &Apache::lonnet::choose_server($form{'udom'}); |
$r->internal_redirect('/adm/switchserver?otherserver='.$otherserver.'&origurl='.$firsturl); |
$r->internal_redirect('/adm/switchserver?otherserver='.$otherserver.'&origurl='.$firsturl); |
|
return OK; |
} else { |
} else { |
# ------------------------------------------------------- Do the load balancing |
# ------------------------------------------------------- Do the load balancing |
|
|
Line 432 sub handler {
|
Line 437 sub handler {
|
&success($r,$form{'uname'},$form{'udom'},$authhost,'noredirect', |
&success($r,$form{'uname'},$form{'udom'},$authhost,'noredirect', |
undef,\%form); |
undef,\%form); |
$r->internal_redirect('/adm/switchserver?otherserver='.$unloaded.'&origurl='.$firsturl); |
$r->internal_redirect('/adm/switchserver?otherserver='.$unloaded.'&origurl='.$firsturl); |
|
return OK; |
} |
} |
} |
} |
&success($r,$form{'uname'},$form{'udom'},$authhost,$firsturl,undef, |
&success($r,$form{'uname'},$form{'udom'},$authhost,$firsturl,undef, |
\%form); |
\%form); |
|
return OK; |
} |
} |
return OK; |
|
} |
} |
|
|
sub check_can_host { |
sub check_can_host { |
Line 492 sub check_can_host {
|
Line 498 sub check_can_host {
|
'<p>'.&mt('Currently a LON-CAPA server is not available within the [_1] domain for you to log-in to, to create an account.',$domdesc).'</p>'. |
'<p>'.&mt('Currently a LON-CAPA server is not available within the [_1] domain for you to log-in to, to create an account.',$domdesc).'</p>'. |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
} |
} |
return OK; |
|
} else { |
} else { |
&success($r,$form->{'uname'},$udom,$authhost,'noredirect',undef, |
&success($r,$form->{'uname'},$udom,$authhost,'noredirect',undef, |
$form); |
$form); |
Line 500 sub check_can_host {
|
Line 505 sub check_can_host {
|
$r->internal_redirect('/adm/switchserver?otherserver='.$otherserver); |
$r->internal_redirect('/adm/switchserver?otherserver='.$otherserver); |
} |
} |
} |
} |
|
return $canhost; |
} |
} |
|
|
1; |
1; |