diff options
Diffstat (limited to 'Bugzilla/WebService')
-rwxr-xr-x | Bugzilla/WebService/Constants.pm | 11 | ||||
-rwxr-xr-x | Bugzilla/WebService/User.pm | 3 |
2 files changed, 11 insertions, 3 deletions
diff --git a/Bugzilla/WebService/Constants.pm b/Bugzilla/WebService/Constants.pm index d1f816c84..39d25298d 100755 --- a/Bugzilla/WebService/Constants.pm +++ b/Bugzilla/WebService/Constants.pm @@ -27,6 +27,8 @@ use base qw(Exporter); ERROR_AUTH_NODATA ERROR_UNIMPLEMENTED + + LOGIN_EXEMPT ); # This maps the error names in global/*-error.html.tmpl to numbers. @@ -98,4 +100,13 @@ use constant ERROR_AUTH_NODATA => 410; use constant ERROR_UNIMPLEMENTED => 910; use constant ERROR_GENERAL => 999; +# For some methods, we shouldn't call Bugzilla->login before we call them. +# This is a hash--package names pointing to an arrayref of method names. +use constant LOGIN_EXEMPT => { + # Callers may have to know the Bugzilla version before logging in, + # even on a requirelogin installation. + Bugzilla => ['version'], + User => ['offer_account_by_email', 'login'], +}; + 1; diff --git a/Bugzilla/WebService/User.pm b/Bugzilla/WebService/User.pm index 74e8f8e03..db02ff75a 100755 --- a/Bugzilla/WebService/User.pm +++ b/Bugzilla/WebService/User.pm @@ -60,10 +60,7 @@ sub login { sub logout { my $self = shift; - - Bugzilla->login(LOGIN_OPTIONAL); Bugzilla->logout; - return undef; } |