--- loncom/interface/domainprefs.pm 2009/03/31 16:59:01 1.91
+++ loncom/interface/domainprefs.pm 2009/05/07 19:36:49 1.95
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.91 2009/03/31 16:59:01 raeburn Exp $
+# $Id: domainprefs.pm,v 1.95 2009/05/07 19:36:49 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -162,7 +162,7 @@ sub handler {
col2 => 'Information settable when self-creating account (if directory data blank)'}],
},
'scantron' =>
- { text => 'Scantron format file',
+ { text => 'Bubblesheet format file',
help => 'Domain_Configuration_Scantron_Format',
header => [ {col1 => 'Item',
col2 => '',
@@ -204,7 +204,6 @@ sub handler {
&Apache::lonconfigsettings::display_settings($r,$dom,$phase,$context,\@prefs_order,\%prefs,\%domconfig,$confname);
} else {
if (keys(%domconfig) == 0) {
- &Apache::lonconfigsettings::print_header($r,$phase,$context);
my $primarylibserv = &Apache::lonnet::domain($dom,'primary');
my @ids=&Apache::lonnet::current_machine_ids();
if (!grep(/^\Q$primarylibserv\E$/,@ids)) {
@@ -222,6 +221,7 @@ sub handler {
}
}
if ($custom_img_count > 0) {
+ &Apache::lonconfigsettings::print_header($r,$phase,$context);
my $switch_server = &check_switchserver($dom,$confname);
$r->print(
&mt('Domain configuration settings have yet to be saved for this domain via the web-based domain preferences interface.').'
'.
@@ -242,7 +242,11 @@ sub handler {
}
sub process_changes {
- my ($r,$dom,$confname,$action,$roles,%domconfig) = @_;
+ my ($r,$dom,$confname,$action,$roles,$values) = @_;
+ my %domconfig;
+ if (ref($values) eq 'HASH') {
+ %domconfig = %{$values};
+ }
my $output;
if ($action eq 'login') {
$output = &modify_login($r,$dom,$confname,%domconfig);
@@ -1295,8 +1299,8 @@ sub print_directorysrch {
$$rowtotal += 2;
if (ref($usertypes) eq 'HASH') {
if (keys(%{$usertypes}) > 0) {
- $datatable .= &users_cansearch_row($settings,$types,$usertypes,$dom,
- $numinrow,$othertitle);
+ $datatable .= &insttypes_row($settings,$types,$usertypes,$dom,
+ $numinrow,$othertitle,'cansearch');
$cansrchrow = 1;
}
}
@@ -1311,7 +1315,7 @@ sub print_directorysrch {
foreach my $title (@{$titleorder}) {
if (defined($searchtitles->{$title})) {
my $check = ' ';
- if (ref($settings) eq 'HASH') {
+ if (ref($settings) eq 'HASH') {
if (ref($settings->{'searchby'}) eq 'ARRAY') {
if (grep(/^\Q$title\E$/,@{$settings->{'searchby'}})) {
$check = ' checked="checked" ';
@@ -1566,6 +1570,16 @@ sub print_usercreation {
}
$datatable .= '';
}
+ my ($othertitle,$usertypes,$types) =
+ &Apache::loncommon::sorted_inst_types($dom);
+ if (ref($usertypes) eq 'HASH') {
+ if (keys(%{$usertypes}) > 0) {
+ $datatable .= &insttypes_row($settings->{cancreate},$types,$usertypes,
+ $dom,$numinrow,$othertitle,
+ 'statustocreate');
+ $$rowtotal ++;
+ }
+ }
} else {
my @contexts = ('author','course','domain');
my @authtypes = ('int','krb4','krb5','loc');
@@ -1819,8 +1833,8 @@ sub print_scantronformat {
%confhash);
my $switchserver = &check_switchserver($dom,$confname);
my %lt = &Apache::lonlocal::texthash (
- default => 'Default scantron format file error',
- custom => 'Custom scantron format file error',
+ default => 'Default bubblesheet format file error',
+ custom => 'Custom bubblesheet format file error',
);
my %scantronfiles = (
default => 'default.tab',
@@ -1893,7 +1907,7 @@ sub print_scantronformat {
}
}
} else {
- $error{'default'} = &mt("Unable to copy default scantron formatfile to domain's RES space: [_1]",$switchserver);
+ $error{'default'} = &mt("Unable to copy default bubblesheet formatfile to domain's RES space: [_1]",$switchserver);
}
}
if (ref($settings) eq 'HASH') {
@@ -2456,10 +2470,18 @@ sub modifiable_userdata_row {
return $output;
}
-sub users_cansearch_row {
- my ($settings,$types,$usertypes,$dom,$numinrow,$othertitle) = @_;
+sub insttypes_row {
+ my ($settings,$types,$usertypes,$dom,$numinrow,$othertitle,$context) = @_;
+ my %lt = &Apache::lonlocal::texthash (
+ cansearch => 'Users allowed to search',
+ statustocreate => 'Institutional affiliation(s) able to create own account (login/SSO)',
+ );
+ my $showdom;
+ if ($context eq 'cansearch') {
+ $showdom = ' ('.$dom.')';
+ }
my $output = '
'. ' | '; } @@ -2495,13 +2519,15 @@ sub users_cansearch_row { $output .= ''; } my $defcheck = ' '; - if (ref($settings->{'cansearch'}) eq 'ARRAY') { - if (grep(/^default$/,@{$settings->{'cansearch'}})) { + if (ref($settings->{$context}) eq 'ARRAY') { + if (grep(/^default$/,@{$settings->{$context}})) { $defcheck = ' checked="checked" '; } + } elsif ($context eq 'statustocreate') { + $defcheck = ' checked="checked" '; } $output .= ' | '. '