version 1.184.4.10, 2021/08/24 00:22:59
|
version 1.184.4.12, 2024/07/04 16:29:50
|
Line 103 sub modifystudent {
|
Line 103 sub modifystudent {
|
sub modifyuserrole { |
sub modifyuserrole { |
my ($context,$setting,$changeauth,$cid,$udom,$uname,$uid,$umode,$upass, |
my ($context,$setting,$changeauth,$cid,$udom,$uname,$uid,$umode,$upass, |
$first,$middle,$last,$gene,$sec,$forceid,$desiredhome,$email,$role, |
$first,$middle,$last,$gene,$sec,$forceid,$desiredhome,$email,$role, |
$end,$start,$checkid,$inststatus) = @_; |
$end,$start,$checkid,$inststatus,$emptyok) = @_; |
my ($scope,$userresult,$authresult,$roleresult,$idresult); |
my ($scope,$userresult,$authresult,$roleresult,$idresult); |
if ($setting eq 'course' || $context eq 'course') { |
if ($setting eq 'course' || $context eq 'course') { |
$scope = '/'.$cid; |
$scope = '/'.$cid; |
Line 134 sub modifyuserrole {
|
Line 134 sub modifyuserrole {
|
generation => $gene, |
generation => $gene, |
id => $uid, |
id => $uid, |
); |
); |
|
|
|
# When "Update ID in user's course(s)" and "Force change of existing ID" |
|
# checkboxes both checked, prevent replacement of name information |
|
# in classlist.db file(s) for the user's course(s) with blank(s), |
|
# in the case where the uploaded csv file was without column(s) for |
|
# the particular field. Fields are: First Name, Middle Names/Initials, |
|
# Last Name (or the composite: Last Name, First Names), and Generation. |
|
|
|
my %emptyallowed; |
|
if ((ref($emptyok) eq 'HASH') && (keys(%{$emptyok}) > 0)) { |
|
%emptyallowed = %{$emptyok}; |
|
} |
|
foreach my $field (keys(%userupdate)) { |
|
if ($userupdate{$field} eq '') { |
|
unless ($emptyallowed{$field}) { |
|
delete($userupdate{$field}); |
|
} |
|
} |
|
} |
$idresult = &propagate_id_change($uname,$udom,\%userupdate); |
$idresult = &propagate_id_change($uname,$udom,\%userupdate); |
} |
} |
} |
} |
Line 510 END
|
Line 529 END
|
"; |
"; |
} elsif ($mode eq 'modifycourse') { |
} elsif ($mode eq 'modifycourse') { |
$auth_checks .= " |
$auth_checks .= " |
if (vf.elements[current.argfield].value == null || vf.elements[current.argfield].value == '') { |
if ((current.argfield !== null) && (current.argfield !== undefined) && (current.argfield !== '') && (vf.elements[current.argfield].value == null || vf.elements[current.argfield].value == '')) { |
"; |
"; |
} |
} |
if ( ($mode eq 'createcourse') || ($mode eq 'modifycourse') ) { |
if ( ($mode eq 'createcourse') || ($mode eq 'modifycourse') ) { |
Line 4290 sub upfile_drop_add {
|
Line 4309 sub upfile_drop_add {
|
$fieldstype{$field.'_choice'} = 'scalar'; |
$fieldstype{$field.'_choice'} = 'scalar'; |
} |
} |
&Apache::loncommon::store_course_settings('enrollment_upload',\%fieldstype); |
&Apache::loncommon::store_course_settings('enrollment_upload',\%fieldstype); |
my ($cid,$crstype,$setting); |
my ($cid,$crstype,$setting,%emptyok); |
if ($context eq 'domain') { |
if ($context eq 'domain') { |
$setting = $env{'form.roleaction'}; |
$setting = $env{'form.roleaction'}; |
|
if (exists($fields{'names'})) { |
|
map { $emptyok{$_} = 1; } ('lastname','firstname','middlename'); |
|
} else { |
|
if (exists($fields{'lname'})) { |
|
$emptyok{'lastname'} = 1; |
|
} |
|
if (exists($fields{'fname'})) { |
|
$emptyok{'firstname'} = 1; |
|
} |
|
if (exists($fields{'mname'})) { |
|
$emptyok{'middlename'} = 1; |
|
} |
|
} |
|
if (exists($fields{'gen'})) { |
|
$emptyok{'generation'} = 1; |
|
} |
} |
} |
if ($env{'request.course.id'} ne '') { |
if ($env{'request.course.id'} ne '') { |
$cid = $env{'request.course.id'}; |
$cid = $env{'request.course.id'}; |
Line 4997 sub upfile_drop_add {
|
Line 5032 sub upfile_drop_add {
|
$mname,$lname,$gen,$singlesec, |
$mname,$lname,$gen,$singlesec, |
$env{'form.forceid'},$desiredhost, |
$env{'form.forceid'},$desiredhost, |
$email,$role,$enddate,$startdate, |
$email,$role,$enddate,$startdate, |
$checkid,$inststatus); |
$checkid,$inststatus,\%emptyok); |
} |
} |
} |
} |
if ($multiple) { |
if ($multiple) { |
Line 6197 sub get_permission {
|
Line 6232 sub get_permission {
|
$permission{'selfenrolladmin'} = 1; |
$permission{'selfenrolladmin'} = 1; |
} |
} |
} |
} |
|
unless ($permission{'selfenrolladmin'}) { |
|
$permission{'selfenrollview'} = 1; |
|
} |
} |
} |
if ($env{'request.course.id'}) { |
if ($env{'request.course.id'}) { |
my $user; |
my $user; |
Line 6659 sub selfenrollment_administration {
|
Line 6697 sub selfenrollment_administration {
|
} |
} |
} |
} |
if ($settings{'internal.selfenrollmgrdc'} ne '') { |
if ($settings{'internal.selfenrollmgrdc'} ne '') { |
my @in_domain = split(/,/,$settings{'internal.selfenrollmgrdc'}); |
@in_domain = split(/,/,$settings{'internal.selfenrollmgrdc'}); |
my @diffs = &Apache::loncommon::compare_arrays(\@in_domain,$possconfigs); |
my @diffs = &Apache::loncommon::compare_arrays(\@in_domain,$possconfigs); |
unless (@diffs) { |
unless (@diffs) { |
return (\@in_course,\@in_domain); |
return (\@in_course,\@in_domain); |