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

All Samples(55)  |  Call(42)  |  Derive(0)  |  Import(13)
Validate the provided password string, which uses LDAP-style encoding
notation.  Reference is the correct password, attempt is clear text
password attempt.

        def pw_validate(reference, attempt):
    """Validate the provided password string, which uses LDAP-style encoding
    notation.  Reference is the correct password, attempt is clear text
    password attempt."""
    for id, prefix, scheme in _schemes:
        lp = len(prefix)
        if reference[:lp] == prefix:
            return scheme.validate(reference[lp:], attempt)
    # Assume cleartext.
    return constant_time_compare(reference, attempt)
        


src/p/r/Products.PluggableAuthService-1.10.0/Products/PluggableAuthService/plugins/ZODBUserManager.py   Products.PluggableAuthService(Download)
 
        if AuthEncoding.is_encrypted( reference ):
            if AuthEncoding.pw_validate( reference, password ):
                return userid, login
 

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(
               login, None)
            result = int(stored_encrypted_password is not None and pw_validate(
              stored_encrypted_password, password))
        except: # XXX: It would be better to do except Exception, but
                # to-be-bug compatible with WizardTool_authenticateCredentials
                    .get(login, None)
                if stored_encrypted_password is None or \
                   not pw_validate(stored_encrypted_password, password):
                    # not yet in cache or changed on server
                    self.remote_authentication_cache[login] = encrypted_password

src/p/r/Products.remember-1.9.3/Products/remember/content/password_hashers.py   Products.remember(Download)
 
from AccessControl.AuthEncoding import pw_encrypt
from AccessControl.AuthEncoding import pw_validate
 
from Products.remember.config import ANNOT_KEY
    def validate(self, reference, attempt):
        """
        Check to see if the reference is a hash of the attempt.
        """
        return pw_validate(reference, attempt)

src/e/r/erp5-HEAD/product/ERP5eGovSecurity/EGOVUserManager.py   erp5(Download)
from DateTime import DateTime
from zLOG import LOG, PROBLEM
from AccessControl.AuthEncoding import pw_validate
 
# This user is used to bypass all security checks.
                  valid_assignment_list.append(assignment)
 
                if pw_validate(user.getPassword(), password) and \
                       len(valid_assignment_list): #user.getCareerRole() == 'internal':
                  return login, login # use same for user_id and login
              finally:
                setSecurityManager(sm)
            else:
              if pw_validate(user.getPassword(), password):

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 checkPassword(self, value) :
    """
    """
    if value is not None :
      return pw_validate(self.getPassword(), value)

src/p/r/Products.PluggableAuthService-1.10.0/Products/PluggableAuthService/plugins/DelegatingMultiPlugin.py   Products.PluggableAuthService(Download)
 
        if login == emergency_user.getUserName() and \
                AuthEncoding.pw_validate(emergency_user._getPassword(), password):
            return ( login, login )
 
            return (None, None)
 
        elif user and AuthEncoding.pw_validate(user._getPassword(),
                                               password):
            return ( user.getId(), login )

src/e/r/erp5-HEAD/bt5/erp5_registry_ohada/DocumentTemplateItem/PsjPerson.py   erp5(Download)
 
from AccessControl import ClassSecurityInfo
from AccessControl.AuthEncoding import pw_encrypt, pw_validate
from Products.CMFCore.utils import getToolByName
from Products.ERP5Type import Permissions, PropertySheet
      """      
      if value is not None :
        return pw_validate(self.getPassword(), value)
      return False
 

src/c/o/collective.emaillogin-1.3/collective/emaillogin/__init__.py   collective.emaillogin(Download)
            return None
        if AuthEncoding.is_encrypted(reference):
            if AuthEncoding.pw_validate(reference, password):
                return userid, login
 

src/p/r/Products.LoginLockout-0.3.3/Products/LoginLockout/plugin.py   Products.LoginLockout(Download)
        count, last, IP, reference = root._login_attempts.get(login, (0, None, '', None))
 
        if reference and AuthEncoding.pw_validate(reference, password):
            return  # we don't count repeating same password in case its correct
#        elif last and (DateTime() - last)/24.0 > self._reset_period:

src/i/s/IssueTrackerProduct-0.14.2/IssueTrackerProduct/IssueTracker.py   IssueTrackerProduct(Download)
        user = userfolder.data[issueuser.getUserName()]
        if AuthEncoding.is_encrypted(user._getPassword()):
            if not AuthEncoding.pw_validate(user._getPassword(), old):
                SubmitError['old'] = "Incorrect"
        else:

  1 | 2 | 3  Next