$lt{'wel'}
$lt{'mes'}
$lt{'pro'}
-$remoteinfo
-$maincall
$continuelink
$end_page
ENDSUCCESS
@@ -120,15 +151,22 @@ sub failed {
my ($r,$message,$form) = @_;
my $start_page = &Apache::loncommon::start_page('Unsuccessful Login',undef,
{'no_inline_link' => 1,});
+ my $retry = '/adm/login?username='.$form->{'uname'}.
+ '&domain='.$form->{'udom'};
+ if (exists($form->{role})) {
+ $retry .= '&role='.$form->{role};
+ }
+ if (exists($form->{symb})) {
+ $retry .= '&symb='.$form->{symb};
+ }
my $end_page = &Apache::loncommon::end_page();
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
$r->print(
$start_page
.''.&mt('Sorry ...').'
'
- .''.&mt($message).'
'
- .''.&mt('Please [_1]log in again[_2].'
- ,"{'uname'}&domain=$form->{'udom'}\">",'')
+ .'
'.&mt($message).'
'
+ .''.&mt('Please [_1]log in again[_2].','','')
.'
'
.''.&mt('Login problems?').'
'
.$end_page
@@ -172,7 +210,7 @@ sub handler {
$r->print(
$start_page
.''.&mt('You are already logged in!').'
'
- .''.&mt('Please either [_1]continue the current session[_2] or [_3]logout[_4].'
+ .'
'.&mt('Please either [_1]continue the current session[_2] or [_3]log out[_4].'
,'','','','')
.'
'
.''.&mt('Login problems?').'
'
@@ -231,11 +269,25 @@ sub handler {
return OK;
}
}
+
if (!&Apache::lonnet::domain($form{'udom'})) {
&failed($r,'The domain you provided is not a valid LON-CAPA domain.',\%form);
return OK;
}
- my ($key,$firsturl)=split(/&/,$tmpinfo);
+
+ my ($key,$firsturl,$rolestr,$symbstr)=split(/&/,$tmpinfo);
+ if ($rolestr) {
+ $rolestr = &unescape($rolestr);
+ }
+ if ($symbstr) {
+ $symbstr= &unescape($symbstr);
+ }
+ if ($rolestr =~ /^role=/) {
+ (undef,$form{'role'}) = split('=',$rolestr);
+ }
+ if ($symbstr =~ /^symb=/) {
+ (undef,$form{'symb'}) = split('=',$symbstr);
+ }
my $keybin=pack("H16",$key);
@@ -298,32 +350,15 @@ sub handler {
&Apache::loncommon::build_recipient_list(undef,'helpdeskmail',
$form{'udom'},$origmail);
my ($contact_email) = split(',',$contacts);
- my ($output,$checkfail) =
- &Apache::createaccount::username_check($form{'uname'},$form{'udom'},
- $domdesc,undef,$lonhost,
- $contact_email);
+ my $output = &Apache::createaccount::username_check($form{'uname'},
+ $form{'udom'},$domdesc,'',
+ $lonhost,$contact_email,$contact_name);
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
&Apache::createaccount::print_header($r,$start_page);
- my $msg = ''.&mt('Account creation').'
'.
- ''.&mt('Although your username and password were authenticated, you do not currently have a LON-CAPA account in this domain.').'
';
- if ($checkfail) {
- $msg .= ''.&mt('Account creation unavailable').'
';
- if ($checkfail eq 'username') {
- $msg .= ''.
- &mt('A LON-CAPA account may not be created with the username you use.').'';
- } elsif ($checkfail eq 'authtoken') {
- $msg .= ''.&mt('Error creating token.').'';
- }
- &Apache::lonnet::logthis("ERROR: failure type of '$checkfail' when performing username check to create account for authenticated user: $form{'uname'}, in domain $form{'udom'}");
- $msg .= '
'.
- &mt('Please contact the [_1] ([_2]) for assistance.',
- $contact_name,$contact_email);
- } else {
- $msg .= &mt('To create one, use the table below to provide information about yourself (if appropriate), then click the "Create LON-CAPA account" button.');
- }
- $r->print($msg.$output);
- $r->print(&Apache::loncommon::end_page());
+ $r->print(''.&mt('Account creation').'
'.
+ &mt('Although your username and password were authenticated, you do not currently have a LON-CAPA account at this institution.').'
'.
+ $output.&Apache::loncommon::end_page());
return OK;
} else {
&failed($r,'Although your username and password were authenticated, you do not currently have a LON-CAPA account in this domain, and you are not permitted to create one.',\%form);