summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Mailman/SecurityManager.py25
-rw-r--r--Mailman/mm_cfg.py.dist.in12
2 files changed, 21 insertions, 16 deletions
diff --git a/Mailman/SecurityManager.py b/Mailman/SecurityManager.py
index 51cb6a309..c25b59900 100644
--- a/Mailman/SecurityManager.py
+++ b/Mailman/SecurityManager.py
@@ -18,8 +18,13 @@
"""Handle passwords and sanitize approved messages."""
-import mm_crypt, types, string, os
-import mm_err, mm_utils, mm_cfg
+import os
+import string
+import types
+import Crypt
+import Errors
+import Utils
+import mm_cfg
# TBD: is this the best location for the site password?
SITE_PW_FILE = os.path.join(mm_cfg.DATA_DIR, 'adm.pw')
@@ -29,7 +34,7 @@ class SecurityManager:
def SetSiteAdminPassword(self, pw):
old = os.umask(0022)
f = open(SITE_PW_FILE, "w+")
- f.write(mm_crypt.crypt(pw, mm_utils.GetRandomSeed()))
+ f.write(Crypt.crypt(pw, Utils.GetRandomSeed()))
f.close()
os.umask(old)
@@ -38,7 +43,7 @@ class SecurityManager:
f = open(SITE_PW_FILE, "r")
pw = f.read()
f.close()
- return mm_crypt.crypt(str, pw) == pw
+ return Crypt.crypt(str, pw) == pw
# There probably is no site admin password if there was an exception
except:
return 0
@@ -55,11 +60,11 @@ class SecurityManager:
if self.CheckSiteAdminPassword(pw):
return 1
return ((type(pw) == types.StringType) and
- (mm_crypt.crypt(pw, self.password) == self.password))
+ (Crypt.crypt(pw, self.password) == self.password))
def ConfirmAdminPassword(self, pw):
if(not self.ValidAdminPassword(pw)):
- raise mm_err.MMBadPasswordError
+ raise Errors.MMBadPasswordError
return 1
def ConfirmUserPassword(self, user, pw):
@@ -69,18 +74,18 @@ class SecurityManager:
user = self.FindUser(user)
try:
if string.lower(pw) <> string.lower(self.passwords[user]):
- raise mm_err.MMBadPasswordError
+ raise Errors.MMBadPasswordError
except KeyError:
- raise mm_err.MMBadUserError
+ raise Errors.MMBadUserError
return 1
def ChangeUserPassword(self, user, newpw, confirm):
self.IsListInitialized()
addr = self.FindUser(user)
if not addr:
- raise mm_err.MMNotAMemberError
+ raise Errors.MMNotAMemberError
if newpw <> confirm:
- raise mm_err.MMPasswordsMustMatch
+ raise Errors.MMPasswordsMustMatch
self.passwords[addr] = newpw
self.Save()
diff --git a/Mailman/mm_cfg.py.dist.in b/Mailman/mm_cfg.py.dist.in
index c8f3a4ec6..e4f65949a 100644
--- a/Mailman/mm_cfg.py.dist.in
+++ b/Mailman/mm_cfg.py.dist.in
@@ -22,10 +22,10 @@
From a raw distribution it should be copied to mm_cfg.py. If you
already have an mm_cfg.py, be careful to add in only the new settings
you want. The complete set of distributed defaults, with annotation,
-are in ./mm_defaults. In mm_cfg, override only those you want to
+are in ./Defaults. In mm_cfg, override only those you want to
change, after the
- from mm_defaults import *
+ from Defaults import *
line (see below).
@@ -41,11 +41,11 @@ DEFAULT_MSG_FOOTER for an example."""
#######################################################
# Here's where we get the distributed defaults. #
-from mm_defaults import *
+from Defaults import *
##############################################################
# Put YOUR site-specific configuration below, in mm_cfg.py . #
-# See mm_defaults.py for explanations of the values. #
+# See Defaults.py for explanations of the values. #
DEFAULT_HOST_NAME = '@FQDN@'
DEFAULT_URL = 'http://@URL@/mailman'
@@ -55,5 +55,5 @@ MAILMAN_OWNER = 'mailman-owner@%s' % DEFAULT_HOST_NAME
PUBLIC_ARCHIVE_URL = '/pipermail'
PRIVATE_ARCHIVE_URL = '/mailman/private'
-# (Note - if you're looking for something that is imported from
-# mm_cfg, but you didn't find it above, it's probably in mm_defaults.py.)
+# Note - if you're looking for something that is imported from mm_cfg, but you
+# didn't find it above, it's probably in Defaults.py.