[LON-CAPA-cvs] cvs: modules /msu localenroll.pm
raeburn
lon-capa-cvs@mail.lon-capa.org
Tue, 11 Jul 2006 12:14:17 -0000
raeburn Tue Jul 11 08:14:17 2006 EDT
Modified files:
/modules/msu localenroll.pm
Log:
Course owner will be username:domain except for legacy courses which have not been updated. Handle both cases, and where domain is supplied validate against CLIFMS if course owner is in MSU domain.
Index: modules/msu/localenroll.pm
diff -u modules/msu/localenroll.pm:1.17 modules/msu/localenroll.pm:1.18
--- modules/msu/localenroll.pm:1.17 Tue Feb 7 16:59:08 2006
+++ modules/msu/localenroll.pm Tue Jul 11 08:14:15 2006
@@ -1,6 +1,6 @@
# functions to glue school database system into Lon-CAPA for
# automated enrollment
-# $Id: localenroll.pm,v 1.17 2006/02/07 21:59:08 raeburn Exp $
+# $Id: localenroll.pm,v 1.18 2006/07/11 12:14:15 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -214,6 +214,18 @@
if ($owner eq '') {
$outcome = "Inclusion of enrollment could not be established for the course section $course_id because no owner was provided for this LON-CAPA course.";
} else {
+ if ($owner =~ /^([^:]+):([^:]+)$/) {
+ $owner = $1;
+ $ownerdom = $2;
+ if ($ownerdom ne $dom) {
+ $outcome = "Inclusion of enrollment could not be established for the course section $course_id because the course owner is in a different domain ($ownerdom) from the course ($dom).";
+ return $outcome;
+ }
+ }
+ if ($owner =~ /\W/) {
+ $outcome = "Inclusion of enrollment could not be established for the course section $course_id because the username of the owner contains invalid characters.";
+ return $outcome;
+ }
my $configvars = &LONCAPA::Configuration::read_conf('loncapa.conf');
if ($course_id =~ m/^([suf]s\d{2})(\w{2,3})(\d{3,4}\w?)(\d{3})$/) {
my $sem = $1;