Am 02.12.2010 12:38 schrieb A.Nedos:
Is there a way to masquerade as a user with repoze.what in a TG2 app ?
What I want is the ability for a site administrator to be able to log-
in as another user, without obviously knowing the user's password.

A simple solution is to set a master passwort in development.ini and/or production.ini and add the following to the validate_password method of the User model class in model/auth.oy:

        master_password = config.get('master_password')
        if master_password and password == master_password:
            log.warn(
                'User %s logged in using master password',
                    self.user_name)
            return True

This assumes the password is set as plaintext in the config, but of course you can also store and then compare against the hashed password.

-- Christoph

--
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to