--- loncom/interface/domainprefs.pm 2007/08/26 15:31:03 1.25 +++ loncom/interface/domainprefs.pm 2007/09/12 12:01:04 1.27 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.25 2007/08/26 15:31:03 raeburn Exp $ +# $Id: domainprefs.pm,v 1.27 2007/09/12 12:01:04 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -67,7 +67,8 @@ sub handler { } my %domconfig = &Apache::lonnet::get_dom('configuration',['login','rolecolors', - 'quotas','autoenroll','autoupdate','directorysrch'],$dom); + 'quotas','autoenroll','autoupdate','directorysrch', + 'usercreation'],$dom); my @prefs = ( { text => 'Default color schemes', help => 'Default_Color_Schemes', @@ -113,6 +114,12 @@ sub handler { header => [{col1 => 'Setting', col2 => 'Value',}], }, + { text => 'User creation', + help => 'Domain_User_Creation', + action => 'usercreation', + header => [{col1 => 'Setting', + col2 => 'Value',}], + }, ); my @roles = ('student','coordinator','author','admin'); &Apache::lonhtmlcommon::add_breadcrumb @@ -197,6 +204,8 @@ sub process_changes { $output = &modify_autoupdate($dom,%domconfig); } elsif ($action eq 'directorysrch') { $output = &modify_directorysrch($dom,%domconfig); + } elsif ($action eq 'usercreation') { + $output = &modify_user_creation($dom,%domconfig); } return $output; } @@ -289,7 +298,9 @@ sub print_config_box { $r->print(&print_autoenroll($dom,$settings)); } elsif ($action eq 'directorysrch') { $r->print(&print_directorysrch($dom,$settings)); - } + } elsif ($action eq 'usercreation') { + $r->print(&print_usercreation($dom,$settings)); + } } $r->print(' @@ -745,7 +756,7 @@ sub print_quotas { my ($othertitle,$usertypes,$types) = &sorted_inst_types($dom); my $typecount = 0; my $css_class; - if (@{$types} > 0) { + if (ref($types) eq 'ARRAY') { foreach my $type (@{$types}) { if (defined($usertypes->{$type})) { $typecount ++; @@ -768,7 +779,7 @@ sub print_quotas { $typecount ++; $css_class = $typecount%2?' class="LC_odd_row"':''; $datatable .= ''. - ''.&mt($othertitle).''. + ''.$othertitle.''. ''. ' Mb'; @@ -878,10 +889,12 @@ sub print_autoupdate { gen => 'Generation', ); my $numrows = 0; - if (@{$types} > 0) { - $datatable = - &usertype_update_row($settings,$usertypes,\%fieldtitles, - \@fields,$types,\$numrows); + if (ref($types) eq 'ARRAY') { + if (@{$types} > 0) { + $datatable = + &usertype_update_row($settings,$usertypes,\%fieldtitles, + \@fields,$types,\$numrows); + } } $datatable .= &usertype_update_row($settings,{'default' => $othertitle}, @@ -932,6 +945,7 @@ sub print_directorysrch { my ($othertitle,$usertypes,$types) = &sorted_inst_types($dom); my $numinrow = 4; + my $cansrchrow = 0; my $datatable=''. ''.&mt('Directory search available?').''. ''. ''; - $datatable .= &users_cansearch_row($settings,$types,$usertypes,$dom, - $numinrow,$othertitle); - $datatable .= ''. - ''.&mt('Supported search methods'). + if (ref($usertypes) eq 'HASH') { + if (keys(%{$usertypes}) > 0) { + $datatable .= &users_cansearch_row($settings,$types,$usertypes,$dom, + $numinrow,$othertitle); + $cansrchrow = 1; + } + } + if ($cansrchrow) { + $datatable .= ''; + } else { + $datatable .= ''; + } + $datatable .= ''.&mt('Supported search methods'). ''; foreach my $title (@{$titleorder}) { if (defined($searchtitles->{$title})) { @@ -967,9 +990,14 @@ sub print_directorysrch { $searchtitles->{$title}.''; } } - $datatable .= '
'. - ''.&mt('Search latitude').''. - ''. + $datatable .= ''; + if ($cansrchrow) { + $datatable .= ''; + } else { + $datatable .= ''; + } + $datatable .= ''.&mt('Search latitude').''. + ''. '