version 1.239, 2014/05/04 21:48:56
|
version 1.240, 2014/05/05 21:28:10
|
Line 4081 sub print_selfcreation {
|
Line 4081 sub print_selfcreation {
|
$$rowtotal ++; |
$$rowtotal ++; |
} |
} |
} |
} |
|
my @fields = ('lastname','firstname','middlename','permanentemail','id','inststatus'); |
|
my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles(); |
|
$fieldtitles{'inststatus'} = &mt('Institutional status'); |
|
my $rem; |
|
my $numperrow = 2; |
|
my $css_class = $$rowtotal%2?' class="LC_odd_row"':''; |
|
$datatable .= '<tr'.$css_class.'>'. |
|
'<td class="LC_left_item">'.&mt('Shibboleth (SSO) Data').'</td>'. |
|
'<td class="LC_left_item">'."\n". |
|
'<table><tr><td>'."\n"; |
|
for (my $i=0; $i<@fields; $i++) { |
|
$rem = $i%($numperrow); |
|
if ($rem == 0) { |
|
if ($i > 0) { |
|
$datatable .= '</tr>'; |
|
} |
|
$datatable .= '<tr>'; |
|
} |
|
my $currval; |
|
if (ref($createsettings->{'shibenv'}) eq 'HASH') { |
|
$currval = $createsettings->{'shibenv'}{$fields[$i]}; |
|
} |
|
$datatable .= '<td class="LC_left_item">'. |
|
'<span class="LC_nobreak">'. |
|
'<input type="text" name="shibenv_'.$fields[$i].'" '. |
|
'value="'.$currval.'" size="10" /> '. |
|
$fieldtitles{$fields[$i]}.'</span></td>'; |
|
} |
|
my $colsleft = $numperrow - $rem; |
|
if ($colsleft > 1 ) { |
|
$datatable .= '<td colspan="'.$colsleft.'" class="LC_left_item">'. |
|
' </td>'; |
|
} elsif ($colsleft == 1) { |
|
$datatable .= '<td class="LC_left_item"> </td>'; |
|
} |
|
$datatable .= '</tr></table></td></tr>'; |
|
$$rowtotal ++; |
} elsif ($position eq 'middle') { |
} elsif ($position eq 'middle') { |
my %domconf = &Apache::lonnet::get_dom('configuration',['usermodification'],$dom); |
my %domconf = &Apache::lonnet::get_dom('configuration',['usermodification'],$dom); |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($dom); |
Line 4091 sub print_selfcreation {
|
Line 4128 sub print_selfcreation {
|
foreach my $status (@{$types}) { |
foreach my $status (@{$types}) { |
$datatable .= &modifiable_userdata_row('selfcreate',$status,$domconf{'usermodification'}, |
$datatable .= &modifiable_userdata_row('selfcreate',$status,$domconf{'usermodification'}, |
$numinrow,$$rowtotal,$usertypes); |
$numinrow,$$rowtotal,$usertypes); |
$$rowtotal ++; |
$$rowtotal ++; |
} |
} |
} |
} |
} else { |
} else { |
Line 4137 sub print_selfcreation {
|
Line 4174 sub print_selfcreation {
|
$additional .= '</div>'."\n"; |
$additional .= '</div>'."\n"; |
|
|
($datatable,$itemcount) = &radiobutton_prefs(\%radiohash,\@toggles,\%defaultchecked, |
($datatable,$itemcount) = &radiobutton_prefs(\%radiohash,\@toggles,\%defaultchecked, |
\%choices,$itemcount,$onclick,$additional); |
\%choices,$$rowtotal,$onclick,$additional); |
$$rowtotal += $itemcount; |
$$rowtotal ++; |
$datatable .= &print_requestmail($dom,'selfcreation',$createsettings,$rowtotal); |
$datatable .= &print_requestmail($dom,'selfcreation',$createsettings,$rowtotal); |
$$rowtotal ++; |
$$rowtotal ++; |
my ($infofields,$infotitles) = &Apache::loncommon::emailusername_info(); |
my ($infofields,$infotitles) = &Apache::loncommon::emailusername_info(); |
Line 8336 sub modify_selfcreation {
|
Line 8373 sub modify_selfcreation {
|
if (($item eq 'selfcreate') || ($item eq 'statustocreate') || |
if (($item eq 'selfcreate') || ($item eq 'statustocreate') || |
($item eq 'captcha') || ($item eq 'recaptchakeys') || |
($item eq 'captcha') || ($item eq 'recaptchakeys') || |
($item eq 'emailusername') || ($item eq 'notify') || |
($item eq 'emailusername') || ($item eq 'notify') || |
($item eq 'selfcreateprocessing')) { |
($item eq 'selfcreateprocessing') || ($item eq 'shibenv')) { |
$curr_usercreation{$key}{$item} = $domconfig{'usercreation'}{$key}{$item}; |
$curr_usercreation{$key}{$item} = $domconfig{'usercreation'}{$key}{$item}; |
} else { |
} else { |
$save_usercreate{$key}{$item} = $domconfig{'usercreation'}{$key}{$item}; |
$save_usercreate{$key}{$item} = $domconfig{'usercreation'}{$key}{$item}; |
Line 8368 sub modify_selfcreation {
|
Line 8405 sub modify_selfcreation {
|
%{$cancreate{'emailusername'}} = (); |
%{$cancreate{'emailusername'}} = (); |
@{$cancreate{'statustocreate'}} = (); |
@{$cancreate{'statustocreate'}} = (); |
%{$cancreate{'selfcreateprocessing'}} = (); |
%{$cancreate{'selfcreateprocessing'}} = (); |
|
%{$cancreate{'shibenv'}} = (); |
my %selfcreatetypes = ( |
my %selfcreatetypes = ( |
sso => 'users authenticated by institutional single sign on', |
sso => 'users authenticated by institutional single sign on', |
login => 'users authenticated by institutional log-in', |
login => 'users authenticated by institutional log-in', |
Line 8485 sub modify_selfcreation {
|
Line 8523 sub modify_selfcreation {
|
} |
} |
my @fields = ('lastname','firstname','middlename','generation', |
my @fields = ('lastname','firstname','middlename','generation', |
'permanentemail','id'); |
'permanentemail','id'); |
|
my @shibfields = (@fields,'inststatus'); |
my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles(); |
my %fieldtitles = &Apache::loncommon::personal_data_fieldtitles(); |
# |
# |
# Where usernames may created for institutional log-in and/or institutional single sign on: |
# Where usernames may created for institutional log-in and/or institutional single sign on: |
Line 8529 sub modify_selfcreation {
|
Line 8568 sub modify_selfcreation {
|
} |
} |
} |
} |
} |
} |
|
foreach my $field (@shibfields) { |
|
if ($env{'form.shibenv_'.$field} ne '') { |
|
$cancreate{'shibenv'}{$field} = $env{'form.shibenv_'.$field}; |
|
} |
|
} |
|
if (ref($curr_usercreation{'cancreate'}) eq 'HASH') { |
|
if (ref($curr_usercreation{'cancreate'}{'shibenv'}) eq 'HASH') { |
|
foreach my $field (@shibfields) { |
|
if ($env{'form.shibenv_'.$field} ne $curr_usercreation{'cancreate'}{'shibenv'}{$field}) { |
|
push(@{$changes{'cancreate'}},'shibenv'); |
|
} |
|
} |
|
} else { |
|
foreach my $field (@shibfields) { |
|
if ($env{'form.shibenv_'.$field}) { |
|
push(@{$changes{'cancreate'}},'shibenv'); |
|
last; |
|
} |
|
} |
|
} |
|
} |
} |
} |
foreach my $item (@contexts) { |
foreach my $item (@contexts) { |
if (ref($curr_usercreation{'cancreate'}{$item}) eq 'ARRAY') { |
if (ref($curr_usercreation{'cancreate'}{$item}) eq 'ARRAY') { |
Line 8651 sub modify_selfcreation {
|
Line 8711 sub modify_selfcreation {
|
if (ref($cancreate{'statustocreate'}) eq 'ARRAY') { |
if (ref($cancreate{'statustocreate'}) eq 'ARRAY') { |
$save_usercreate{'cancreate'}{'statustocreate'} = $cancreate{'statustocreate'}; |
$save_usercreate{'cancreate'}{'statustocreate'} = $cancreate{'statustocreate'}; |
} |
} |
|
if (ref($cancreate{'shibenv'}) eq 'HASH') { |
|
$save_usercreate{'cancreate'}{'shibenv'} = $cancreate{'shibenv'}; |
|
} |
$save_usercreate{'cancreate'}{'emailusername'} = $cancreate{'emailusername'}; |
$save_usercreate{'cancreate'}{'emailusername'} = $cancreate{'emailusername'}; |
$save_usercreate{'emailrule'} = \@email_rule; |
$save_usercreate{'emailrule'} = \@email_rule; |
|
|
Line 8693 sub modify_selfcreation {
|
Line 8756 sub modify_selfcreation {
|
} |
} |
} |
} |
} |
} |
|
} elsif ($type eq 'shibenv') { |
|
if (keys(%{$cancreate{$type}}) == 0) { |
|
$chgtext .= &mt('Shibboleth-autheticated user does not use environment variables to set user information'); |
|
} else { |
|
$chgtext .= &mt('Shibboleth-autheticated user information set from environment variables, as follows:'). |
|
'<ul>'; |
|
foreach my $field (@shibfields) { |
|
next if ($cancreate{$type}{$field} eq ''); |
|
if ($field eq 'inststatus') { |
|
$chgtext .= '<li>'.&mt('Institutional status').' -- '.$cancreate{$type}{$field}.'</li>'; |
|
} else { |
|
$chgtext .= '<li>'.$fieldtitles{$field}.' -- '.$cancreate{$type}{$field}.'</li>'; |
|
} |
|
} |
|
$chgtext .= '</ul>'; |
|
} |
} elsif ($type eq 'statustocreate') { |
} elsif ($type eq 'statustocreate') { |
if ((ref($cancreate{'selfcreate'}) eq 'ARRAY') && |
if ((ref($cancreate{'selfcreate'}) eq 'ARRAY') && |
(ref($cancreate{'statustocreate'}) eq 'ARRAY')) { |
(ref($cancreate{'statustocreate'}) eq 'ARRAY')) { |