From: dkl%redhat.com <> Date: Mon, 21 Jul 2008 08:06:27 +0000 (+0000) Subject: Bug 445885 – User.login should ThrowUserError when called with incorrect parameters X-Git-Tag: bugzilla-3.3.1~264 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1929d7a070ce311b7c0534eb1752d410d5e7d20b;p=thirdparty%2Fbugzilla.git Bug 445885 – User.login should ThrowUserError when called with incorrect parameters Patch by David Lawrence - a/r=mkanat --- diff --git a/Bugzilla/WebService/User.pm b/Bugzilla/WebService/User.pm index 35e4daad4f..10537138c8 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': ''; @@ -287,6 +293,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