version 1.101.8.9.2.1, 2012/02/06 03:27:59
|
version 1.101.8.9.2.2, 2012/02/09 22:01:34
|
Line 82 sub success {
|
Line 82 sub success {
|
my $now=time; |
my $now=time; |
my $then=$env{'user.login.time'}; |
my $then=$env{'user.login.time'}; |
my $refresh=$env{'user.refresh.time'}; |
my $refresh=$env{'user.refresh.time'}; |
|
my $update=$env{'user.update.time'}; |
|
if (!$update) { |
|
$update = $then; |
|
} |
if (exists($env{$envkey})) { |
if (exists($env{$envkey})) { |
my ($role,$where,$trolecode,$tstart,$tend,$tremark,$tstatus); |
my ($role,$where,$trolecode,$tstart,$tend,$tremark,$tstatus); |
&Apache::lonnet::role_status($envkey,$then,$refresh,$now,\$role,\$where, |
&Apache::lonnet::role_status($envkey,$update,$refresh,$now,\$role,\$where, |
\$trolecode,\$tstatus,\$tstart,\$tend); |
\$trolecode,\$tstatus,\$tstart,\$tend); |
if ($tstatus eq 'is') { |
if ($tstatus eq 'is') { |
$destination .= ($destination =~ /\?/) ? '&' : '?'; |
$destination .= ($destination =~ /\?/) ? '&' : '?'; |
Line 111 sub success {
|
Line 115 sub success {
|
$destination .= '&destinationurl='.$destsymb; |
$destination .= '&destinationurl='.$destsymb; |
} |
} |
} |
} |
|
if ($destination =~ m{^/adm/roles}) { |
|
$destination .= ($destination =~ /\?/) ? '&' : '?'; |
|
$destination .= 'source=login'; |
|
} |
|
|
my $windowinfo=&Apache::lonmenu::open($env{'browser.os'}); |
my $windowinfo=&Apache::lonmenu::open($env{'browser.os'}); |
my $startupremote=&Apache::lonmenu::startupremote($destination); |
my $startupremote=&Apache::lonmenu::startupremote($destination); |
Line 334 sub handler {
|
Line 342 sub handler {
|
# ---------------------------------------------------------------- Authenticate |
# ---------------------------------------------------------------- Authenticate |
|
|
my %domconfig = &Apache::lonnet::get_dom('configuration',['usercreation'],$form{'udom'}); |
my %domconfig = &Apache::lonnet::get_dom('configuration',['usercreation'],$form{'udom'}); |
|
my $domdesc = &Apache::lonnet::domain($form{'udom'},'description'); |
my ($cancreate,$statustocreate) = |
my ($cancreate,$statustocreate) = |
&Apache::createaccount::get_creation_controls($form{'udom'},$domconfig{'usercreation'}); |
&Apache::createaccount::get_creation_controls($form{'udom'},$domconfig{'usercreation'}); |
my $defaultauth; |
my $defaultauth; |
Line 364 sub handler {
|
Line 373 sub handler {
|
\%form); |
\%form); |
return OK; |
return OK; |
} elsif ($authhost eq 'no_account_on_host') { |
} elsif ($authhost eq 'no_account_on_host') { |
&create_account($r,\%form,\@cancreate,$lc_uname,$contact_name); |
&create_account($r,\%form,$cancreate,$lc_uname,$contact_name,$domdesc); |
return OK; |
return OK; |
} else { |
} else { |
$form{'uname'} = $lc_uname; |
$form{'uname'} = $lc_uname; |
} |
} |
} |
} |
} elsif ($authhost eq 'no_account_on_host') { |
} elsif ($authhost eq 'no_account_on_host') { |
&create_account($r,\%form,\@cancreate,$uname,$contact_name); |
&create_account($r,\%form,$cancreate,$uname,$contact_name,$domdesc); |
return OK; |
return OK; |
} |
} |
|
|
Line 416 sub handler {
|
Line 425 sub handler {
|
} |
} |
return OK; |
return OK; |
} else { |
} else { |
if (!&check_can_host($r,\%form,$authhost)) { |
if (!&check_can_host($r,\%form,$authhost,$domdesc)) { |
my ($otherserver) = &Apache::lonnet::choose_server($form{'udom'}); |
my ($otherserver) = &Apache::lonnet::choose_server($form{'udom'}); |
if ($otherserver) { |
if ($otherserver) { |
&success($r,$form{'uname'},$form{'udom'},$authhost,'noredirect',undef, |
&success($r,$form{'uname'},$form{'udom'},$authhost,'noredirect',undef, |
Line 533 sub noswitch {
|
Line 542 sub noswitch {
|
} |
} |
|
|
sub create_account { |
sub create_account { |
my ($r,$form,$cancreate,$uname,$contact_name) = @_; |
my ($r,$form,$cancreate,$uname,$contact_name,$domdesc) = @_; |
return unless((ref($form) eq 'HASH') && (ref($cancreate) eq 'ARRAY')); |
return unless((ref($form) eq 'HASH') && (ref($cancreate) eq 'ARRAY')); |
my %domconfig = |
my %domconfig = |
&Apache::lonnet::get_dom('configuration',['usercreation'],$form->{'udom'}); |
&Apache::lonnet::get_dom('configuration',['usercreation'],$form->{'udom'}); |
if (&check_can_host($r,\%form,'no_account_on_host',$domdesc)) { |
if (&check_can_host($r,$form,'no_account_on_host',$domdesc)) { |
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', |
'',{'no_inline_link' => 1,}); |
'',{'no_inline_link' => 1,}); |
my $domdesc = &Apache::lonnet::domain($form->{'udom'},'description'); |
|
my $lonhost = $r->dir_config('lonHostID'); |
my $lonhost = $r->dir_config('lonHostID'); |
my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'}; |
my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'}; |
my $contacts = |
my $contacts = |