Changeset 1593

Show
Ignore:
Timestamp:
07/06/04 20:09:42 (20 years ago)
Author:
jalet
Message:

Reduced the set of invalid characters in names

Location:
pykota/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/NEWS

    r1592 r1593  
    2424    - 1.19alpha30 : 
    2525     
     26        - Usernames, Groupnames and Printernames can now contain 
     27          ANY character, expected '/' and '@'. 
     28         
    2629        - Integrated most of the Debian work from Sergio  
    2730          Gonz�z Gonz�z 
  • pykota/trunk/pykota/tool.py

    r1584 r1593  
    2222# 
    2323# $Log$ 
     24# Revision 1.111  2004/07/06 18:09:42  jalet 
     25# Reduced the set of invalid characters in names 
     26# 
    2427# Revision 1.110  2004/07/01 19:56:42  jalet 
    2528# Better dispatching of error messages 
     
    585588    def isValidName(self, name) : 
    586589        """Checks if a user or printer name is valid.""" 
    587         # unfortunately Python 2.1 string modules doesn't define ascii_letters... 
    588         asciiletters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' 
    589         digits = '0123456789' 
    590         validchars = asciiletters + digits + "-_." 
    591         for c in name : 
    592             if c not in validchars : 
     590        invalidchars = "/@" 
     591        for c in invalidchars : 
     592            if c in name : 
    593593                return 0 
    594594        return 1