Skip to content

Commit

Permalink
allow guest logins when something is broken
Browse files Browse the repository at this point in the history
the first getRegisteredUsers takes a few seconds
after that, things are snappy
  • Loading branch information
raylu committed Apr 17, 2015
1 parent 9343855 commit 2e052fb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mumble.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@

class Authenticator(Murmur.ServerAuthenticator):
def authenticate(self, name, pw, certificates, certhash, certstrong, current=None):
new_name = ''
try:
new_name = ''

if name == 'raylu-bot' and pw == 'bot':
return 999999999, new_name, ['grim sleepers']

Expand All @@ -39,6 +38,10 @@ def authenticate(self, name, pw, certificates, certhash, certstrong, current=Non
if config.sentry_dsn:
client = raven.Client(config.sentry_dsn)
client.captureException(extra={'name': name})
for user_id in server.getRegisteredUsers(name):
print('unregistering', user_id)
server.unregisterUser(user_id)
return -2, new_name, []
finally:
db.session.remove()

Expand Down

0 comments on commit 2e052fb

Please sign in to comment.