version 1.410, 2022/06/08 03:36:07
|
version 1.417, 2022/11/17 13:12:40
|
Line 359 sub handler {
|
Line 359 sub handler {
|
modify => \&modify_passwords, |
modify => \&modify_passwords, |
}, |
}, |
'quotas' => |
'quotas' => |
{ text => 'Blogs, personal web pages, webDAV/quotas, portfolios', |
{ text => 'Blogs, personal pages/timezones, webDAV/quotas, portfolio', |
help => 'Domain_Configuration_Quotas', |
help => 'Domain_Configuration_Quotas', |
header => [{col1 => 'User affiliation', |
header => [{col1 => 'User affiliation', |
col2 => 'Available tools', |
col2 => 'Available tools', |
Line 1628 sub print_login {
|
Line 1628 sub print_login {
|
'<table><tr><th>'.$choices{'hostid'}.'</th>'. |
'<table><tr><th>'.$choices{'hostid'}.'</th>'. |
'<th>'.$choices{'samllanding'}.'</th>'. |
'<th>'.$choices{'samllanding'}.'</th>'. |
'<th>'.$choices{'samloptions'}.'</th></tr>'."\n"; |
'<th>'.$choices{'samloptions'}.'</th></tr>'."\n"; |
my (%saml,%samltext,%samlimg,%samlalt,%samlurl,%samltitle,%samlnotsso,%styleon,%styleoff); |
my (%saml,%samltext,%samlimg,%samlalt,%samlurl,%samltitle,%samlwindow,%samlnotsso,%styleon,%styleoff); |
foreach my $lonhost (keys(%domservers)) { |
foreach my $lonhost (keys(%domservers)) { |
$samlurl{$lonhost} = '/adm/sso'; |
$samlurl{$lonhost} = '/adm/sso'; |
$styleon{$lonhost} = 'display:none'; |
$styleon{$lonhost} = 'display:none'; |
$styleoff{$lonhost} = ''; |
$styleoff{$lonhost} = ''; |
} |
} |
if (ref($settings->{'saml'}) eq 'HASH') { |
if ((ref($settings) eq 'HASH') && (ref($settings->{'saml'}) eq 'HASH')) { |
foreach my $lonhost (keys(%{$settings->{'saml'}})) { |
foreach my $lonhost (keys(%{$settings->{'saml'}})) { |
if (ref($settings->{'saml'}{$lonhost}) eq 'HASH') { |
if (ref($settings->{'saml'}{$lonhost}) eq 'HASH') { |
$saml{$lonhost} = 1; |
$saml{$lonhost} = 1; |
Line 1643 sub print_login {
|
Line 1643 sub print_login {
|
$samlalt{$lonhost} = $settings->{'saml'}{$lonhost}{'alt'}; |
$samlalt{$lonhost} = $settings->{'saml'}{$lonhost}{'alt'}; |
$samlurl{$lonhost} = $settings->{'saml'}{$lonhost}{'url'}; |
$samlurl{$lonhost} = $settings->{'saml'}{$lonhost}{'url'}; |
$samltitle{$lonhost} = $settings->{'saml'}{$lonhost}{'title'}; |
$samltitle{$lonhost} = $settings->{'saml'}{$lonhost}{'title'}; |
|
$samlwindow{$lonhost} = $settings->{'saml'}{$lonhost}{'window'}; |
$samlnotsso{$lonhost} = $settings->{'saml'}{$lonhost}{'notsso'}; |
$samlnotsso{$lonhost} = $settings->{'saml'}{$lonhost}{'notsso'}; |
$styleon{$lonhost} = ''; |
$styleon{$lonhost} = ''; |
$styleoff{$lonhost} = 'display:none'; |
$styleoff{$lonhost} = 'display:none'; |
Line 1660 sub print_login {
|
Line 1661 sub print_login {
|
$samlon = $samloff; |
$samlon = $samloff; |
$samloff = ' '; |
$samloff = ' '; |
} |
} |
|
my $samlwinon = ''; |
|
my $samlwinoff = ' checked="checked"'; |
|
if ($samlwindow{$lonhost}) { |
|
$samlwinon = $samlwinoff; |
|
$samlwinoff = ''; |
|
} |
my $css_class = $itemcount%2?' class="LC_odd_row"':''; |
my $css_class = $itemcount%2?' class="LC_odd_row"':''; |
$datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'.$domservers{$lonhost}.'</span></td>'. |
$datatable .= '<tr'.$css_class.'><td><span class="LC_nobreak">'.$domservers{$lonhost}.'</span></td>'. |
'<td><span class="LC_nobreak"><label><input type="radio" name="saml_'.$lonhost.'"'.$samloff. |
'<td><span class="LC_nobreak"><label><input type="radio" name="saml_'.$lonhost.'"'.$samloff. |
Line 1669 sub print_login {
|
Line 1676 sub print_login {
|
'onclick="toggleSamlOptions(this.form,'."'$lonhost'".');" value="1" />'. |
'onclick="toggleSamlOptions(this.form,'."'$lonhost'".');" value="1" />'. |
&mt('Yes').'</label></span></td>'. |
&mt('Yes').'</label></span></td>'. |
'<td id="samloptionson_'.$lonhost.'" style="'.$styleon{$lonhost}.'" width="100%">'. |
'<td id="samloptionson_'.$lonhost.'" style="'.$styleon{$lonhost}.'" width="100%">'. |
'<table><tr><th colspan="5" align="center">'.&mt('SSO').'</th><th align="center">'. |
'<table width="100%"><tr><th colspan="3" align="center">'.&mt('SSO').'</th></tr>'. |
'<span class="LC_nobreak">'.&mt('Non-SSO').'</span></th></tr>'. |
|
'<tr><th>'.&mt('Text').'</th><th>'.&mt('Image').'</th>'. |
'<tr><th>'.&mt('Text').'</th><th>'.&mt('Image').'</th>'. |
'<th>'.&mt('Alt Text').'</th><th>'.&mt('URL').'</th>'. |
'<th>'.&mt('Alt Text').'</th></tr>'. |
'<th>'.&mt('Tool Tip').'</th><th>'.&mt('Text').'</th></tr>'. |
'<tr'.$css_class.'><td><input type="text" name="saml_text_'.$lonhost.'" size="20" value="'. |
'<tr'.$css_class.'><td><input type="text" name="saml_text_'.$lonhost.'" size="8" value="'. |
|
$samltext{$lonhost}.'" /></td><td>'; |
$samltext{$lonhost}.'" /></td><td>'; |
if ($samlimg{$lonhost}) { |
if ($samlimg{$lonhost}) { |
$datatable .= '<img src="'.$samlimg{$lonhost}.'" /><br />'. |
$datatable .= '<img src="'.$samlimg{$lonhost}.'" /><br />'. |
Line 1691 sub print_login {
|
Line 1696 sub print_login {
|
$datatable .= '<input type="file" name="saml_img_'.$lonhost.'" />'; |
$datatable .= '<input type="file" name="saml_img_'.$lonhost.'" />'; |
} |
} |
$datatable .= '</td>'. |
$datatable .= '</td>'. |
'<td><input type="text" name="saml_alt_'.$lonhost.'" size="20" '. |
'<td><input type="text" name="saml_alt_'.$lonhost.'" size="25" '. |
'value="'.$samlalt{$lonhost}.'" /></td>'. |
'value="'.$samlalt{$lonhost}.'" /></td></tr></table><br />'. |
'<td><input type="text" name="saml_url_'.$lonhost.'" size="8" '. |
'<table width="100%"><tr><th colspan="3" align="center">'.&mt('SSO').'</th><th align="center">'. |
|
'<span class="LC_nobreak">'.&mt('Non-SSO').'</span></th></tr>'. |
|
'<tr><th>'.&mt('URL').'</th><th>'.&mt('Tool Tip').'</th>'. |
|
'<th>'.&mt('Pop-up if iframe').'</th><th>'.&mt('Text').'</th></tr>'. |
|
'<tr'.$css_class.'>'. |
|
'<td><input type="text" name="saml_url_'.$lonhost.'" size="30" '. |
'value="'.$samlurl{$lonhost}.'" /></td>'. |
'value="'.$samlurl{$lonhost}.'" /></td>'. |
'<td><textarea name="saml_title_'.$lonhost.'" rows="3" cols="15">'. |
'<td><textarea name="saml_title_'.$lonhost.'" rows="3" cols="20">'. |
$samltitle{$lonhost}.'</textarea></td>'. |
$samltitle{$lonhost}.'</textarea></td>'. |
'<td><input type="text" name="saml_notsso_'.$lonhost.'" size="8" '. |
'<td><label><input type="radio" name="saml_window_'.$lonhost.'" value=""'.$samlwinoff.'>'. |
|
&mt('No').'</label>'.(' 'x2).'<label><input type="radio" '. |
|
'name="saml_window_'.$lonhost.'" value="1"'.$samlwinon.'>'.&mt('Yes').'</label></td>'. |
|
'<td><input type="text" name="saml_notsso_'.$lonhost.'" size="12" '. |
'value="'.$samlnotsso{$lonhost}.'" /></td></tr>'. |
'value="'.$samlnotsso{$lonhost}.'" /></td></tr>'. |
'</table></td>'. |
'</table></td>'. |
'<td id="samloptionsoff_'.$lonhost.'" style="'.$styleoff{$lonhost}.'" width="100%"> </td></tr>'; |
'<td id="samloptionsoff_'.$lonhost.'" style="'.$styleoff{$lonhost}.'" width="100%"> </td></tr>'; |
Line 2370 sub print_quotas {
|
Line 2383 sub print_quotas {
|
@options = ('norequest','approval','automatic'); |
@options = ('norequest','approval','automatic'); |
%titles = &authorrequest_titles(); |
%titles = &authorrequest_titles(); |
} else { |
} else { |
@usertools = ('aboutme','blog','webdav','portfolio'); |
@usertools = ('aboutme','blog','webdav','portfolio','timezone'); |
%titles = &tool_titles(); |
%titles = &tool_titles(); |
} |
} |
if (ref($types) eq 'ARRAY') { |
if (ref($types) eq 'ARRAY') { |
Line 2474 sub print_quotas {
|
Line 2487 sub print_quotas {
|
} |
} |
} else { |
} else { |
my $checked = 'checked="checked" '; |
my $checked = 'checked="checked" '; |
|
if ($item eq 'timezone') { |
|
$checked = ''; |
|
} |
if (ref($settings) eq 'HASH') { |
if (ref($settings) eq 'HASH') { |
if (ref($settings->{$item}) eq 'HASH') { |
if (ref($settings->{$item}) eq 'HASH') { |
if ($settings->{$item}->{$type} == 0) { |
if (!$settings->{$item}->{$type}) { |
$checked = ''; |
$checked = ''; |
} elsif ($settings->{$item}->{$type} == 1) { |
} elsif ($settings->{$item}->{$type} == 1) { |
$checked = 'checked="checked" '; |
$checked = 'checked="checked" '; |
Line 6567 sub print_lti {
|
Line 6583 sub print_lti {
|
'<label><input type="radio" value="1" name="ltisec_changeprivkey_'.$hostid.'" onclick="javascript:togglePrivKey(this.form,'."'$hostid'".');" />'.&mt('Yes'). |
'<label><input type="radio" value="1" name="ltisec_changeprivkey_'.$hostid.'" onclick="javascript:togglePrivKey(this.form,'."'$hostid'".');" />'.&mt('Yes'). |
'</label> </span><div id="ltisec_divchgprivkey_'.$hostid.'" style="display:none" />'. |
'</label> </span><div id="ltisec_divchgprivkey_'.$hostid.'" style="display:none" />'. |
'<span class="LC_nobreak">'.&mt('New Key').':'. |
'<span class="LC_nobreak">'.&mt('New Key').':'. |
'<input type="password" size="20" name="ltisec_privkey_'.$hostid.'" value="" autocomplete="off" />'. |
'<input type="password" size="20" name="ltisec_privkey_'.$hostid.'" value="" autocomplete="new-password" />'. |
'<label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.ltisec_privkey_'.$hostid.'.type='."'text'".' } else { this.form.ltisec_privkey_'.$hostid.'.type='."'password'".' }" />'.&mt('Visible input').'</label>'. |
'<label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.ltisec_privkey_'.$hostid.'.type='."'text'".' } else { this.form.ltisec_privkey_'.$hostid.'.type='."'password'".' }" />'.&mt('Visible input').'</label>'. |
'</span></div>'; |
'</span></div>'; |
} else { |
} else { |
$extra .= '<span class="LC_nobreak">'.&mt('Encryption Key').':'. |
$extra .= '<span class="LC_nobreak">'.&mt('Encryption Key').':'. |
'<input type="password" size="20" name="ltisec_privkey_'.$hostid.'" value="" autocomplete="off" />'. |
'<input type="password" size="20" name="ltisec_privkey_'.$hostid.'" value="" autocomplete="new-password" />'. |
'<label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.ltisec_privkey_'.$hostid.'.type='."'text'".' } else { this.form.ltisec_privkey_'.$hostid.'.type='."'password'".' }" />'.&mt('Visible input').'</label>'; |
'<label><input type="checkbox" name="visible" onclick="if (this.checked) { this.form.ltisec_privkey_'.$hostid.'.type='."'text'".' } else { this.form.ltisec_privkey_'.$hostid.'.type='."'password'".' }" />'.&mt('Visible input').'</label>'; |
} |
} |
$extra .= '</fieldset>'; |
$extra .= '</fieldset>'; |
Line 7698 sub print_privacy {
|
Line 7714 sub print_privacy {
|
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($position,$dom,$settings,$rowtotal) = @_; |
my ($datatable,$css_class,$numinrow,@items,%names,$othertitle,$usertypes,$types); |
my ($datatable,$css_class,$numinrow,@items,%names,$othertitle,$usertypes,$types); |
my $itemcount = 0; |
my $itemcount = 0; |
unless ($position eq 'top') { |
if ($position eq 'top') { |
|
$numinrow = 2; |
|
} else { |
@items = ('domain','author','course','community'); |
@items = ('domain','author','course','community'); |
%names = &Apache::lonlocal::texthash ( |
%names = &Apache::lonlocal::texthash ( |
domain => 'Assigned domain role(s)', |
domain => 'Assigned domain role(s)', |
author => 'Assigned co-author role(s)', |
author => 'Assigned co-author role(s)', |
course => 'Assigned course role(s)', |
course => 'Assigned course role(s)', |
community => 'Assigned community role', |
community => 'Assigned community role(s)', |
); |
); |
$numinrow = 4; |
$numinrow = 4; |
($othertitle,$usertypes,$types) = |
($othertitle,$usertypes,$types) = |
Line 7723 sub print_privacy {
|
Line 7741 sub print_privacy {
|
auto => 'Unrestricted', |
auto => 'Unrestricted', |
instdom => 'Other domain shares institution/provider', |
instdom => 'Other domain shares institution/provider', |
extdom => 'Other domain has different institution/provider', |
extdom => 'Other domain has different institution/provider', |
|
notify => 'Receive notification of role requests requiring DC authorization', |
); |
); |
my %names = &Apache::lonlocal::texthash ( |
my %names = &Apache::lonlocal::texthash ( |
domain => 'Domain role', |
domain => 'Domain role', |
Line 7774 sub print_privacy {
|
Line 7793 sub print_privacy {
|
$datatable .= '</td></tr>'; |
$datatable .= '</td></tr>'; |
$itemcount ++; |
$itemcount ++; |
} |
} |
|
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
|
$datatable .= '<tr'.$css_class.'><td>'.$titles{'notify'}.'</td>'. |
|
'<td class="LC_left_item">'; |
|
if ((@instdoms > 1) || (keys(%by_location) > 0)) { |
|
my %curr; |
|
if (ref($settings) eq 'HASH') { |
|
if ($settings->{'notify'} ne '') { |
|
map {$curr{$_}=1;} split(/,/,$settings->{'notify'}); |
|
} |
|
} |
|
$css_class = $itemcount%2?' class="LC_odd_row"':''; |
|
my ($numdc,$table,$rows) = &active_dc_picker($dom,$numinrow,'checkbox', |
|
'privacy_notify',%curr); |
|
if ($numdc > 0) { |
|
$datatable .= $table; |
|
} else { |
|
$datatable .= &mt('There are no active Domain Coordinators'); |
|
} |
|
} else { |
|
$datatable .= &mt('Nothing to set here, as there are no other domains'); |
|
} |
|
$datatable .='</td></tr>'; |
} elsif ($position eq 'middle') { |
} elsif ($position eq 'middle') { |
if ((@instdoms > 1) || (keys(%by_location) > 0)) { |
if ((@instdoms > 1) || (keys(%by_location) > 0)) { |
if ((ref($types) eq 'ARRAY') && (ref($usertypes) eq 'HASH')) { |
if ((ref($types) eq 'ARRAY') && (ref($usertypes) eq 'HASH')) { |
Line 9688 sub tool_titles {
|
Line 9729 sub tool_titles {
|
blog => 'Blog', |
blog => 'Blog', |
webdav => 'WebDAV', |
webdav => 'WebDAV', |
portfolio => 'Portfolio', |
portfolio => 'Portfolio', |
|
timezone => 'Can set time zone', |
official => 'Official courses (with institutional codes)', |
official => 'Official courses (with institutional codes)', |
unofficial => 'Unofficial courses', |
unofficial => 'Unofficial courses', |
community => 'Communities', |
community => 'Communities', |
Line 10658 sub print_defaults {
|
Line 10700 sub print_defaults {
|
} elsif ($item eq 'lang_def') { |
} elsif ($item eq 'lang_def') { |
my $includeempty = 1; |
my $includeempty = 1; |
$datatable .= &Apache::loncommon::select_language($item,$defaults{$item},$includeempty); |
$datatable .= &Apache::loncommon::select_language($item,$defaults{$item},$includeempty); |
} else { |
} elsif ($item eq 'portal_def') { |
my $size; |
|
if ($item eq 'portal_def') { |
|
$size = ' size="25"'; |
|
} |
|
$datatable .= '<input type="text" name="'.$item.'" value="'. |
$datatable .= '<input type="text" name="'.$item.'" value="'. |
$defaults{$item}.'"'.$size.' />'; |
$defaults{$item}.'" size="25" onkeyup="portalExtras(this);" />'; |
|
my $portalsty = 'none'; |
|
if ($defaults{$item}) { |
|
$portalsty = 'block'; |
|
} |
|
foreach my $field ('email','web') { |
|
my $checkedoff = ' checked="checked"'; |
|
my $checkedon; |
|
if ($defaults{$item.'_'.$field}) { |
|
$checkedon = $checkedoff; |
|
$checkedoff = ''; |
|
} |
|
$datatable .= '<div id="'.$item.'_'.$field.'_div" style="display:'.$portalsty.'">'. |
|
'<span class="LC_nobreak">'.$titles->{$field}.' '. |
|
'<label><input type="radio" name="'.$item.'_'.$field.'" value="1"'.$checkedon.'/>'.&mt('Yes').'</label>'. |
|
(' 'x2). |
|
'<label><input type="radio" name="'.$item.'_'.$field.'" value="0"'.$checkedoff.'/>'.&mt('No').'</label>'. |
|
'</div>'; |
|
} |
|
} else { |
|
$datatable .= '<input type="text" name="'.$item.'" value="'.$defaults{$item}.'" />'; |
} |
} |
$datatable .= '</td></tr>'; |
$datatable .= '</td></tr>'; |
$rownum ++; |
$rownum ++; |
Line 10760 sub defaults_titles {
|
Line 10818 sub defaults_titles {
|
'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', |
'portal_def' => 'Portal/Default URL', |
|
'email' => 'Email links use portal URL', |
|
'web' => 'Public web links use portal URL', |
'intauth_cost' => 'Encryption cost for bcrypt (positive integer)', |
'intauth_cost' => 'Encryption cost for bcrypt (positive integer)', |
'intauth_check' => 'Check bcrypt cost if authenticated', |
'intauth_check' => 'Check bcrypt cost if authenticated', |
'intauth_switch' => 'Existing crypt-based switched to bcrypt on authentication', |
'intauth_switch' => 'Existing crypt-based switched to bcrypt on authentication', |
Line 11474 sub serverstatus_pages {
|
Line 11534 sub serverstatus_pages {
|
sub defaults_javascript { |
sub defaults_javascript { |
my ($settings) = @_; |
my ($settings) = @_; |
return unless (ref($settings) eq 'HASH'); |
return unless (ref($settings) eq 'HASH'); |
|
my $portal_js = <<"ENDPORTAL"; |
|
|
|
function portalExtras(caller) { |
|
var x = caller.value; |
|
var y = new Array('email','web'); |
|
for (var i=0; i<y.length; i++) { |
|
if (document.getElementById('portal_def_'+y[i]+'_div')) { |
|
var z = document.getElementById('portal_def_'+y[i]+'_div'); |
|
if (x.length > 0) { |
|
z.style.display = 'block'; |
|
} else { |
|
z.style.display = 'none'; |
|
} |
|
} |
|
} |
|
} |
|
ENDPORTAL |
if ((ref($settings->{'inststatusorder'}) eq 'ARRAY') && (ref($settings->{'inststatustypes'}) eq 'HASH')) { |
if ((ref($settings->{'inststatusorder'}) eq 'ARRAY') && (ref($settings->{'inststatustypes'}) eq 'HASH')) { |
my $maxnum = scalar(@{$settings->{'inststatusorder'}}); |
my $maxnum = scalar(@{$settings->{'inststatusorder'}}); |
if ($maxnum eq '') { |
if ($maxnum eq '') { |
Line 11527 $jstext
|
Line 11604 $jstext
|
return; |
return; |
} |
} |
|
|
|
$portal_js |
|
|
|
// ]]> |
|
</script> |
|
|
|
ENDSCRIPT |
|
} else { |
|
return <<"ENDSCRIPT"; |
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
$portal_js |
// ]]> |
// ]]> |
</script> |
</script> |
|
|
Line 12254 sub modify_login {
|
Line 12342 sub modify_login {
|
my ($r,$dom,$confname,$lastactref,%domconfig) = @_; |
my ($r,$dom,$confname,$lastactref,%domconfig) = @_; |
my ($resulttext,$errors,$colchgtext,%changes,%colchanges,%newfile,%newurl, |
my ($resulttext,$errors,$colchgtext,%changes,%colchanges,%newfile,%newurl, |
%curr_loginvia,%loginhash,@currlangs,@newlangs,$addedfile,%title,@offon, |
%curr_loginvia,%loginhash,@currlangs,@newlangs,$addedfile,%title,@offon, |
%currsaml,%saml,%samltext,%samlimg,%samlalt,%samlurl,%samltitle,%samlnotsso); |
%currsaml,%saml,%samltext,%samlimg,%samlalt,%samlurl,%samltitle,%samlwindow,%samlnotsso); |
%title = ( coursecatalog => 'Display course catalog', |
%title = ( coursecatalog => 'Display course catalog', |
adminmail => 'Display administrator E-mail address', |
adminmail => 'Display administrator E-mail address', |
helpdesk => 'Display "Contact Helpdesk" link', |
helpdesk => 'Display "Contact Helpdesk" link', |
Line 12278 sub modify_login {
|
Line 12366 sub modify_login {
|
$samlalt{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'alt'}; |
$samlalt{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'alt'}; |
$samlimg{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'img'}; |
$samlimg{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'img'}; |
$samltitle{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'title'}; |
$samltitle{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'title'}; |
|
$samlwindow{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'window'}; |
$samlnotsso{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'notsso'}; |
$samlnotsso{$lonhost} = $domconfig{login}{'saml'}{$lonhost}{'notsso'}; |
} |
} |
} |
} |
Line 12535 sub modify_login {
|
Line 12624 sub modify_login {
|
if ($env{'form.saml_img_'.$lonhost.'.filename'}) { |
if ($env{'form.saml_img_'.$lonhost.'.filename'}) { |
push(@newsamlimgs,$lonhost); |
push(@newsamlimgs,$lonhost); |
} |
} |
foreach my $item ('text','alt','url','title','notsso') { |
foreach my $item ('text','alt','url','title','window','notsso') { |
$env{'form.saml_'.$item.'_'.$lonhost} =~ s/^\s+|\s+$//g; |
$env{'form.saml_'.$item.'_'.$lonhost} =~ s/^\s+|\s+$//g; |
} |
} |
if ($saml{$lonhost}) { |
if ($saml{$lonhost}) { |
|
if ($env{'form.saml_window_'.$lonhost} ne '1') { |
|
$env{'form.saml_window_'.$lonhost} = ''; |
|
} |
if (grep(/^\Q$lonhost\E$/,@delsamlimg)) { |
if (grep(/^\Q$lonhost\E$/,@delsamlimg)) { |
#FIXME Need to obsolete published image |
#FIXME Need to obsolete published image |
delete($currsaml{$lonhost}{'img'}); |
delete($currsaml{$lonhost}{'img'}); |
Line 12556 sub modify_login {
|
Line 12648 sub modify_login {
|
if ($env{'form.saml_title_'.$lonhost} ne $samltitle{$lonhost}) { |
if ($env{'form.saml_title_'.$lonhost} ne $samltitle{$lonhost}) { |
$changes{'saml'}{$lonhost} = 1; |
$changes{'saml'}{$lonhost} = 1; |
} |
} |
|
if ($env{'form.saml_window_'.$lonhost} ne $samlwindow{$lonhost}) { |
|
$changes{'saml'}{$lonhost} = 1; |
|
} |
if ($env{'form.saml_notsso_'.$lonhost} ne $samlnotsso{$lonhost}) { |
if ($env{'form.saml_notsso_'.$lonhost} ne $samlnotsso{$lonhost}) { |
$changes{'saml'}{$lonhost} = 1; |
$changes{'saml'}{$lonhost} = 1; |
} |
} |
} else { |
} else { |
$changes{'saml'}{$lonhost} = 1; |
$changes{'saml'}{$lonhost} = 1; |
} |
} |
foreach my $item ('text','alt','url','title','notsso') { |
foreach my $item ('text','alt','url','title','window','notsso') { |
$currsaml{$lonhost}{$item} = $env{'form.saml_'.$item.'_'.$lonhost}; |
$currsaml{$lonhost}{$item} = $env{'form.saml_'.$item.'_'.$lonhost}; |
} |
} |
} else { |
} else { |
Line 12763 sub modify_login {
|
Line 12858 sub modify_login {
|
alt => 'Alt text for button image', |
alt => 'Alt text for button image', |
url => 'SSO URL', |
url => 'SSO URL', |
title => 'Tooltip for SSO link', |
title => 'Tooltip for SSO link', |
|
window => 'Pop-up window if iframe', |
notsso => 'Text for non-SSO log-in', |
notsso => 'Text for non-SSO log-in', |
); |
); |
foreach my $lonhost (sort(keys(%{$changes{$item}}))) { |
foreach my $lonhost (sort(keys(%{$changes{$item}}))) { |
if (ref($currsaml{$lonhost}) eq 'HASH') { |
if (ref($currsaml{$lonhost}) eq 'HASH') { |
$resulttext .= '<li>'.&mt("$title{$item} in use for [_1]","<b>$lonhost</b>"). |
$resulttext .= '<li>'.&mt("$title{$item} in use for [_1]","<b>$lonhost</b>"). |
'<ul>'; |
'<ul>'; |
foreach my $key ('text','img','alt','url','title','notsso') { |
foreach my $key ('text','img','alt','url','title','window','notsso') { |
if ($currsaml{$lonhost}{$key} eq '') { |
if ($currsaml{$lonhost}{$key} eq '') { |
$resulttext .= '<li>'.&mt("$notlt{$key} not in use").'</li>'; |
$resulttext .= '<li>'.&mt("$notlt{$key} not in use").'</li>'; |
} else { |
} else { |
my $value = "'$currsaml{$lonhost}{$key}'"; |
my $value = "'$currsaml{$lonhost}{$key}'"; |
if ($key eq 'img') { |
if ($key eq 'img') { |
$value = '<img src="'.$currsaml{$lonhost}{$key}.'" />'; |
$value = '<img src="'.$currsaml{$lonhost}{$key}.'" />'; |
|
} elsif ($key eq 'window') { |
|
$value = 'On'; |
} |
} |
$resulttext .= '<li>'.&mt("$notlt{$key} set to: [_1]", |
$resulttext .= '<li>'.&mt("$notlt{$key} set to: [_1]", |
$value).'</li>'; |
$value).'</li>'; |
Line 13940 sub modify_quotas {
|
Line 14038 sub modify_quotas {
|
@usertools = ('author'); |
@usertools = ('author'); |
%titles = &authorrequest_titles(); |
%titles = &authorrequest_titles(); |
} else { |
} else { |
@usertools = ('aboutme','blog','webdav','portfolio'); |
@usertools = ('aboutme','blog','webdav','portfolio','timezone'); |
%titles = &tool_titles(); |
%titles = &tool_titles(); |
} |
} |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1); |
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1); |
Line 17877 sub modify_privacy {
|
Line 17975 sub modify_privacy {
|
domain => 'Assigned domain role(s)', |
domain => 'Assigned domain role(s)', |
author => 'Assigned co-author role(s)', |
author => 'Assigned co-author role(s)', |
course => 'Assigned course role(s)', |
course => 'Assigned course role(s)', |
community => 'Assigned community role', |
community => 'Assigned community role(s)', |
); |
); |
my %roles = &Apache::lonlocal::texthash ( |
my %roles = &Apache::lonlocal::texthash ( |
domain => 'Domain role', |
domain => 'Domain role', |
Line 17896 sub modify_privacy {
|
Line 17994 sub modify_privacy {
|
user => 'User authorizes', |
user => 'User authorizes', |
domain => 'Domain Coordinator authorizes', |
domain => 'Domain Coordinator authorizes', |
auto => 'Unrestricted', |
auto => 'Unrestricted', |
|
notify => 'Receive notification of role requests requiring DC authorization', |
); |
); |
my %fieldnames = &Apache::lonlocal::texthash ( |
my %fieldnames = &Apache::lonlocal::texthash ( |
id => 'Student/Employee ID', |
id => 'Student/Employee ID', |
Line 17921 sub modify_privacy {
|
Line 18020 sub modify_privacy {
|
); |
); |
foreach my $item (@items) { |
foreach my $item (@items) { |
if (@instdoms > 1) { |
if (@instdoms > 1) { |
if ($env{'form.privacy_approval_instdom'.$item} =~ /^(none|user|domain|auto)$/) { |
if ($env{'form.privacy_approval_instdom_'.$item} =~ /^(none|user|domain|auto)$/) { |
$privacyhash{'approval'}{'instdom'}{$item} = $env{'form.privacy_approval_instdom_'.$item}; |
$privacyhash{'approval'}{'instdom'}{$item} = $env{'form.privacy_approval_instdom_'.$item}; |
} |
} |
if (ref($current{'approval'}) eq 'HASH') { |
if (ref($current{'approval'}) eq 'HASH') { |
Line 18013 sub modify_privacy {
|
Line 18112 sub modify_privacy {
|
} |
} |
} |
} |
} |
} |
|
my %domcoords = &Apache::lonnet::get_active_domroles($dom,['dc']); |
|
my %notify; |
|
foreach my $possdc (&Apache::loncommon::get_env_multiple('form.privacy_notify')) { |
|
if (exists($domcoords{$possdc})) { |
|
$notify{$possdc} = 1; |
|
} |
|
} |
|
my $notify = join(',',sort(keys(%notify))); |
|
if ($current{'notify'} ne $notify) { |
|
$changes{'notify'} = 1; |
|
} |
|
$privacyhash{'notify'} = $notify; |
} |
} |
my %confighash = ( |
my %confighash = ( |
privacy => \%privacyhash, |
privacy => \%privacyhash, |
Line 18021 sub modify_privacy {
|
Line 18132 sub modify_privacy {
|
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
if (keys(%changes) > 0) { |
if (keys(%changes) > 0) { |
$resulttext = &mt('Changes made: ').'<ul>'; |
$resulttext = &mt('Changes made: ').'<ul>'; |
foreach my $key ('approval','othdom','priv','unpriv') { |
foreach my $key ('approval','notify','othdom','priv','unpriv') { |
if ($changes{$key}) { |
if ($changes{$key}) { |
$resulttext .= '<li>'.$titles{$key}.':<ul>'; |
$resulttext .= '<li>'.$titles{$key}.':<ul>'; |
if ($key eq 'approval') { |
if ($key eq 'approval') { |
Line 18039 sub modify_privacy {
|
Line 18150 sub modify_privacy {
|
} |
} |
$resulttext .= '</ul></li>'; |
$resulttext .= '</ul></li>'; |
} |
} |
|
} elsif ($key eq 'notify') { |
|
if ($privacyhash{$key}) { |
|
foreach my $dc (split(/,/,$privacyhash{$key})) { |
|
my ($dcname,$dcdom) = split(/:/,$dc); |
|
$resulttext .= '<li>'.&Apache::loncommon::plainname($dcname,$dcdom).'</li>'; |
|
} |
|
} else { |
|
$resulttext .= '<li>'.&mt('No DCs to notify').'</li>'; |
|
} |
} elsif ($key eq 'othdom') { |
} elsif ($key eq 'othdom') { |
my @statuses; |
my @statuses; |
if (ref($types) eq 'ARRAY') { |
if (ref($types) eq 'ARRAY') { |
Line 19966 sub modify_defaults {
|
Line 20086 sub modify_defaults {
|
} |
} |
} elsif ($item eq 'portal_def') { |
} elsif ($item eq 'portal_def') { |
if ($newvalues{$item} ne '') { |
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])\/?$/) { |
if ($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])\/?$/) { |
|
foreach my $field ('email','web') { |
|
if ($env{'form.'.$item.'_'.$field}) { |
|
$newvalues{$item.'_'.$field} = $env{'form.'.$item.'_'.$field}; |
|
} |
|
} |
|
} else { |
push(@errors,$item); |
push(@errors,$item); |
} |
} |
} |
} |
} |
} |
if (grep(/^\Q$item\E$/,@errors)) { |
if (grep(/^\Q$item\E$/,@errors)) { |
$newvalues{$item} = $domdefaults{$item}; |
$newvalues{$item} = $domdefaults{$item}; |
|
if ($item eq 'portal_def') { |
|
if ($domdefaults{$item}) { |
|
foreach my $field ('email','web') { |
|
if (exists($domdefaults{$item.'_'.$field})) { |
|
$newvalues{$item.'_'.$field} = $domdefaults{$item.'_'.$field}; |
|
} |
|
} |
|
} |
|
} |
} elsif ($domdefaults{$item} ne $newvalues{$item}) { |
} elsif ($domdefaults{$item} ne $newvalues{$item}) { |
$changes{$item} = 1; |
$changes{$item} = 1; |
} |
} |
|
if ($item eq 'portal_def') { |
|
unless (grep(/^\Q$item\E$/,@errors)) { |
|
if ($newvalues{$item} eq '') { |
|
foreach my $field ('email','web') { |
|
if (exists($domdefaults{$item.'_'.$field})) { |
|
delete($domdefaults{$item.'_'.$field}); |
|
} |
|
} |
|
} else { |
|
unless ($changes{$item}) { |
|
foreach my $field ('email','web') { |
|
if ($domdefaults{$item.'_'.$field} ne $newvalues{$item.'_'.$field}) { |
|
$changes{$item} = 1; |
|
last; |
|
} |
|
} |
|
} |
|
foreach my $field ('email','web') { |
|
if ($newvalues{$item.'_'.$field}) { |
|
$domdefaults{$item.'_'.$field} = $newvalues{$item.'_'.$field}; |
|
} elsif (exists($domdefaults{$item.'_'.$field})) { |
|
delete($domdefaults{$item.'_'.$field}); |
|
} |
|
} |
|
} |
|
} |
|
} |
$domdefaults{$item} = $newvalues{$item}; |
$domdefaults{$item} = $newvalues{$item}; |
} |
} |
my %staticdefaults = ( |
my %staticdefaults = ( |
Line 20175 sub modify_defaults {
|
Line 20337 sub modify_defaults {
|
$value = $authnames{$shortauth{$value}}; |
$value = $authnames{$shortauth{$value}}; |
} |
} |
$resulttext .= '<li>'.&mt('[_1] set to "[_2]"',$title->{$item},$value).'</li>'; |
$resulttext .= '<li>'.&mt('[_1] set to "[_2]"',$title->{$item},$value).'</li>'; |
$mailmsgtext .= "$title->{$item} set to $value\n"; |
$mailmsgtext .= "$title->{$item} set to $value\n"; |
|
if ($item eq 'portal_def') { |
|
if ($env{'form.'.$item} ne '') { |
|
foreach my $field ('email','web') { |
|
$value = $env{'form.'.$item.'_'.$field}; |
|
if ($value) { |
|
$value = &mt('Yes'); |
|
} else { |
|
$value = &mt('No'); |
|
} |
|
$resulttext .= '<li>'.&mt('[_1] set to "[_2]"',$title->{$field},$value).'</li>'; |
|
} |
|
} |
|
} |
} |
} |
} |
} |
$resulttext .= '</ul>'; |
$resulttext .= '</ul>'; |