|
|
|
@ -1305,7 +1305,7 @@ class servUnix(shareLdap):
|
|
|
|
|
self.printSUCCESS(_("Replaced list of supplementary group")+\
|
|
|
|
|
" ...")
|
|
|
|
|
# Добавляем группы в которые входит пользователь
|
|
|
|
|
if options.has_key('a'):
|
|
|
|
|
elif options.has_key('a'):
|
|
|
|
|
userGroups = options['a'].split(',')
|
|
|
|
|
#список имен добавляемых групп
|
|
|
|
|
userGroupNames = self.searchGroupsUnix(userGroups)
|
|
|
|
@ -1363,15 +1363,18 @@ class servUnix(shareLdap):
|
|
|
|
|
shell = options['s']
|
|
|
|
|
modAttrs.append((ldap.MOD_REPLACE, 'loginShell', shell))
|
|
|
|
|
# Изменяем пароль пользователя
|
|
|
|
|
userPwd = self.getUserPassword(options, "p", "P")
|
|
|
|
|
if userPwd == False:
|
|
|
|
|
return False
|
|
|
|
|
userPwd = self.getUserPassword(options, "p", "P")
|
|
|
|
|
if userPwd == False:
|
|
|
|
|
return False
|
|
|
|
|
if userPwd:
|
|
|
|
|
userPwdHash = self.execProg("slappasswd -s %s -h %s"\
|
|
|
|
|
%(userPwd, self.userCrypt))
|
|
|
|
|
if res[0][0][1].has_key('userPassword'):
|
|
|
|
|
userPwdHash =\
|
|
|
|
|
self.execProg("slappasswd -s %s -h %s"\
|
|
|
|
|
%(userPwd, self.userCrypt))
|
|
|
|
|
modAttrs.append((ldap.MOD_REPLACE, 'userPassword',
|
|
|
|
|
userPwdHash))
|
|
|
|
|
else:
|
|
|
|
|
modAttrs.append((ldap.MOD_ADD, 'userPassword',
|
|
|
|
|
userPwdHash))
|
|
|
|
|
if modAttrs:
|
|
|
|
|
DN = self.addDN("uid="+userName, self.relUsersDN)
|
|
|
|
|
if not self.modAttrsDN(DN, modAttrs):
|
|
|
|
@ -1492,7 +1495,7 @@ class servUnix(shareLdap):
|
|
|
|
|
if options.has_key('d'):
|
|
|
|
|
# удаляемые пользователи из группы
|
|
|
|
|
users = options['d'].split(',')
|
|
|
|
|
res = self.delUserGroupUnix(users, groupName)
|
|
|
|
|
res = self.delUsersGroupUnix(users, groupName)
|
|
|
|
|
if res:
|
|
|
|
|
self.printSUCCESS(_("Deleted list users from group") + " " +\
|
|
|
|
|
str(groupName) + " ...")
|
|
|
|
@ -1500,6 +1503,7 @@ class servUnix(shareLdap):
|
|
|
|
|
self.printERROR(_("Can not delete list users from group") +\
|
|
|
|
|
" " + str(groupName) + " ...")
|
|
|
|
|
return False
|
|
|
|
|
modGroupName = newGroupName
|
|
|
|
|
# Изменяем имя группы
|
|
|
|
|
if options.has_key('n'):
|
|
|
|
|
newGroupName = options['n']
|
|
|
|
@ -1512,6 +1516,7 @@ class servUnix(shareLdap):
|
|
|
|
|
oldDN = self.addDN("cn=" + groupName, self.relGroupsDN)
|
|
|
|
|
res = self.modifyElemDN(oldDN, newFirstDn)
|
|
|
|
|
if res:
|
|
|
|
|
modGroupName = newGroupName
|
|
|
|
|
self.printSUCCESS(_("Group renamed") + " ...")
|
|
|
|
|
else:
|
|
|
|
|
self.printERROR(_("Can not rename group") + "...")
|
|
|
|
@ -1522,7 +1527,7 @@ class servUnix(shareLdap):
|
|
|
|
|
gecos = options['c']
|
|
|
|
|
modAttrs.append((ldap.MOD_REPLACE, 'description', gecos))
|
|
|
|
|
if modAttrs:
|
|
|
|
|
groupDN = self.addDN("cn="+groupName, self.relGroupsDN)
|
|
|
|
|
groupDN = self.addDN("cn=" + modGroupName, self.relGroupsDN)
|
|
|
|
|
res = self.modAttrsDN(groupDN, modAttrs)
|
|
|
|
|
if res:
|
|
|
|
|
if options.has_key('c'):
|
|
|
|
@ -1553,7 +1558,7 @@ class servUnix(shareLdap):
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def delUserGroupUnix(self, users, groupName):
|
|
|
|
|
def delUsersGroupUnix(self, users, groupName):
|
|
|
|
|
"""Удаление пользователей из списка из группы Unix"""
|
|
|
|
|
res = self.searchUnixGroupName(groupName)
|
|
|
|
|
if not res :
|
|
|
|
@ -1725,6 +1730,37 @@ class servMail(shareLdap):
|
|
|
|
|
return False
|
|
|
|
|
return userGroupNames
|
|
|
|
|
|
|
|
|
|
def delUserMailServer(self, userName, options):
|
|
|
|
|
"""Удаляем Mail пользователя"""
|
|
|
|
|
# Ищем Mail пользователя
|
|
|
|
|
resSearch = self.searchMailUserToName(userName)
|
|
|
|
|
if not resSearch:
|
|
|
|
|
#New
|
|
|
|
|
self.printERROR (_("ERROR") + ": " +\
|
|
|
|
|
_("User %s is not found in Mail service") % str(userName) +\
|
|
|
|
|
" ...")
|
|
|
|
|
return False
|
|
|
|
|
# Удаляем пользователя из групп
|
|
|
|
|
if not self.delUserInGroup(userName):
|
|
|
|
|
return False
|
|
|
|
|
# Удаляем пользователя
|
|
|
|
|
delDN = self.addDN("uid=" + userName, self.relUsersDN)
|
|
|
|
|
if not self.delDN(delDN):
|
|
|
|
|
return False
|
|
|
|
|
# Удаляем почтовую папку
|
|
|
|
|
if options.has_key('r'):
|
|
|
|
|
#почтовая директория пользователя
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
def searchMailGroupToName(self, groupName):
|
|
|
|
|
"""Находит группу сервиса Unix по её имени"""
|
|
|
|
|
resSearch = self.searchLdapDN(groupName, self.relGroupsDN, "cn")
|
|
|
|
@ -1748,7 +1784,7 @@ class servMail(shareLdap):
|
|
|
|
|
if printError:
|
|
|
|
|
self.printERROR(\
|
|
|
|
|
_("Mail user or email %s are not found in Mail service")%\
|
|
|
|
|
str(nameOrMail) + " ...")
|
|
|
|
|
str(nameOrMail) + " ...")
|
|
|
|
|
return False
|
|
|
|
|
userMail = resSearchUser[0][0][1]['mail'][0]
|
|
|
|
|
resSearchGroup = self.searchLdapDN(userMail, self.relGroupsDN,
|
|
|
|
@ -1775,7 +1811,185 @@ class servMail(shareLdap):
|
|
|
|
|
else:
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def modUserMailServer(self,userName, options):
|
|
|
|
|
def delUsersGroupMail(self, users, groupName):
|
|
|
|
|
"""Удаление пользователей из списка из группы 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
|
|
|
|
|
memberMailUsers = res[0][0][1]["rfc822member"]
|
|
|
|
|
flagError = False
|
|
|
|
|
memberUsers = {}
|
|
|
|
|
for mailUser in memberMailUsers:
|
|
|
|
|
userName = mailUser.split("@")[0]
|
|
|
|
|
memberUsers[userName] = mailUser
|
|
|
|
|
for user in users:
|
|
|
|
|
if not user in memberUsers.keys():
|
|
|
|
|
flagError = True
|
|
|
|
|
break
|
|
|
|
|
if flagError:
|
|
|
|
|
#New
|
|
|
|
|
self.printERROR(\
|
|
|
|
|
_("User %s is not found in group")%str(user)+" "+\
|
|
|
|
|
str(groupName) + " ...")
|
|
|
|
|
return False
|
|
|
|
|
modAttrs = []
|
|
|
|
|
for user in users:
|
|
|
|
|
mailUser = memberUsers[user]
|
|
|
|
|
modAttrs.append((ldap.MOD_DELETE, 'rfc822member', mailUser))
|
|
|
|
|
groupDN = self.addDN("cn="+groupName, self.relGroupsDN)
|
|
|
|
|
return self.modAttrsDN(groupDN, modAttrs)
|
|
|
|
|
|
|
|
|
|
def delGroupMailServer(self, groupName, options):
|
|
|
|
|
"""Удаляет группу пользователей Mail"""
|
|
|
|
|
res = self.searchMailGroupToName(groupName)
|
|
|
|
|
if not res:
|
|
|
|
|
#New
|
|
|
|
|
self.printERROR(
|
|
|
|
|
_("Group %s is not found in Mail service")%groupName +\
|
|
|
|
|
" ...")
|
|
|
|
|
return False
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
def delAlternateAddress(self, userName):
|
|
|
|
|
"""Удаление альтернативных адресов пользователя"""
|
|
|
|
|
res = self.searchMailUserToName(userName)
|
|
|
|
|
if not res:
|
|
|
|
|
return False
|
|
|
|
|
if not res[0][0][1].has_key('mailAlternateAddress'):
|
|
|
|
|
return True
|
|
|
|
|
modAttrs = [(ldap.MOD_DELETE, 'mailAlternateAddress', None)]
|
|
|
|
|
userDN = self.addDN("uid=" + userName, self.relUsersDN)
|
|
|
|
|
if not self.modAttrsDN(userDN, modAttrs):
|
|
|
|
|
return False
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def modGroupMailServer(self, groupName, options):
|
|
|
|
|
"""Модифицирует настройки группы пользователей Mail"""
|
|
|
|
|
searchGroup = self.searchMailGroupToName(groupName)
|
|
|
|
|
if not searchGroup:
|
|
|
|
|
#New
|
|
|
|
|
self.printERROR(_("group name not found in Mail service ..."))
|
|
|
|
|
return False
|
|
|
|
|
# Добавляем список пользователей в группу
|
|
|
|
|
if options.has_key('a'):
|
|
|
|
|
# добавляемые пользователи в группу
|
|
|
|
|
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
|
|
|
|
|
# Удаляем список пользователей из группы
|
|
|
|
|
if options.has_key('d'):
|
|
|
|
|
# удаляемые пользователи из группы
|
|
|
|
|
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
|
|
|
|
|
# Изменяем имя группы
|
|
|
|
|
attrDelete = []
|
|
|
|
|
attrAppend = []
|
|
|
|
|
modGroupName = groupName
|
|
|
|
|
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) + " ...")
|
|
|
|
|
return False
|
|
|
|
|
# изменяем адрес и альтернативный адрес
|
|
|
|
|
altEmails = searchGroup[0][0][1]["mailAlternateAddress"]
|
|
|
|
|
for altEmail in altEmails:
|
|
|
|
|
splAltEmail = altEmail.split("@")
|
|
|
|
|
grName = splAltEmail[0]
|
|
|
|
|
if groupName == grName:
|
|
|
|
|
altEmailDomen = ""
|
|
|
|
|
if len(splAltEmail)==2:
|
|
|
|
|
altEmailDomen = splAltEmail[1]
|
|
|
|
|
newAltEmail = "%s@%s" %(newGroupName,altEmailDomen)
|
|
|
|
|
attrDelete.append(
|
|
|
|
|
(ldap.MOD_DELETE, 'mailAlternateAddress',
|
|
|
|
|
altEmail))
|
|
|
|
|
attrAppend.append(
|
|
|
|
|
(ldap.MOD_ADD, 'mailAlternateAddress',
|
|
|
|
|
newAltEmail))
|
|
|
|
|
break
|
|
|
|
|
email = searchGroup[0][0][1]["mail"][0]
|
|
|
|
|
splEmail = email.split("@")
|
|
|
|
|
emailDomen = ""
|
|
|
|
|
if len(splEmail)==2:
|
|
|
|
|
emailDomen = splEmail[1]
|
|
|
|
|
newEmail = "%s@%s" %(newGroupName,emailDomen)
|
|
|
|
|
attrAppend.append((ldap.MOD_REPLACE, 'mail', newEmail))
|
|
|
|
|
attrAppend.append((ldap.MOD_REPLACE, 'mailMessageStore',
|
|
|
|
|
newGroupName + "/"))
|
|
|
|
|
|
|
|
|
|
newFirstDn = "cn=" + newGroupName
|
|
|
|
|
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
|
|
|
|
|
# Изменяем коментарий к группе
|
|
|
|
|
if options.has_key('c'):
|
|
|
|
|
gecos = options['c']
|
|
|
|
|
modAttrs.append((ldap.MOD_REPLACE, 'description', gecos))
|
|
|
|
|
if modAttrs:
|
|
|
|
|
groupDN = self.addDN("cn=" + modGroupName, self.relGroupsDN)
|
|
|
|
|
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
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def modUserMailServer(self, userName, options):
|
|
|
|
|
"""Модифицирует настройки пользователя Mail в LDAP"""
|
|
|
|
|
res = self.searchMailUserToName(userName)
|
|
|
|
|
if not res:
|
|
|
|
@ -1802,6 +2016,94 @@ class servMail(shareLdap):
|
|
|
|
|
return False
|
|
|
|
|
self.printSUCCESS(_("Replaced list of supplementary group") +\
|
|
|
|
|
" ...")
|
|
|
|
|
# Добавляем группы в которые входит пользователь
|
|
|
|
|
elif options.has_key('a'):
|
|
|
|
|
userGroups = options['a'].split(',')
|
|
|
|
|
#список имен добавляемых групп
|
|
|
|
|
userGroupNames = self.searchGroupsMail(userGroups)
|
|
|
|
|
if not userGroupNames:
|
|
|
|
|
return False
|
|
|
|
|
flagError = False
|
|
|
|
|
for group in userGroupNames:
|
|
|
|
|
if not self.addUsersGroupMail([userName], group):
|
|
|
|
|
flagError = True
|
|
|
|
|
break
|
|
|
|
|
if flagError:
|
|
|
|
|
return False
|
|
|
|
|
#New
|
|
|
|
|
self.printSUCCESS(_("Appended list of supplementary group") +\
|
|
|
|
|
" ...")
|
|
|
|
|
# Изменяемые аттрибуты пользователя
|
|
|
|
|
modAttrs = []
|
|
|
|
|
# Включаем пользователя
|
|
|
|
|
if options.has_key('U'):
|
|
|
|
|
modAttrs += [(ldap.MOD_REPLACE, 'accountStatus', "active")]
|
|
|
|
|
# Выключаем пользователя
|
|
|
|
|
elif options.has_key('L'):
|
|
|
|
|
modAttrs += [(ldap.MOD_REPLACE, 'accountStatus', "passive")]
|
|
|
|
|
|
|
|
|
|
# Изменяем коментарий к пользователю
|
|
|
|
|
if options.has_key('c'):
|
|
|
|
|
comment = options['c']
|
|
|
|
|
modAttrs += [(ldap.MOD_REPLACE, 'sn', comment),
|
|
|
|
|
(ldap.MOD_REPLACE, 'cn', comment)]
|
|
|
|
|
# Изменяем пароль пользователя
|
|
|
|
|
userPwd = self.getUserPassword(options, "p", "P")
|
|
|
|
|
if userPwd == False:
|
|
|
|
|
return False
|
|
|
|
|
if userPwd:
|
|
|
|
|
userPwdHash = self.execProg("slappasswd -s %s -h %s"\
|
|
|
|
|
%(userPwd, self.userCrypt))
|
|
|
|
|
if res[0][0][1].has_key('userPassword'):
|
|
|
|
|
modAttrs.append((ldap.MOD_REPLACE, 'userPassword',
|
|
|
|
|
userPwdHash))
|
|
|
|
|
else:
|
|
|
|
|
modAttrs.append((ldap.MOD_ADD, 'userPassword',
|
|
|
|
|
userPwdHash))
|
|
|
|
|
# Заменяем альтернативные почтовые адреса
|
|
|
|
|
if options.has_key('e'):
|
|
|
|
|
# Удаляем предыдущие адреса
|
|
|
|
|
self.delAlternateAddress(userName)
|
|
|
|
|
altMails = options['e'].split(",")
|
|
|
|
|
for altMail in altMails:
|
|
|
|
|
if "@" in altMail:
|
|
|
|
|
mail = altMail
|
|
|
|
|
else:
|
|
|
|
|
mail = "%s@%s.%s" %(altMail,
|
|
|
|
|
self.clVars.Get("net_host"),
|
|
|
|
|
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") +\
|
|
|
|
|
" ...")
|
|
|
|
|
return False
|
|
|
|
|
modAttrs.append((ldap.MOD_ADD, 'mailAlternateAddress', mail))
|
|
|
|
|
|
|
|
|
|
if modAttrs:
|
|
|
|
|
DN = self.addDN("uid="+userName, self.relUsersDN)
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
@adminConnectLdap
|
|
|
|
|
def addGroupMailServer(self, groupName, options):
|
|
|
|
@ -1821,6 +2123,11 @@ class servMail(shareLdap):
|
|
|
|
|
str(mail) + " ...")
|
|
|
|
|
return False
|
|
|
|
|
self.clVars.Set("soft_ldap_group_name",groupName)
|
|
|
|
|
# Комментарий к группе
|
|
|
|
|
groupGecos = self.servUnixObj.groupGecos
|
|
|
|
|
if options.has_key('c'):
|
|
|
|
|
groupGecos = options['c']
|
|
|
|
|
self.clVars.Set("soft_ldap_group_desc",groupGecos)
|
|
|
|
|
ldifFile = self.ldifFileGroup
|
|
|
|
|
groupLdif = self.createLdif(ldifFile)
|
|
|
|
|
if not groupLdif:
|
|
|
|
@ -1980,8 +2287,8 @@ class servMail(shareLdap):
|
|
|
|
|
"""Добавляет почтового пользователя в LDAP-сервер"""
|
|
|
|
|
#Проверяем альтернативные почтовые адреса
|
|
|
|
|
modAttrs = []
|
|
|
|
|
if options.has_key('a'):
|
|
|
|
|
altMails = options['a'].split(",")
|
|
|
|
|
if options.has_key('e'):
|
|
|
|
|
altMails = options['e'].split(",")
|
|
|
|
|
for altMail in altMails:
|
|
|
|
|
if "@" in altMail:
|
|
|
|
|
mail = altMail
|
|
|
|
@ -2073,7 +2380,7 @@ class servMail(shareLdap):
|
|
|
|
|
return False
|
|
|
|
|
self.createMailDir(userName, uid, gid)
|
|
|
|
|
#Добавляем альтернативные почтовые адреса
|
|
|
|
|
if options.has_key('a') and modAttrs:
|
|
|
|
|
if options.has_key('e') and modAttrs:
|
|
|
|
|
DN = self.addDN("uid="+userName, self.relUsersDN)
|
|
|
|
|
if not self.modAttrsDN(DN, modAttrs):
|
|
|
|
|
return False
|
|
|
|
@ -3078,6 +3385,14 @@ class cl_ldap(shareLdap):
|
|
|
|
|
'helpChapter':_("Unix service options"),
|
|
|
|
|
'help':_("set the description field for the new group")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(0,),
|
|
|
|
|
'shortOption':"c",
|
|
|
|
|
'longOption':"comment",
|
|
|
|
|
'optVal':"COMMENT",
|
|
|
|
|
'helpChapter':_("Service Mail options"),
|
|
|
|
|
#New
|
|
|
|
|
'help':_("set the description field for the new group")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(0,),
|
|
|
|
|
'shortOption':"p",
|
|
|
|
|
'helpChapter':_("Unix service options"),
|
|
|
|
@ -3133,7 +3448,7 @@ class cl_ldap(shareLdap):
|
|
|
|
|
'help':_("set the COMMENT field for the new unix account")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(3,),
|
|
|
|
|
'shortOption':"a",
|
|
|
|
|
'shortOption':"e",
|
|
|
|
|
'longOption':"alt-emails",
|
|
|
|
|
'optVal':_("ALT_EMAILS"),
|
|
|
|
|
'helpChapter':_("Mail service options"),
|
|
|
|
@ -3271,6 +3586,13 @@ class cl_ldap(shareLdap):
|
|
|
|
|
'helpChapter':_("Unix service options"),
|
|
|
|
|
'help':_("remove home directory")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(4,),
|
|
|
|
|
'shortOption':"r",
|
|
|
|
|
'longOption':"remove",
|
|
|
|
|
'helpChapter':_("Service Mail options"),
|
|
|
|
|
#New
|
|
|
|
|
'help':_("remove user mail directory")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(5,),
|
|
|
|
|
'shortOption':"c",
|
|
|
|
|
'longOption':"comment",
|
|
|
|
@ -3285,6 +3607,15 @@ class cl_ldap(shareLdap):
|
|
|
|
|
'helpChapter':_("Mail service options"),
|
|
|
|
|
'help':_("new value of the COMMENT field")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(5,),
|
|
|
|
|
'shortOption':"e",
|
|
|
|
|
'longOption':"alt-emails",
|
|
|
|
|
'optVal':"ALT_EMAILS",
|
|
|
|
|
#New
|
|
|
|
|
'helpChapter':_("Service Mail options"),
|
|
|
|
|
#New
|
|
|
|
|
'help':_("set alternate email addresses for the mail account")
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(5,),
|
|
|
|
|
'shortOption':"d",
|
|
|
|
|
'longOption':"home",
|
|
|
|
@ -3443,7 +3774,7 @@ class cl_ldap(shareLdap):
|
|
|
|
|
'help':pcs(" samba", self.column_width,
|
|
|
|
|
"samba " + servName, self.consolewidth-self.column_width)
|
|
|
|
|
},
|
|
|
|
|
{'progAccess':(0,3,5,6,7,),
|
|
|
|
|
{'progAccess':(0,1,2,3,4,5,6,7,),
|
|
|
|
|
'helpChapter':_("Services"),
|
|
|
|
|
'help':pcs(" mail", self.column_width,
|
|
|
|
|
"mail " + servName, self.consolewidth-self.column_width)
|
|
|
|
|