diff options
| author | bwarsaw | 2000-10-02 20:40:41 +0000 |
|---|---|---|
| committer | bwarsaw | 2000-10-02 20:40:41 +0000 |
| commit | e32aecde449efe46b465f2f637ca85ffb7e84b48 (patch) | |
| tree | 029a52bd44ba3cbd7cc1d5d9f99c49c74342583c /Mailman/Utils.py | |
| parent | bedb5d55b33143823a2cdd2fc8d06219c383bfd0 (diff) | |
| download | mailman-e32aecde449efe46b465f2f637ca85ffb7e84b48.tar.gz mailman-e32aecde449efe46b465f2f637ca85ffb7e84b48.tar.zst mailman-e32aecde449efe46b465f2f637ca85ffb7e84b48.zip | |
Diffstat (limited to 'Mailman/Utils.py')
| -rw-r--r-- | Mailman/Utils.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py index 405539f29..720d04826 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -40,6 +40,7 @@ from Mailman import Errors ## import md5 ##except ImportError: ## md5 = None +from Mailman import Crypt @@ -392,6 +393,21 @@ def GetRandomSeed(): return c return "%c%c" % tuple(map(mkletter, (chr1, chr2))) +def SetSiteAdminPassword(pw): + fp = open_ex(mm_cfg.SITE_PW_FILE, 'w', perms=0640) + fp.write(Crypt.crypt(pw, GetRandomSeed())) + fp.close() + +def CheckSiteAdminPassword(pw1): + try: + f = open(mm_cfg.SITE_PW_FILE) + pw2 = f.read() + f.close() + return Crypt.crypt(pw1, pw2[:2]) == pw2 + # There probably is no site admin password if there was an exception + except IOError: + return 0 + def QuoteHyperChars(str): |
