version 1.109, 2009/08/23 17:22:54
|
version 1.110, 2009/10/06 18:10:25
|
Line 220 sub handler {
|
Line 220 sub handler {
|
{col1 => 'Administrator Settings', |
{col1 => 'Administrator Settings', |
col2 => '',}], |
col2 => '',}], |
}, |
}, |
'login' => |
'login' => |
{ text => 'Log-in page options', |
{ text => 'Log-in page options', |
help => 'Domain_Configuration_Login_Page', |
help => 'Domain_Configuration_Login_Page', |
header => [{col1 => 'Item', |
header => [{col1 => 'Item', |
col2 => '',}], |
col2 => '',}], |
}, |
}, |
|
|
'defaults' => |
'defaults' => |
{ text => 'Default authentication/language/timezone', |
{ text => 'Default authentication/language/timezone', |
help => 'Domain_Configuration_LangTZAuth', |
help => 'Domain_Configuration_LangTZAuth', |
Line 319 sub handler {
|
Line 320 sub handler {
|
}], |
}], |
}, |
}, |
); |
); |
|
my %servers = &Apache::lonnet::get_servers($dom); |
|
if (keys(%servers) > 1) { |
|
$prefs{'login'} = { text => 'Log-in page options', |
|
help => 'Domain_Configuration_Login_Page', |
|
header => [{col1 => 'Log-in Service', |
|
col2 => 'Server Setting',}, |
|
{col1 => 'Log-in Page Items', |
|
col2 => ''}], |
|
}; |
|
} |
my @roles = ('student','coordinator','author','admin'); |
my @roles = ('student','coordinator','author','admin'); |
my @actions = &Apache::loncommon::get_env_multiple('form.actions'); |
my @actions = &Apache::loncommon::get_env_multiple('form.actions'); |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
Line 423 sub print_config_box {
|
Line 434 sub print_config_box {
|
&Apache::loncommon::help_open_topic($item->{'help'}).'</span></th>'."\n". |
&Apache::loncommon::help_open_topic($item->{'help'}).'</span></th>'."\n". |
'</tr>'; |
'</tr>'; |
$rowtotal ++; |
$rowtotal ++; |
if (($action eq 'autoupdate') || ($action eq 'rolecolors') || |
my $numheaders = 1; |
($action eq 'usercreation') || ($action eq 'usermodification') || |
if (ref($item->{'header'}) eq 'ARRAY') { |
($action eq 'coursecategories') || ($action eq 'requestcourses')) { |
$numheaders = scalar(@{$item->{'header'}}); |
|
} |
|
if ($numheaders > 1) { |
my $colspan = ''; |
my $colspan = ''; |
if (($action eq 'rolecolors') || ($action eq 'coursecategories')) { |
if (($action eq 'rolecolors') || ($action eq 'coursecategories')) { |
$colspan = ' colspan="2"'; |
$colspan = ' colspan="2"'; |
Line 447 sub print_config_box {
|
Line 460 sub print_config_box {
|
$output .= &print_usermodification('top',$dom,$settings,\$rowtotal); |
$output .= &print_usermodification('top',$dom,$settings,\$rowtotal); |
} elsif ($action eq 'coursecategories') { |
} elsif ($action eq 'coursecategories') { |
$output .= &print_coursecategories('top',$dom,$item,$settings,\$rowtotal); |
$output .= &print_coursecategories('top',$dom,$item,$settings,\$rowtotal); |
|
} elsif ($action eq 'login') { |
|
$output .= &print_login('top',$dom,$confname,$phase,$settings,\$rowtotal); |
|
$colspan = ' colspan="2"'; |
} elsif ($action eq 'requestcourses') { |
} elsif ($action eq 'requestcourses') { |
$output .= &print_quotas($dom,$settings,\$rowtotal,$action); |
$output .= &print_quotas($dom,$settings,\$rowtotal,$action); |
} else { |
} else { |
Line 496 sub print_config_box {
|
Line 512 sub print_config_box {
|
$rowtotal ++; |
$rowtotal ++; |
} elsif ($action eq 'coursecategories') { |
} elsif ($action eq 'coursecategories') { |
$output .= &print_coursecategories('bottom',$dom,$item,$settings,\$rowtotal); |
$output .= &print_coursecategories('bottom',$dom,$item,$settings,\$rowtotal); |
|
} elsif ($action eq 'login') { |
|
$output .= &print_login('bottom',$dom,$confname,$phase,$settings,\$rowtotal); |
} elsif ($action eq 'requestcourses') { |
} elsif ($action eq 'requestcourses') { |
$output .= &print_courserequestmail($dom,$settings,\$rowtotal); |
$output .= &print_courserequestmail($dom,$settings,\$rowtotal); |
} else { |
} else { |
Line 566 sub print_config_box {
|
Line 584 sub print_config_box {
|
$output .= '</tr>'; |
$output .= '</tr>'; |
$rowtotal ++; |
$rowtotal ++; |
if ($action eq 'login') { |
if ($action eq 'login') { |
$output .= &print_login($dom,$confname,$phase,$settings,\$rowtotal); |
$output .= &print_login('bottom',$dom,$confname,$phase,$settings, |
|
\$rowtotal); |
} elsif ($action eq 'quotas') { |
} elsif ($action eq 'quotas') { |
$output .= &print_quotas($dom,$settings,\$rowtotal,$action); |
$output .= &print_quotas($dom,$settings,\$rowtotal,$action); |
} elsif ($action eq 'autoenroll') { |
} elsif ($action eq 'autoenroll') { |
Line 592 sub print_config_box {
|
Line 611 sub print_config_box {
|
} |
} |
|
|
sub print_login { |
sub print_login { |
my ($dom,$confname,$phase,$settings,$rowtotal) = @_; |
my ($position,$dom,$confname,$phase,$settings,$rowtotal) = @_; |
|
my ($css_class,$datatable); |
my %choices = &login_choices(); |
my %choices = &login_choices(); |
|
my $itemcount = 1; |
|
|
|
if ($position eq 'top') { |
|
my %servers = &Apache::lonnet::get_servers($dom); |
|
my $choice = $choices{'disallowlogin'}; |
|
$css_class = ' class="LC_odd_row"'; |
|
$datatable .= '<tr'.$css_class.'><td>'.$choices{'disallowlogin'}.'</td>'. |
|
'<td align="right"><table><tr><th>'.$choices{'hostid'}.'</th>'. |
|
'<th>'.$choices{'serverurl'}.'</th></tr>'."\n"; |
|
my %disallowed; |
|
if (ref($settings) eq 'HASH') { |
|
if (ref($settings->{'loginvia'}) eq 'HASH') { |
|
%disallowed = %{$settings->{'loginvia'}}; |
|
} |
|
} |
|
foreach my $lonhost (sort(keys(%servers))) { |
|
my $direct = 'selected="selected"'; |
|
if ($disallowed{$lonhost} eq '') { |
|
$direct = ''; |
|
} |
|
$datatable .= '<tr><td>'.$lonhost.'</td>'. |
|
'<td><select name="'.$lonhost.'_serverurl">'. |
|
'<option value=""'.$direct.'>'.$choices{'directlogin'}. |
|
'</option>'; |
|
foreach my $hostid (keys(%servers)) { |
|
next if ($hostid eq $lonhost); |
|
my $selected = ''; |
|
if ($hostid eq $disallowed{$lonhost}) { |
|
$selected = 'selected="selected"'; |
|
} |
|
$datatable .= '<option value="'.$hostid.'"'.$selected.'>'. |
|
$servers{$hostid}.'</option>'; |
|
} |
|
$datatable .= '</select></td></tr>'; |
|
} |
|
$datatable .= '</table></td></tr>'; |
|
return $datatable; |
|
} |
|
|
my %defaultchecked = ( |
my %defaultchecked = ( |
'coursecatalog' => 'on', |
'coursecatalog' => 'on', |
'adminmail' => 'off', |
'adminmail' => 'off', |
Line 729 sub login_choices {
|
Line 788 sub login_choices {
|
my %choices = |
my %choices = |
&Apache::lonlocal::texthash ( |
&Apache::lonlocal::texthash ( |
coursecatalog => 'Display Course Catalog link?', |
coursecatalog => 'Display Course Catalog link?', |
adminmail => "Display Administrator's E-mail Address?", |
adminmail => "Display Administrator's E-mail Address?", |
newuser => "Link to create a user account", |
disallowlogin => "Login page requests redirected", |
img => "Header", |
hostid => "Server", |
logo => "Main Logo", |
serverurl => "Redirect to log-in via:", |
domlogo => "Domain Logo", |
directlogin => "No redirect", |
login => "Log-in Header", |
newuser => "Link to create a user account", |
textcol => "Text color", |
img => "Header", |
bgcol => "Box color", |
logo => "Main Logo", |
bgs => "Background colors", |
domlogo => "Domain Logo", |
links => "Link colors", |
login => "Log-in Header", |
font => "Font color", |
textcol => "Text color", |
pgbg => "Header", |
bgcol => "Box color", |
mainbg => "Page", |
bgs => "Background colors", |
sidebg => "Login box", |
links => "Link colors", |
link => "Link", |
font => "Font color", |
alink => "Active link", |
pgbg => "Header", |
vlink => "Visited link", |
mainbg => "Page", |
|
sidebg => "Login box", |
|
link => "Link", |
|
alink => "Active link", |
|
vlink => "Visited link", |
); |
); |
return %choices; |
return %choices; |
} |
} |
Line 3088 sub modify_login {
|
Line 3151 sub modify_login {
|
$colchgtext = &display_colorchgs($dom,\%colchanges,['login'], |
$colchgtext = &display_colorchgs($dom,\%colchanges,['login'], |
\%loginhash); |
\%loginhash); |
} |
} |
|
|
|
my %servers = &Apache::lonnet::get_servers($dom); |
|
if (keys(%servers) > 1) { |
|
foreach my $lonhost (keys(%servers)) { |
|
if ($env{'form.'.$lonhost.'_serverurl'} ne '') { |
|
if (defined($servers{$env{'form.'.$lonhost.'_serverurl'}})) { |
|
$loginhash{login}{loginvia}{$lonhost} = $env{'form.'.$lonhost.'_serverurl'}; |
|
} |
|
} |
|
} |
|
} |
|
|
my $putresult = &Apache::lonnet::put_dom('configuration',\%loginhash, |
my $putresult = &Apache::lonnet::put_dom('configuration',\%loginhash, |
$dom); |
$dom); |
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |