aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/auth/tools.py
diff options
context:
space:
mode:
authorRodney Ewing <ewing.rj@gmail.com>2013-06-21 14:14:40 -0700
committerRodney Ewing <ewing.rj@gmail.com>2013-06-21 14:14:40 -0700
commite4deacd9c898b6a627d892ef09d3d6efeb88ac52 (patch)
tree9fe1b5343d250ae44b874e21f8bf019935cb388c /mediagoblin/auth/tools.py
parent54ef2c408bdae8a7b827ce648567ae94573a99e3 (diff)
downloadmediagoblin-e4deacd9c898b6a627d892ef09d3d6efeb88ac52.tar.lz
mediagoblin-e4deacd9c898b6a627d892ef09d3d6efeb88ac52.tar.xz
mediagoblin-e4deacd9c898b6a627d892ef09d3d6efeb88ac52.zip
changes after cwebb's review
Diffstat (limited to 'mediagoblin/auth/tools.py')
-rw-r--r--mediagoblin/auth/tools.py19
1 files changed, 2 insertions, 17 deletions
diff --git a/mediagoblin/auth/tools.py b/mediagoblin/auth/tools.py
index f69d35ad..71f824de 100644
--- a/mediagoblin/auth/tools.py
+++ b/mediagoblin/auth/tools.py
@@ -169,7 +169,7 @@ def check_login_simple(username, password):
user = auth.get_user(username=username)
if not user:
_log.info("User %r not found", username)
- auth.fake_login_attempt()
+ hook_handle("auth_fake_login_attempt")
return None
if not auth.check_password(password, user.pw_hash):
_log.warn("Wrong password for %r", username)
@@ -178,23 +178,8 @@ def check_login_simple(username, password):
return user
-class AuthError(Exception):
- def __init__(self):
- self.value = 'No Authentication Plugin is enabled and' \
- ' authentication_disabled = False in config!'
-
- def __str__(self):
- return repr(self.value)
-
-
def check_auth_enabled():
- authentication_disabled = mg_globals.app_config['authentication_disabled']
- auth_plugin = hook_handle('authentication')
-
- if authentication_disabled is False and not auth_plugin:
- raise AuthError
-
- if authentication_disabled:
+ if not hook_handle('authentication'):
_log.warning('No authentication is enabled')
return False
else: