[LON-CAPA-cvs] cvs: loncom(version_2_4_X) /interface lonparmset.pm

albertel lon-capa-cvs-allow@mail.lon-capa.org
Wed, 20 Jun 2007 21:08:15 -0000


albertel		Wed Jun 20 17:08:15 2007 EDT

  Modified files:              (Branch: version_2_4_X)
    /loncom/interface	lonparmset.pm 
  Log:
  - backport 1.371
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.366 loncom/interface/lonparmset.pm:1.366.2.1
--- loncom/interface/lonparmset.pm:1.366	Wed Jun  6 16:19:38 2007
+++ loncom/interface/lonparmset.pm	Wed Jun 20 17:08:15 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.366 2007/06/06 20:19:38 albertel Exp $
+# $Id: lonparmset.pm,v 1.366.2.1 2007/06/20 21:08:15 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2047,17 +2047,24 @@
 	#
         # Deal with the emails
         if ($name =~ /\.email$/) {
-	    my ($user,$domain) = split(/:/,$value);
-	    if (!defined($user) || !defined($domain)) {
-		$setoutput.= '<br /> <span class="LC_error">'.
-		    &mt("Invalid email address specified, address must be of the form username:domain").
-		    '</span>';
-		undef($value);
-	    } elsif (&Apache::lonnet::homeserver($user,$domain) eq 'no_host') {
-		$setoutput.= '<br /> <span class="LC_error">'.
-		    &mt("Invalid email address specified, user [_1] is unknown.",$value).
-		    '</span>';
-		undef($value);
+	    foreach my $specifier (split(',',$value)) {
+		my ($user,$sections_or_groups)=
+		    ($specifier=~/^([^\(]+)\(([^\)]+)\)/);
+		if (!$sections_or_groups) {
+		    $user = $specifier;
+		}
+		my ($name,$domain) = split(':',$user);
+		if (!defined($user) || !defined($domain)) {
+		    $setoutput.= '<br /> <span class="LC_error">'.
+			&mt("Invalid email address specified, address must be of the form username:domain what was specified was ([_1])",$user).
+			'</span>';
+		    undef($value);
+		} elsif (&Apache::lonnet::homeserver($user,$domain) eq 'no_host') {
+		    $setoutput.= '<br /> <span class="LC_error">'.
+			&mt("Invalid email address specified, user [_1] is unknown.",$name).
+			'</span>';
+		    undef($value);
+		}
 	    }
         }
         # Get existing cloners