Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(36)  |  Call(27)  |  Derive(0)  |  Import(9)
Encrypt the provided plain text password using the encoding if provided
and return it in an LDAP-style representation.

        def pw_encrypt(pw, encoding='SSHA'):
    """Encrypt the provided plain text password using the encoding if provided
    and return it in an LDAP-style representation."""
    for id, prefix, scheme in _schemes:
        if encoding == id:
            return prefix + scheme.encrypt(pw)
    raise ValueError('Not supported: %s' % encoding)
        


src/a/c/AccessControl-3.0.8/src/AccessControl/userfolder.py   AccessControl(Download)
    def _encryptPassword(self, pw):
        return AuthEncoding.pw_encrypt(pw, 'SSHA')
 
    def domainSpecValidate(self, spec):
        for ob in spec:

src/p/r/Products.LDAPUserFolder-2.27/Products/LDAPUserFolder/utils.py   Products.LDAPUserFolder(Download)
 
    if encoding in ('SSHA', 'SHA', 'CRYPT'):
        pwd_str = AuthEncoding.pw_encrypt(password, encoding)
    elif encoding == 'MD5':
        m = md5_new(password)
        pwd_str = '{MD5}' + base64.encodestring(m.digest())
    elif encoding == 'CLEAR':
        pwd_str = password
    else:
        pwd_str = AuthEncoding.pw_encrypt(password, 'SSHA')

src/p/r/Products.PluggableAuthService-1.10.0/Products/PluggableAuthService/plugins/ZODBUserManager.py   Products.PluggableAuthService(Download)
        if AuthEncoding.is_encrypted( password ):
            return password
        return AuthEncoding.pw_encrypt( password )
 
    #

src/p/r/Products.remember-1.9.3/Products/remember/content/password_hashers.py   Products.remember(Download)
from zope.interface import implements
 
from AccessControl.AuthEncoding import pw_encrypt
from AccessControl.AuthEncoding import pw_validate
 
    def hashPassword(self, password):
        """
        Delegate to AccessControl.AuthEncoding.
        """
        return pw_encrypt(password)

src/p/r/Products.PlonePAS-5.0/Products/PlonePAS/plugins/user.py   Products.PlonePAS(Download)
 
        if not AuthEncoding.is_encrypted(password):
            password = AuthEncoding.pw_encrypt(password)
        self._user_passwords[user_id] = password
        self._login_to_userid[login_name] = user_id
        if self._user_passwords.get(principal_id) is None:
            raise RuntimeError("User does not exist: %s" % principal_id)
        self._user_passwords[principal_id] = AuthEncoding.pw_encrypt(password)
 
    # implement interfaces IDeleteCapability, IPasswordSetCapability

src/p/r/Products.PlonePAS-HEAD/Products/PlonePAS/plugins/user.py   Products.PlonePAS(Download)
 
        if not AuthEncoding.is_encrypted(password):
            password = AuthEncoding.pw_encrypt(password)
        self._user_passwords[user_id] = password
        self._login_to_userid[login_name] = user_id
        if self._user_passwords.get(principal_id) is None:
            raise RuntimeError("User does not exist: %s" % principal_id)
        self._user_passwords[principal_id] = AuthEncoding.pw_encrypt(password)
 
    # implement interfaces IDeleteCapability, IPasswordSetCapability

src/i/l/ilrt.contentmigrator-1.11/ilrt/contentmigrator/ContentMigrator/ContentExporter.py   ilrt.contentmigrator(Download)
                    password = u.getPassword()
                    if password and not AuthEncoding.is_encrypted(password):
                        password = AuthEncoding.pw_encrypt(password)
                if not password:
                    password = 'this user is going to need a password reset'

src/p/r/Products.LoginLockout-0.3.3/Products/LoginLockout/plugin.py   Products.LoginLockout(Download)
        log.info("user '%s' attempt #%i %s last: %s", login, count, IP, last)
        last = DateTime()
        reference = AuthEncoding.pw_encrypt(password)
        root._login_attempts[login] = (count, last, IP, reference)
 

src/e/r/erp5-HEAD/product/ERP5Wizard/PAS/ERP5RemoteUserManager.py   erp5(Download)
from zLOG import LOG, INFO, WARNING
import socket
from AccessControl.AuthEncoding import pw_validate, pw_encrypt
 
manage_addERP5RemoteUserManagerForm = PageTemplateFile(
            self.remote_authentication_cache = OOBTree()
        portal = self.getPortalObject()
        encrypted_password = pw_encrypt(password)
        callRemoteProxyMethod = portal.portal_wizard.callRemoteProxyMethod
        erp5_uid = portal.ERP5Site_getExpressInstanceUid()

src/e/r/erp5-HEAD/product/ERP5/mixin/encrypted_password.py   erp5(Download)
import zope.interface
from AccessControl import ClassSecurityInfo
from AccessControl.AuthEncoding import pw_encrypt, pw_validate
from Acquisition import aq_base
from Products.ERP5Type import Permissions, interfaces
  def _forceSetPassword(self, value):
    self.password = PersistentMapping()
    self._setEncodedPassword(pw_encrypt(value))
 
  def _setPassword(self, value):

  1 | 2  Next