Edgewall Software

Changes between Version 59 and Version 60 of TracStandalone


Ignore:
Timestamp:
Sep 24, 2008, 7:50:42 PM (16 years ago)
Author:
anonymous
Comment:

realm added as parameter in trac-digest.py

Legend:

Unmodified
Added
Removed
Modified
  • TracStandalone

    v59 v60  
    120120except ImportError:
    121121    from md5 import md5
     122realm = 'trac'
    122123
    123124# build the options
     
    128129parser.add_option("-p", "--password",action="store", dest="password", type = "string",
    129130                  help="the password to use")
     131parser.add_option("-r", "--realm",action="store", dest="realm", type = "string",
     132                  help="the realm in which to create the digest")
    130133(options, args) = parser.parse_args()
    131134
     
    133136if (options.username is None) or (options.password is None):
    134137   parser.error("You must supply both the username and password")
     138if (options.realm is not None):
     139   realm = options.realm
    135140   
    136141# Generate the string to enter into the htdigest file
    137 realm = 'trac'
    138142kd = lambda x: md5(':'.join(x)).hexdigest()
    139143print ':'.join((options.username, realm, kd([options.username, realm, options.password])))