--- loncom/html/adm/helper/newslot.helper 2005/11/02 22:07:52 1.7
+++ loncom/html/adm/helper/newslot.helper 2005/11/18 16:26:57 1.9
@@ -32,7 +32,8 @@
if ($val=~/^\s*$/) { return 'Must specify a name'; }
- if ($val=~/\s$/) { return 'Must not contain spaces'; }
+ if ($val=~/\s/) { return 'Must not contain spaces'; }
+ if ($val=~/\W/) { return 'Must contain only letters, numbers and _'; }
return undef;
@@ -229,7 +230,9 @@
my ($uname,$udomain)=split(/:/,$user);
push(@names,"$uname\@$udomain");
}
- $slot{'proctor'}=join(',',@names);
+ # make sure the usenrmaes are unique
+ my %proctors = map { ($_,1) } @names;
+ $slot{'proctor'}=join(',',sort(keys(%proctors)));
}
my $cname = $env{'course.'.$env{'request.course.id'}.'.num'};
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};