From: Gavin L. v. a. <we...@ma...> - 2010-05-31 16:12:05
|
Log Message: ----------- Relax error checking on user_id. This allows user_id values to look like set-level proctor ids (that is, to prepend set_id: and append ,g), which isn't what we want for the user_id check in most cases, but shouldn't be a significant difficulty. The ideal is to know something about the set for which we're checking the id, but that requires sending more information into DB than we're sending now. Modified Files: -------------- webwork2/lib/WeBWorK: DB.pm Revision Data ------------- Index: DB.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/DB.pm,v retrieving revision 1.111 retrieving revision 1.112 diff -Llib/WeBWorK/DB.pm -Llib/WeBWorK/DB.pm -u -r1.111 -r1.112 --- lib/WeBWorK/DB.pm +++ lib/WeBWorK/DB.pm @@ -1784,10 +1784,6 @@ sub countProblemVersions { return scalar shift->listProblemVersions(@_) } # versioned analog of listUserProblems -# for consistency, we should name this "listProblemVersions", but that is -# confusing, as that sounds as if we're listing the versions of a problem. -# however, that's nonsensical, so we appropriate it here and don't worry -# about the confusion. sub listProblemVersions { my ($self, $userID, $setID, $versionID) = shift->checkArgs(\@_, qw/user_id set_id version_id/); my $where = [user_id_eq_set_id_eq_version_id_eq => $userID,$setID,$versionID]; @@ -1945,7 +1941,8 @@ } elsif ($versioned and $keyfield eq "set_id") { croak "invalid characters in '$keyfield' field: '$value' (valid characters are [-a-zA-Z0-9_.,])" unless $value =~ m/^[-a-zA-Z0-9_.,]*$/; - } elsif ($versioned and $keyfield eq "user_id") { + # } elsif ($versioned and $keyfield eq "user_id") { + } elsif ($keyfield eq "user_id") { check_user_id($value); # (valid characters are [-a-zA-Z0-9_.,]) see above. } elsif ($keyfield eq "ip_mask") { croak "invalid characters in '$keyfield' field: '$value' (valid characters are [-a-fA-F0-9_.:/])" |