|
|
|
@ -1735,7 +1735,6 @@ class servMail(shareLdap):
|
|
|
|
|
# Ищем Mail пользователя
|
|
|
|
|
resSearch = self.searchMailUserToName(userName)
|
|
|
|
|
if not resSearch:
|
|
|
|
|
#New
|
|
|
|
|
self.printERROR (_("ERROR") + ": " +\
|
|
|
|
|
_("User %s is not found in Mail service") % str(userName) +\
|
|
|
|
|
" ...")
|
|
|
|
@ -1752,11 +1751,9 @@ class servMail(shareLdap):
|
|
|
|
|
#почтовая директория пользователя
|
|
|
|
|
mailDir = os.path.join(self.mailLocation,userName)
|
|
|
|
|
if self.servUnixObj.removeHomeDir(mailDir):
|
|
|
|
|
#New
|
|
|
|
|
self.printSUCCESS(\
|
|
|
|
|
_("Mail service directory %s is removed")% str(mailDir) +\
|
|
|
|
|
" ...")
|
|
|
|
|
#New
|
|
|
|
|
self.printSUCCESS(_("Service Mail user %s is deleted")%userName +\
|
|
|
|
|
" ...")
|
|
|
|
|
return True
|
|
|
|
@ -1815,12 +1812,10 @@ class servMail(shareLdap):
|
|
|
|
|
"""Удаление пользователей из списка из группы Mail"""
|
|
|
|
|
res = self.searchMailGroupToName(groupName)
|
|
|
|
|
if not res :
|
|
|
|
|
#New
|
|
|
|
|
self.printERROR(_("group name is not found in Mail service") +\
|
|
|
|
|
" ...")
|
|
|
|
|
return False
|
|
|
|
|
if not res[0][0][1].has_key("rfc822member"):
|
|
|
|
|
#New
|
|
|
|
|
self.printERROR(\
|
|
|
|
|
_("Member list of group %s is empty")%str(groupName)+" ...")
|
|
|
|
|
return False
|
|
|
|
@ -1835,7 +1830,6 @@ class servMail(shareLdap):
|
|
|
|
|
flagError = True
|
|
|
|
|
break
|
|
|
|
|
if flagError:
|
|
|
|
|
#New
|
|
|
|
|
self.printERROR(\
|
|
|
|
|
_("User %s is not found in group")%str(user)+" "+\
|
|
|
|
|
str(groupName) + " ...")
|
|
|
|
@ -1851,7 +1845,6 @@ class servMail(shareLdap):
|
|
|
|
|
"""Удаляет группу пользователей Mail"""
|
|
|
|
|
res = self.searchMailGroupToName(groupName)
|
|
|
|
|
if not res:
|
|
|
|
|
#New
|
|
|
|
|
self.printERROR(
|
|
|
|
|
_("Group %s is not found in Mail service")%groupName +\
|
|
|
|
|
" ...")
|
|
|
|
@ -1859,12 +1852,10 @@ class servMail(shareLdap):
|
|
|
|
|
delDN = self.addDN("cn="+groupName, self.relGroupsDN)
|
|
|
|
|
res = self.delDN(delDN)
|
|
|
|
|
if res:
|
|
|
|
|
#New
|
|
|
|
|
self.printSUCCESS( _("Mail group: %s is deleted")%groupName +\
|
|
|
|
|
" ...")
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
#New
|
|
|
|
|
self.printERROR(_("Can not delete Mail group") +\
|
|
|
|
|
" " + groupName + " ...")
|
|
|
|
|
return False
|
|
|
|
@ -1886,8 +1877,7 @@ class servMail(shareLdap):
|
|
|
|
|
"""Модифицирует настройки группы пользователей Mail"""
|
|
|
|
|
searchGroup = self.searchMailGroupToName(groupName)
|
|
|
|
|
if not searchGroup:
|
|
|
|
|
#New
|
|
|
|
|
self.printERROR(_("group name not found in Mail service ..."))
|
|
|
|
|
self.printERROR(_("group name not found in Mail service") +" ...")
|
|
|
|
|
return False
|
|
|
|
|
# Добавляем список пользователей в группу
|
|
|
|
|
if options.has_key('a'):
|
|
|
|
@ -1895,11 +1885,9 @@ class servMail(shareLdap):
|
|
|
|
|
users = options['a'].split(',')
|
|
|
|
|
res = self.addUsersGroupMail(users, groupName)
|
|
|
|
|
if res:
|
|
|
|
|
#New
|
|
|
|
|
self.printSUCCESS(_("Appended list users to group") + " " +\
|
|
|
|
|
str(groupName) + " ...")
|
|
|
|
|
else:
|
|
|
|
|
#New
|
|
|
|
|
self.printERROR(_("Can not append list users to group") +\
|
|
|
|
|
" " + str(groupName) + " ...")
|
|
|
|
|
return False
|
|
|
|
@ -1909,11 +1897,9 @@ class servMail(shareLdap):
|
|
|
|
|
users = options['d'].split(',')
|
|
|
|
|
res = self.delUsersGroupMail(users, groupName)
|
|
|
|
|
if res:
|
|
|
|
|
#New
|
|
|
|
|
self.printSUCCESS(_("Deleted list users from group") + " " +\
|
|
|
|
|
str(groupName) + " ...")
|
|
|
|
|
else:
|
|
|
|
|
#New
|
|
|
|
|
self.printERROR(_("Can not delete list users from group") +\
|
|
|
|
|
" " + str(groupName) + " ...")
|
|
|
|
|
return False
|
|
|
|
@ -1924,7 +1910,6 @@ class servMail(shareLdap):
|
|
|
|
|
if options.has_key('n'):
|
|
|
|
|
newGroupName = options['n']
|
|
|
|
|
if self.searchMailGroupToName(newGroupName):
|
|
|
|
|
#New
|
|
|
|
|
self.printERROR(
|
|
|
|
|
_("group name %s is found in Mail service")%\
|
|
|
|
|
str(newGroupName) + " ...")
|
|
|
|
@ -1960,11 +1945,9 @@ class servMail(shareLdap):
|
|
|
|
|
oldDN = self.addDN("cn=" + groupName, self.relGroupsDN)
|
|
|
|
|
res = self.modifyElemDN(oldDN, newFirstDn)
|
|
|
|
|
if res:
|
|
|
|
|
#New
|
|
|
|
|
self.printSUCCESS(_("Group renamed") + " ...")
|
|
|
|
|
modGroupName = newGroupName
|
|
|
|
|
else:
|
|
|
|
|
#New
|
|
|
|
|
self.printERROR(_("Can not rename group") + "...")
|
|
|
|
|
return False
|
|
|
|
|
modAttrs = attrAppend + attrDelete
|
|
|
|
@ -1977,12 +1960,10 @@ class servMail(shareLdap):
|
|
|
|
|
res = self.modAttrsDN(groupDN, modAttrs)
|
|
|
|
|
if res:
|
|
|
|
|
if options.has_key('c'):
|
|
|
|
|
#New
|
|
|
|
|
self.printSUCCESS(_("Modified group comment") + " ...")
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
if options.has_key('c'):
|
|
|
|
|
#New
|
|
|
|
|
self.printSUCCESS(_("Can not modify group comment") +\
|
|
|
|
|
" ...")
|
|
|
|
|
return False
|
|
|
|
@ -2030,7 +2011,6 @@ class servMail(shareLdap):
|
|
|
|
|
break
|
|
|
|
|
if flagError:
|
|
|
|
|
return False
|
|
|
|
|
#New
|
|
|
|
|
self.printSUCCESS(_("Appended list of supplementary group") +\
|
|
|
|
|
" ...")
|
|
|
|
|
# Изменяемые аттрибуты пользователя
|
|
|
|
@ -2074,7 +2054,6 @@ class servMail(shareLdap):
|
|
|
|
|
self.clVars.Get("sys_domain"))
|
|
|
|
|
if self.searchUserToMail(mail) or\
|
|
|
|
|
self.searchGroupToMail(mail):
|
|
|
|
|
#New
|
|
|
|
|
self.printERROR(_("Alternate email address") + ": " +\
|
|
|
|
|
str(mail) + " " + _("is found in Mail service") +\
|
|
|
|
|
" ...")
|
|
|
|
@ -2086,22 +2065,17 @@ class servMail(shareLdap):
|
|
|
|
|
if not self.modAttrsDN(DN, modAttrs):
|
|
|
|
|
return False
|
|
|
|
|
if options.has_key('c'):
|
|
|
|
|
#New
|
|
|
|
|
self.printSUCCESS(_("Modified comment") + " ...")
|
|
|
|
|
if options.has_key('L'):
|
|
|
|
|
#New
|
|
|
|
|
self.printSUCCESS(_("Locked Mail user") + " " +\
|
|
|
|
|
str(userName) + " ...")
|
|
|
|
|
if options.has_key('U'):
|
|
|
|
|
#New
|
|
|
|
|
self.printSUCCESS(_("Unlocked Mail user") + " " +\
|
|
|
|
|
str(userName) + " ...")
|
|
|
|
|
if options.has_key('e'):
|
|
|
|
|
#New
|
|
|
|
|
self.printSUCCESS(_("Modified Mail alternate addresses") +\
|
|
|
|
|
"...")
|
|
|
|
|
if options.has_key('P') or options.has_key('p'):
|
|
|
|
|
#New
|
|
|
|
|
self.printSUCCESS(_("Modified Mail user password") + " ...")
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
@ -3389,8 +3363,7 @@ class cl_ldap(shareLdap):
|
|
|
|
|
'shortOption':"c",
|
|
|
|
|
'longOption':"comment",
|
|
|
|
|
'optVal':"COMMENT",
|
|
|
|
|
'helpChapter':_("Service Mail options"),
|
|
|
|
|
#New
|
|
|
|
|
'helpChapter':_("Mail service options"),
|
|
|
|
|
'help':_("set the description field for the new group")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(0,),
|
|
|
|
@ -3589,8 +3562,7 @@ class cl_ldap(shareLdap):
|
|
|
|
|
{'progAccess':(4,),
|
|
|
|
|
'shortOption':"r",
|
|
|
|
|
'longOption':"remove",
|
|
|
|
|
'helpChapter':_("Service Mail options"),
|
|
|
|
|
#New
|
|
|
|
|
'helpChapter':_("Mail service options"),
|
|
|
|
|
'help':_("remove user mail directory")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(5,),
|
|
|
|
@ -3611,9 +3583,7 @@ class cl_ldap(shareLdap):
|
|
|
|
|
'shortOption':"e",
|
|
|
|
|
'longOption':"alt-emails",
|
|
|
|
|
'optVal':"ALT_EMAILS",
|
|
|
|
|
#New
|
|
|
|
|
'helpChapter':_("Service Mail options"),
|
|
|
|
|
#New
|
|
|
|
|
'helpChapter':_("Mail service options"),
|
|
|
|
|
'help':_("set alternate email addresses for the mail account")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(5,),
|
|
|
|
@ -3735,14 +3705,14 @@ class cl_ldap(shareLdap):
|
|
|
|
|
'shortOption':"b",
|
|
|
|
|
'longOption':"backup",
|
|
|
|
|
'helpChapter':_("Common options"),
|
|
|
|
|
'help':_("backup service configuration files and LDAP branch")+\
|
|
|
|
|
'help':_("backup services configuration files and LDAP branches")+\
|
|
|
|
|
" (" + _("default option") + ")"
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(8,),
|
|
|
|
|
'shortOption':"r",
|
|
|
|
|
'longOption':"restore",
|
|
|
|
|
'helpChapter':_("Common options"),
|
|
|
|
|
'help':_("restore service configuration files and LDAP branch")
|
|
|
|
|
'help':_("restore services configuration files and LDAP branches")
|
|
|
|
|
},
|
|
|
|
|
#{'progAccess':(0,1,2,4,5,6),
|
|
|
|
|
#'shortOption':"s",
|
|
|
|
|