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 _cacheRoles(self, name, roles=[], expiration=0):
        """ Stick something into my internal cache """
        if not name or not roles:
            return

        if name != emergency_user.getUserName():
            name = name.lower()
            self._cache('users')[name] = roles
            self._cache('expiration')[name] = expiration
Esempio n. 3
0
    def _cacheRoles(self, name, roles=[], expiration=0):
        """ Stick something into my internal cache """
        if not name or not roles:
            return

        if name != emergency_user.getUserName():
            name = name.lower()
            self._cache('users')[name] = roles
            self._cache('expiration')[name] = expiration
Esempio n. 4
0
    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

        if login == emergency_user.getUserName():
            return ( login, login )

        user = acl.getUser(login)
        if user is None:
            return None
        elif user and user._getPassword() == password:
            return ( user.getId(), login )
            
        return None
Esempio n. 5
0
    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():
            return (login, login)

        user = acl.getUser(login)
        if user is None:
            return (None, None)
        elif user and user._getPassword() == password:
            return (user.getId(), login)

        return (None, None)