[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface selfenroll.pm
raeburn
raeburn at source.lon-capa.org
Sat Aug 6 21:40:55 EDT 2016
raeburn Sun Aug 7 01:40:55 2016 EDT
Modified files: (Branch: version_2_11_X)
/loncom/interface selfenroll.pm
Log:
- For 2.11
- Backport 1.33, 1.34
Index: loncom/interface/selfenroll.pm
diff -u loncom/interface/selfenroll.pm:1.27.2.4 loncom/interface/selfenroll.pm:1.27.2.5
--- loncom/interface/selfenroll.pm:1.27.2.4 Thu Aug 4 14:17:39 2016
+++ loncom/interface/selfenroll.pm Sun Aug 7 01:40:55 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Allow users to self-enroll in a course
#
-# $Id: selfenroll.pm,v 1.27.2.4 2016/08/04 14:17:39 raeburn Exp $
+# $Id: selfenroll.pm,v 1.27.2.5 2016/08/07 01:40:55 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -439,8 +439,9 @@
if ($selfenroll_section eq 'none') {
$usec = '';
}
+ my $instcid;
if ($selfenroll_registered) {
- my ($registered,$instsec,$message) = &check_registered($cdom,$cnum);
+ my ($registered,$instsec,$instcid,$message) = &check_registered($cdom,$cnum);
$usec = $instsec;
if (!$registered) {
$r->print('<h3>'.&mt('Self-enrollment unavailable').'</h3>'.
@@ -463,7 +464,7 @@
my $enrollresult =
&Apache::lonnet::modify_student_enrollment($udom,$uname,undef,undef,undef,
undef,undef,$usec,$selfenroll_access_end,$selfenroll_access_start,
- 'selfenroll',undef,$cdom.'_'.$cnum,$selfenroll);
+ 'selfenroll',undef,$cdom.'_'.$cnum,$selfenroll,'selfenroll','',$instcid);
if ($enrollresult eq 'ok') {
my (%userroles,%newrole,%newgroups);
my $role = 'st';
@@ -786,7 +787,7 @@
sub check_registered {
my ($cdom,$cnum) = @_;
- my ($registered,$instsec,$message);
+ my ($registered,$instsec,$instcid,$message);
my %settings = &Apache::lonnet::get('environment',['internal.coursecode',
'internal.sectionnums',
'internal.crosslistings'],$cdom,$cnum);
@@ -806,6 +807,7 @@
if (defined($enrolled{$env{'user.name'}})) {
$registered = 1;
$instsec = $LC_code{$class};
+ $instcid = $class;
last;
}
}
@@ -818,7 +820,7 @@
} else {
$message = &mt('As no institutional course sections are currently associated with this course, your registration status is undetermined.');
}
- return ($registered,$instsec,$message);
+ return ($registered,$instsec,$instcid,$message);
}
1;
More information about the LON-CAPA-cvs
mailing list