def authenticateCredentials(self, credentials): """ Fulfill AuthenticationPlugin requirements """ acl = self._getUserFolder() login = credentials.get('login', '') password = credentials.get('password', '') if not acl or not login or not password: return (None, None) if ( login == emergency_user.getUserName() and AuthEncoding.pw_validate( emergency_user._getPassword(), password ) ): return (login, login) user = acl.getUser(login) if user is None: return (None, None) elif user and AuthEncoding.pw_validate(user._getPassword(), password): return (user.getId(), login) return (None, None)
def authenticateCredentials(self, credentials): """ Fulfill AuthenticationPlugin requirements """ acl = self._getUserFolder() login = credentials.get('login', '') password = credentials.get('password', '') if not acl or not login or not password: return (None, None) if login == emergency_user.getUserName() and \ AuthEncoding.pw_validate(emergency_user._getPassword(), password): return (login, login) user = acl.getUser(login) if user is None: return (None, None) elif user and AuthEncoding.pw_validate(user._getPassword(), password): return (user.getId(), login) return (None, None)