--- loncom/interface/createaccount.pm 2010/12/24 20:36:11 1.40.2.3 +++ loncom/interface/createaccount.pm 2011/09/29 14:12:21 1.40.2.4 @@ -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.3 2010/12/24 20:36:11 raeburn Exp $ +# $Id: createaccount.pm,v 1.40.2.4 2011/09/29 14:12:21 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -796,6 +796,17 @@ 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) = @@ -974,7 +985,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.'). @@ -1000,7 +1011,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 {