version 1.53, 2008/05/29 03:27:33
|
version 1.54, 2008/05/31 23:37:46
|
Line 96 sub handler {
|
Line 96 sub handler {
|
col2 => '',}], |
col2 => '',}], |
}, |
}, |
'defaults' => |
'defaults' => |
{ text => 'Default authentication/language', |
{ text => 'Default authentication/language/timezone', |
help => '', |
help => '', |
header => [{col1 => 'Setting', |
header => [{col1 => 'Setting', |
col2 => 'Value'}], |
col2 => 'Value'}], |
Line 1782 sub print_usermodification {
|
Line 1782 sub print_usermodification {
|
|
|
sub print_defaults { |
sub print_defaults { |
my ($dom,$rowtotal) = @_; |
my ($dom,$rowtotal) = @_; |
my @items = ('auth_def','auth_arg_def','lang_def'); |
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def'); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my $titles = &defaults_titles(); |
my $titles = &defaults_titles(); |
my $rownum = 0; |
my $rownum = 0; |
Line 1814 sub print_defaults {
|
Line 1814 sub print_defaults {
|
'" value="'.$auth.'"'.$checked.'/>'. |
'" value="'.$auth.'"'.$checked.'/>'. |
$authnames{$shortauth{$auth}}.'</label> '; |
$authnames{$shortauth{$auth}}.'</label> '; |
} |
} |
|
} elsif ($item eq 'timezone_def') { |
|
my $includeempty = 1; |
|
$datatable .= &Apache::loncommon::select_timezone($item,$domdefaults{$item},undef,$includeempty); |
} else { |
} else { |
$datatable .= '<input type="text" name="'.$item.'" value="'. |
$datatable .= '<input type="text" name="'.$item.'" value="'. |
$domdefaults{$item}.'" />'; |
$domdefaults{$item}.'" />'; |
Line 1830 sub defaults_titles {
|
Line 1833 sub defaults_titles {
|
'auth_def' => 'Default authentication type', |
'auth_def' => 'Default authentication type', |
'auth_arg_def' => 'Default authentication argument', |
'auth_arg_def' => 'Default authentication argument', |
'lang_def' => 'Default language', |
'lang_def' => 'Default language', |
|
'timezone_def' => 'Default timezone', |
); |
); |
return (\%titles); |
return (\%titles); |
} |
} |
Line 4067 sub modify_defaults {
|
Line 4071 sub modify_defaults {
|
my ($dom,$r) = @_; |
my ($dom,$r) = @_; |
my ($resulttext,$mailmsgtxt,%newvalues,%changes,@errors); |
my ($resulttext,$mailmsgtxt,%newvalues,%changes,@errors); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom); |
my @items = ('auth_def','auth_arg_def','lang_def'); |
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def'); |
my @authtypes = ('internal','krb4','krb5','localauth'); |
my @authtypes = ('internal','krb4','krb5','localauth'); |
foreach my $item (@items) { |
foreach my $item (@items) { |
$newvalues{$item} = $env{'form.'.$item}; |
$newvalues{$item} = $env{'form.'.$item}; |
Line 4088 sub modify_defaults {
|
Line 4092 sub modify_defaults {
|
push(@errors,$item); |
push(@errors,$item); |
} |
} |
} |
} |
|
} elsif ($item eq 'timezone_def') { |
|
if ($newvalues{$item} ne '') { |
|
my @timezones = &DateTime::TimeZone->all_names; |
|
if (!grep(/^\Q$newvalues{$item}\E/,@timezones)) { |
|
push(@errors,$item); |
|
} |
|
} |
} |
} |
if (grep(/^\Q$item\E$/,@errors)) { |
if (grep(/^\Q$item\E$/,@errors)) { |
$newvalues{$item} = $domdefaults{$item}; |
$newvalues{$item} = $domdefaults{$item}; |
Line 4099 sub modify_defaults {
|
Line 4110 sub modify_defaults {
|
defaults => { auth_def => $newvalues{'auth_def'}, |
defaults => { auth_def => $newvalues{'auth_def'}, |
auth_arg_def => $newvalues{'auth_arg_def'}, |
auth_arg_def => $newvalues{'auth_arg_def'}, |
lang_def => $newvalues{'lang_def'}, |
lang_def => $newvalues{'lang_def'}, |
|
timezone_def => $newvalues{'timezone_def'}, |
} |
} |
); |
); |
my $title = &defaults_titles(); |
my $title = &defaults_titles(); |
Line 4131 sub modify_defaults {
|
Line 4143 sub modify_defaults {
|
my $cachetime = 24*60*60; |
my $cachetime = 24*60*60; |
&Apache::lonnet::do_cache_new('domdefaults',$dom, |
&Apache::lonnet::do_cache_new('domdefaults',$dom, |
$defaults_hash{'defaults'},$cachetime); |
$defaults_hash{'defaults'},$cachetime); |
my $sysmail = $r->dir_config('lonSysEMail'); |
if ($changes{'auth_def'} || $changes{'auth_arg_def'} || $changes{'lang_def'}) { |
&Apache::lonmsg::sendemail($sysmail,"LON-CAPA Domain Settings Change - $dom",$mailmsgtext); |
my $sysmail = $r->dir_config('lonSysEMail'); |
|
&Apache::lonmsg::sendemail($sysmail,"LON-CAPA Domain Settings Change - $dom",$mailmsgtext); |
|
} |
} else { |
} else { |
$resulttext = &mt('No changes made to default authentication/language settings'); |
$resulttext = &mt('No changes made to default authentication/language/timezone settings'); |
} |
} |
} else { |
} else { |
$resulttext = '<span class="LC_error">'. |
$resulttext = '<span class="LC_error">'. |