--- loncom/interface/createaccount.pm 2011/09/29 14:16:14 1.40.2.5 +++ loncom/interface/createaccount.pm 2010/08/22 19:28:28 1.41 @@ -3,7 +3,7 @@ # institutional log-in ID (institutional authentication required - localauth # or kerberos) or an e-mail address. # -# $Id: createaccount.pm,v 1.40.2.5 2011/09/29 14:16:14 raeburn Exp $ +# $Id: createaccount.pm,v 1.41 2010/08/22 19:28:28 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -128,8 +128,7 @@ sub handler { return OK; } else { $start_page = - &Apache::loncommon::start_page($title,$js, - {'no_inline_link' => 1,}); + &Apache::loncommon::start_page($title,$js); &print_header($r,$start_page,$courseid); $r->print($output); &print_footer($r); @@ -137,8 +136,8 @@ sub handler { } } $start_page = - &Apache::loncommon::start_page($title,$js, - {'no_inline_link' => 1,}); + &Apache::loncommon::start_page($title,$js); + my %domconfig = &Apache::lonnet::get_dom('configuration',['usercreation'],$domain); my ($cancreate,$statustocreate) = &get_creation_controls($domain,$domconfig{'usercreation'}); @@ -285,7 +284,7 @@ sub selfenroll_crumbs { } my $last_crumb; if ($desc ne '') { - $last_crumb = &mt('Self-enroll in [_1]',"$desc"); + $last_crumb = &mt('Self-enroll in [_1]',''.$desc.''); } else { $last_crumb = &mt('Self-enroll'); } @@ -411,7 +410,7 @@ sub print_username_form { } else { $output .= '
'; } - $output .= '
'. + $output .= ''. &Apache::lonhtmlcommon::start_pick_box()."\n". &Apache::lonhtmlcommon::row_title(&mt('E-mail address'), 'LC_pick_box_title')."\n". @@ -465,7 +464,7 @@ sub login_box { $output = &serverform($logtoken,$lonhost,undef,$courseid,$context); my $unameform = ''; my $upassform = ''; - $output .= ''."\n". + $output .= ''."\n". &Apache::lonhtmlcommon::start_pick_box()."\n". &Apache::lonhtmlcommon::row_title($titles{$context}, 'LC_pick_box_title')."\n". @@ -751,7 +750,7 @@ ENDSERVERFORM my $upasstwo = ''; my $submit_text = &mt('Create LON-CAPA account'); $output .= '

'.&mt('Login Data').'

'."\n". - ''."\n". &Apache::lonhtmlcommon::start_pick_box()."\n". &Apache::lonhtmlcommon::row_title(&mt('Username'), @@ -796,17 +795,6 @@ sub get_creation_controls { if (ref($usercreation->{'cancreate'}) eq 'HASH') { if (ref($usercreation->{'cancreate'}{'statustocreate'}) eq 'ARRAY') { @statustocreate = @{$usercreation->{'cancreate'}{'statustocreate'}}; - if (@statustocreate == 0) { - my ($othertitle,$usertypes,$types) = - &Apache::loncommon::sorted_inst_types($domain); - if (ref($types) eq 'ARRAY') { - if (@{$types} == 0) { - @statustocreate = ('default'); - } - } else { - @statustocreate = ('default'); - } - } } else { @statustocreate = ('default'); my ($othertitle,$usertypes,$types) = @@ -985,7 +973,7 @@ sub username_check { } } if ($checkfail) { - $msg = '

'.&mt('Account creation unavailable').'

'; + $msg = '

'.&mt('Account creation unavailable').'

'; if ($checkfail eq 'username') { $msg .= ''. &mt('A LON-CAPA account may not be created with the username you use.'). @@ -1011,7 +999,7 @@ sub username_check { if ($rowcount) { if ($editable) { if ($courseid ne '') { - $msg = '

'.&mt('User information').'

'; + $msg = '

'.&mt('User information').'

'; } $msg .= &mt('To create one, use the table below to provide information about yourself, then click the [_1]Create LON-CAPA account[_2] button.','','').'
'; } else { @@ -1148,38 +1136,32 @@ sub invalid_state { my ($error,$domdesc,$contact_name,$contact_email,$msgtext) = @_; my $msg = '

'.&mt('Account creation unavailable').'

'; if ($error eq 'baduseremail') { - $msg .= &mt('The e-mail address you provided does not appear to be a valid address.'); + $msg = &mt('The e-mail address you provided does not appear to be a valid address.'); } elsif ($error eq 'existinguser') { - $msg .= &mt('The e-mail address you provided is already in use as a username in LON-CAPA at this institution.'); + $msg = &mt('The e-mail address you provided is already in use as a username in LON-CAPA at this institution.'); } elsif ($error eq 'userrules') { - $msg .= &mt('Username rules at this institution do not allow the e-mail address you provided to be used as a username.'); + $msg = &mt('Username rules at this institution do not allow the e-mail address you provided to be used as a username.'); } elsif ($error eq 'userformat') { - $msg .= &mt('The e-mail address you provided may not be used as a username at this LON-CAPA institution.'); + $msg = &mt('The e-mail address you provided may not be used as a username at this LON-CAPA institution.'); } elsif ($error eq 'captcha') { - $msg .= &mt('Validation of the code you entered failed.'); + $msg = &mt('Validation of the code your entered failed.'); } elsif ($error eq 'noemails') { - $msg .= &mt('Creation of a new user account using an e-mail address as username is not permitted at this LON-CAPA institution.'); + $msg = &mt('Creation of a new user account using an e-mail address as username is not permitted at this LON-CAPA institution.'); } $msg .= ''; if ($msgtext) { $msg .= '
'.$msgtext; } - $msg .= &linkto_email_help($contact_email,$domdesc,$error); + $msg .= &linkto_email_help($contact_email,$domdesc); return $msg; } sub linkto_email_help { - my ($contact_email,$domdesc,$error) = @_; + my ($contact_email,$domdesc) = @_; my $msg; - my $href = '/adm/helpdesk'; if ($contact_email ne '') { my $escuri = &HTML::Entities::encode('/adm/createaccount','&<>"'); - $href .= '?origurl='.$escuri; - if ($error eq 'existinguser') { - my $escemail = &HTML::Entities::encode($env{'form.useremail'}); - $href .= '&useremail='.$escemail.'&useraccount='.$escemail; - } - $msg .= '
'.&mt('You may wish to contact the [_1]LON-CAPA helpdesk[_2] for [_3].','','',$domdesc).'
'; + $msg .= '
'.&mt('You may wish to contact the [_1]LON-CAPA helpdesk[_2] for [_3].','','',$domdesc).'
'; } else { $msg .= '
'.&mt('You may wish to send an e-mail to the server administrator: [_1] for [_2].',$Apache::lonnet::perlvar{'AdminEmail'},$domdesc).'
'; }