version 1.140, 2010/10/05 18:42:45
|
version 1.141, 2010/12/08 03:38:46
|
Line 230 sub handler {
|
Line 230 sub handler {
|
}, |
}, |
|
|
'defaults' => |
'defaults' => |
{ text => 'Default authentication/language/timezone', |
{ text => 'Default authentication/language/timezone/portal', |
help => 'Domain_Configuration_LangTZAuth', |
help => 'Domain_Configuration_LangTZAuth', |
header => [{col1 => 'Setting', |
header => [{col1 => 'Setting', |
col2 => 'Value'}], |
col2 => 'Value'}], |
Line 351 sub handler {
|
Line 351 sub handler {
|
header => [{col1 => 'Setting', |
header => [{col1 => 'Setting', |
col2 => 'Value',}], |
col2 => 'Value',}], |
}, |
}, |
'usersessions' => |
'usersessions' => |
{text => 'User session hosting', |
{text => 'User session hosting', |
help => 'Domain_Configuration_User_Sessions', |
help => 'Domain_Configuration_User_Sessions', |
header => [{col1 => 'Hosting of users from other domains', |
header => [{col1 => 'Hosting of users from other domains', |
Line 2825 sub print_usermodification {
|
Line 2825 sub print_usermodification {
|
sub print_defaults { |
sub print_defaults { |
my ($dom,$rowtotal) = @_; |
my ($dom,$rowtotal) = @_; |
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def', |
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def', |
'datelocale_def'); |
'datelocale_def','portal_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($dom); |
my $rownum = 0; |
my $rownum = 0; |
my ($datatable,$css_class); |
my ($datatable,$css_class); |
foreach my $item (@items) { |
foreach my $item (@items) { |
Line 2864 sub print_defaults {
|
Line 2864 sub print_defaults {
|
my $includeempty = 1; |
my $includeempty = 1; |
$datatable .= &Apache::loncommon::select_datelocale($item,$domdefaults{$item},undef,$includeempty); |
$datatable .= &Apache::loncommon::select_datelocale($item,$domdefaults{$item},undef,$includeempty); |
} else { |
} else { |
|
my $size; |
|
if ($item eq 'portal_def') { |
|
$size = ' size="25"'; |
|
} |
$datatable .= '<input type="text" name="'.$item.'" value="'. |
$datatable .= '<input type="text" name="'.$item.'" value="'. |
$domdefaults{$item}.'" />'; |
$domdefaults{$item}.'"'.$size.' />'; |
} |
} |
$datatable .= '</td></tr>'; |
$datatable .= '</td></tr>'; |
$rownum ++; |
$rownum ++; |
Line 2875 sub print_defaults {
|
Line 2879 sub print_defaults {
|
} |
} |
|
|
sub defaults_titles { |
sub defaults_titles { |
|
my ($dom) = @_; |
my %titles = &Apache::lonlocal::texthash ( |
my %titles = &Apache::lonlocal::texthash ( |
'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', |
'timezone_def' => 'Default timezone', |
'datelocale_def' => 'Default locale for dates', |
'datelocale_def' => 'Default locale for dates', |
|
'portal_def' => 'Portal/Default URL', |
); |
); |
|
if ($dom) { |
|
my $uprimary_id = &Apache::lonnet::domain($dom,'primary'); |
|
my $uint_dom = &Apache::lonnet::internet_dom($uprimary_id); |
|
my $protocol = $Apache::lonnet::protocol{$uprimary_id}; |
|
$protocol = 'http' if ($protocol ne 'https'); |
|
if ($uint_dom) { |
|
$titles{'portal_def'} .= ' '.&mt('(for example: [_1])',$protocol.'://loncapa.'. |
|
$uint_dom); |
|
} |
|
} |
return (\%titles); |
return (\%titles); |
} |
} |
|
|
Line 6017 sub modify_defaults {
|
Line 6033 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','timezone_def','datelocale_def'); |
my @items = ('auth_def','auth_arg_def','lang_def','timezone_def','datelocale_def','portal_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 6053 sub modify_defaults {
|
Line 6069 sub modify_defaults {
|
push(@errors,$item); |
push(@errors,$item); |
} |
} |
} |
} |
|
} elsif ($item eq 'portal_def') { |
|
if ($newvalues{$item} ne '') { |
|
unless ($newvalues{$item} =~ /^https?\:\/\/(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])\/?$/) { |
|
push(@errors,$item); |
|
} |
|
} |
} |
} |
if (grep(/^\Q$item\E$/,@errors)) { |
if (grep(/^\Q$item\E$/,@errors)) { |
$newvalues{$item} = $domdefaults{$item}; |
$newvalues{$item} = $domdefaults{$item}; |