Loading ccserver/handlers.py +5 −8 Original line number Diff line number Diff line Loading @@ -234,19 +234,16 @@ class WelcomeHandler(CCHandler): try: role = self._server.conf.authentify(login, password) except CCConf.UnknownAccount: raise AuthenticationError('Authentication failure (Unknown login)') raise AuthenticationError('Unknown login') if role is None: logging.info('New authentication from %s: failure' % login) raise AuthenticationError('Authentication failure') raise AuthenticationError('Bad login/password') else: # If authentication is a success, try to register the client: try: self._server.register(login, role, connection) self._server.register(login, role, conn) except AlreadyRegistered: raise AuthenticationError('Authentication failure ' '(already connected)') connection.set_handler(WelcomeHandler.ROLES.get(role)(self._server)) logging.info('New authentication from %s: success' % login) raise AuthenticationError('Already connected') conn.set_handler(WelcomeHandler.ROLES.get(role)(self._server)) return role Loading
ccserver/handlers.py +5 −8 Original line number Diff line number Diff line Loading @@ -234,19 +234,16 @@ class WelcomeHandler(CCHandler): try: role = self._server.conf.authentify(login, password) except CCConf.UnknownAccount: raise AuthenticationError('Authentication failure (Unknown login)') raise AuthenticationError('Unknown login') if role is None: logging.info('New authentication from %s: failure' % login) raise AuthenticationError('Authentication failure') raise AuthenticationError('Bad login/password') else: # If authentication is a success, try to register the client: try: self._server.register(login, role, connection) self._server.register(login, role, conn) except AlreadyRegistered: raise AuthenticationError('Authentication failure ' '(already connected)') connection.set_handler(WelcomeHandler.ROLES.get(role)(self._server)) logging.info('New authentication from %s: success' % login) raise AuthenticationError('Already connected') conn.set_handler(WelcomeHandler.ROLES.get(role)(self._server)) return role