Changeset 792


Ignore:
Timestamp:
16.11.2009 15:43:14 (2 years ago)
Author:
cmeier
Message:

zms-2.12.0-01

Location:
ZMS/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • ZMS/trunk/ZMSGlobals.py

    r752 r792  
    3434import base64 
    3535import copy 
    36 import md5 
    3736import operator 
    3837import os 
     
    5251__all__= ['ZMSGlobals'] 
    5352 
    54  
    5553# ------------------------------------------------------------------------------ 
    5654#  MD5: 
    5755# ------------------------------------------------------------------------------ 
    58 class MD5DigestScheme: 
     56try: # Python >= 2.5 
     57  import hashlib 
     58 
     59  class MD5DigestScheme: 
    5960 
    6061    def encrypt(self, pw): 
    61         enc = md5.new(pw) 
    62         enc = enc.hexdigest() 
    63         return enc 
     62      enc = hashlib.md5(pw) 
     63      enc = enc.hexdigest() 
     64      return enc 
    6465 
    6566    def validate(self, reference, attempt): 
    66         compare = self.encrypt(attempt)[:-1] 
    67         return (compare == reference) 
     67      compare = self.encrypt(attempt)[:-1] 
     68      return (compare == reference) 
     69 
     70except: # Python < 2.5 
     71  import md5 
     72 
     73  class MD5DigestScheme: 
     74 
     75    def encrypt(self, pw): 
     76      enc = md5.new(pw) 
     77      enc = enc.hexdigest() 
     78      return enc 
     79 
     80    def validate(self, reference, attempt): 
     81      compare = self.encrypt(attempt)[:-1] 
     82      return (compare == reference) 
    6883 
    6984AuthEncoding.registerScheme('MD5', MD5DigestScheme()) 
  • ZMS/trunk/_confmanager.py

    r752 r792  
    214214        conf = open( filepaths[1]+'configure.zcml','r') 
    215215      conf_xml = self.xmlParse( conf) 
    216       print "conf_xml=",conf_xml 
    217216      for source in self.xmlNodeSet(conf_xml,'source'): 
    218217        location = source['attrs']['location'] 
    219         print "location=",location 
    220218        if location.startswith('http://'): 
    221219          try: 
     
    230228        else: 
    231229          for filepath in filepaths: 
    232             for filename in os.listdir(filepath+location): 
    233               path = filepath + filename 
    234               mode = os.stat(path)[stat.ST_MODE] 
    235               if not stat.S_ISDIR(mode): 
    236                 if filename not in filenames: 
    237                   filenames[path] = filename 
     230            if os.path.exists( filepath): 
     231              for filename in os.listdir(filepath+location): 
     232                path = filepath + filename 
     233                mode = os.stat(path)[stat.ST_MODE] 
     234                if not stat.S_ISDIR(mode): 
     235                  if filename not in filenames: 
     236                    filenames[path] = filename 
    238237      conf.close() 
    239238      # Filter. 
  • ZMS/trunk/_zcatalogmanager.py

    r676 r792  
    8888  # return quoted search string. 
    8989  return s 
    90  
    91 # ------------------------------------------------------------------------------ 
    92 #  _zcatalogmanager.addVocabulary: 
    93 # ------------------------------------------------------------------------------ 
    94 def addVocabulary( self, cat): 
    95   from Products.ZCatalog import Vocabulary 
    96    
    97   #-- Remove Default-Vocabulary 
    98   ids = cat.objectIds( ['Vocabulary']) 
    99   if len( ids) > 0: 
    100     cat.manage_delObjects( ids) 
    101    
    102   #-- Add ISO 8859-1 Vocabulary 
    103   # see ZCatalogs with Umlauts 
    104   # http://www.zope.org/Members/strobl/HowTos/Iszcatalog 
    105   globbing = 1 
    106   splitter = "ISO_8859_1_Splitter" 
    107   voc = Vocabulary.Vocabulary( "Vocabulary", "Default vocabulary", globbing, splitter) 
    108   cat._setObject( voc.id, voc) 
    10990 
    11091# ------------------------------------------------------------------------------ 
     
    523504      else: 
    524505        zcatalog = obs[ 0] 
    525        
    526       #-- Add vocabulary 
    527       addVocabulary( self, zcatalog) 
    528506       
    529507      #-- Add lexicon 
  • ZMS/trunk/changes.txt

    r752 r792  
    13711371[01271] Increased col-size threshold for string -> text in SQL-Datasource from 50 to 128 (requested by fh). 
    13721372-------------------------------------------------- 
    1373 2009-10-19:zms-2.11.4-02 
     13732009-10-25:zms-2.11.4-02 
    13741374[01271] Revised imports from Globals with respect for deprecation warnings in Zope2-2.12.0. 
    13751375[01272] Removed webdav-support for compatibility with Zope2-2.12.0. 
     
    13781378[01275] Added support for overwriting configuration of $ZMS_HOME/import/configure.zcml by $INSTANCE_HOME/etc/zms/import/configure.zcml(requested by xm). 
    13791379-------------------------------------------------- 
     13802009-10-26:zms2-2.12.0-01 
     1381[01276] Added support for Zope2-2.12.0 / Python-2.6.3. 
     1382 
     1383+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
     1384+++ IMPORTANT NOTE: ZMS will remain compliant with Zope-2.10.x / Python-2.4 until further notice! 
     1385+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
     1386-------------------------------------------------- 
  • ZMS/trunk/version.txt

    r752 r792  
    1 ZMS 2.11.4-02 
     1ZMS2 2.12.0-01 
Note: See TracChangeset for help on using the changeset viewer.