From: dkl%redhat.com <> Date: Mon, 21 Jul 2008 08:21:38 +0000 (+0000) Subject: Bug 445885 – User.login should ThrowUserError when called with incorrect parameters X-Git-Tag: bugzilla-3.2rc1~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d64317fa6e1716b40fa2c787810775449c09d09;p=thirdparty%2Fbugzilla.git Bug 445885 – User.login should ThrowUserError when called with incorrect parameters Patch by David Lawrence - r/a=mkanat --- diff --git a/Bugzilla/WebService/User.pm b/Bugzilla/WebService/User.pm index d0ce706f04..cab2c5182b 100755 --- a/Bugzilla/WebService/User.pm +++ b/Bugzilla/WebService/User.pm @@ -43,7 +43,13 @@ use constant LOGIN_EXEMPT => { sub login { my ($self, $params) = @_; my $remember = $params->{remember}; - + + # Username and password params are required + foreach my $param ("login", "password") { + defined $params->{$param} + || ThrowCodeError('param_required', { param => $param }); + } + # Convert $remember from a boolean 0/1 value to a CGI-compatible one. if (defined($remember)) { $remember = $remember? 'on': ''; @@ -189,6 +195,10 @@ The username does not exist, or the password is wrong. The account has been disabled. A reason may be specified with the error. +=item 50 (Param Required) + +A login or password parameter was not provided. + =back =back