diff options
author | Stefan Hacker <dd0t@users.sourceforge.net> | 2011-02-22 21:15:56 +0300 |
---|---|---|
committer | Stefan Hacker <dd0t@users.sourceforge.net> | 2011-02-22 21:15:56 +0300 |
commit | 89080fb4d5a1da5cd0013e8697caafd74fffb1ce (patch) | |
tree | e27d0977f4b7e412e75512b0baf7d921d5156fe7 | |
parent | c1d7df9ae89fb045d8437d270362aef6d8411439 (diff) |
Restore python 2.4 compatibility of phpBB3auth and smfauth
-rwxr-xr-x | Authenticators/SMF/smfauth.py | 9 | ||||
-rwxr-xr-x | Authenticators/phpBB3/phpBB3auth.py | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/Authenticators/SMF/smfauth.py b/Authenticators/SMF/smfauth.py index 1caf958..a060e1a 100755 --- a/Authenticators/SMF/smfauth.py +++ b/Authenticators/SMF/smfauth.py @@ -458,13 +458,18 @@ def do_main_program(): self.app.connected = False debug('Server shutdown stopped a virtual server') - + + if cfg.user.reject_on_error: # Python 2.4 compat + authenticateFortifyResult = (-1, None, None) + else: + authenticateFortifyResult = (-2, None, None) + class smfauthenticator(Murmur.ServerUpdatingAuthenticator): texture_cache = {} def __init__(self): Murmur.ServerUpdatingAuthenticator.__init__(self) - @fortifyIceFu((-1 if cfg.user.reject_on_error else -2, None, None)) + @fortifyIceFu(authenticateFortifyResult) @checkSecret def authenticate(self, name, pw, certlist, certhash, strong, current = None): """ diff --git a/Authenticators/phpBB3/phpBB3auth.py b/Authenticators/phpBB3/phpBB3auth.py index fa1b9ef..92df4e1 100755 --- a/Authenticators/phpBB3/phpBB3auth.py +++ b/Authenticators/phpBB3/phpBB3auth.py @@ -432,13 +432,18 @@ def do_main_program(): self.app.connected = False debug('Server shutdown stopped a virtual server') - + + if cfg.user.reject_on_error: # Python 2.4 compat + authenticateFortifyResult = (-1, None, None) + else: + authenticateFortifyResult = (-2, None, None) + class phpBBauthenticator(Murmur.ServerUpdatingAuthenticator): texture_cache = {} def __init__(self): Murmur.ServerUpdatingAuthenticator.__init__(self) - @fortifyIceFu((-1 if cfg.user.reject_on_error else -2, None, None)) + @fortifyIceFu(authenticateFortifyResult) @checkSecret def authenticate(self, name, pw, certlist, certhash, strong, current = None): """ |