From: Mike G. v. a. <we...@ma...> - 2005-02-06 16:06:54
|
Log Message: ----------- Backporting fix for problem which caused multiple users to be passed in the params of forms. Tags: ---- rel-2-1-patches Modified Files: -------------- webwork2/lib/WeBWorK/ContentGenerator: Login.pm Revision Data ------------- Index: Login.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Login.pm,v retrieving revision 1.23 retrieving revision 1.23.4.1 diff -Llib/WeBWorK/ContentGenerator/Login.pm -Llib/WeBWorK/ContentGenerator/Login.pm -u -r1.23 -r1.23.4.1 --- lib/WeBWorK/ContentGenerator/Login.pm +++ lib/WeBWorK/ContentGenerator/Login.pm @@ -106,12 +106,16 @@ print CGI::startform({-method=>"POST", -action=>$r->uri}); - # write out the form data posted to the requested URI - #print $self->print_form_data('<input type="hidden" name="','" value="',"\"/>\n",qr/^(user|passwd|key|force_passwd_authen)$/); # preserve the form data posted to the requested URI my @fields_to_print = grep { not m/^(user|passwd|key|force_passwd_authen)$/ } $r->param; - print $self->hidden_fields(@fields_to_print); + + #FIXME: This next line can be removed in time. MEG 1/27/2005 + warn "Error in filtering fields : |", join("|",@fields_to_print),"|" if grep {m/user/} @fields_to_print; + + # Important note. If hidden_fields is passed an empty array it prints ALL parameters as hidden fields. + # That is not what we want in this case, so we don't print at all if @fields_to_print is empty. + print $self->hidden_fields(@fields_to_print) if @fields_to_print > 0; print CGI::table({class=>"FormLayout"}, CGI::Tr([ |