@ -1070,12 +1070,13 @@ class shareLdap(imp_cl_err, imp_cl_xml, imp_cl_help, imp_cl_smcon):
return False
return True
@adminConnectLdap
def isServiceSetup ( self , service , printError = True ) :
""" Проверяет установлен ли сервис """
if self . clVars :
if self . clVars . Get ( " sr_ %s _set " % service ) == " on " :
return True
if not self . clVars :
# Cо зда е м объект переменные
self . createClVars ( )
if self . clVars . Get ( " sr_ %s _set " % service ) == " on " :
return True
if printError :
self . printERROR ( _ ( " Service %s is not installed " ) % service + " ... " )
return False
@ -10777,6 +10778,20 @@ with another option."))
retrAttrs = map ( lambda x : x [ 1 ] , data )
data = [ ]
lenRetrAttrs = len ( retrAttrs )
# Добавляем первичные группы
if service == " unix " :
memberUid = [ ]
if searchRes [ 0 ] [ 0 ] [ 1 ] . has_key ( ' memberUid ' ) :
memberUid = searchRes [ 0 ] [ 0 ] [ 1 ] [ ' memberUid ' ]
groupId = searchRes [ 0 ] [ 0 ] [ 1 ] [ ' gidNumber ' ] [ 0 ]
primaryUids = self . getUnixUidPrimGroup ( groupId )
memberUid = primaryUids + memberUid
uniqueUid = [ ]
# Удаляем одинаковые элементы
for uid in memberUid :
if not uid in uniqueUid :
uniqueUid . append ( uid )
searchRes [ 0 ] [ 0 ] [ 1 ] [ ' memberUid ' ] = uniqueUid
for info in searchRes :
for i in range ( lenRetrAttrs ) :
attr = retrAttrs [ i ]
@ -10960,6 +10975,20 @@ with another option."))
return ( headers , [ ] )
for info in searchRes :
listAttr = [ ]
# Добавляем первичные группы
if service == " unix " :
memberUid = [ ]
if info [ 0 ] [ 1 ] . has_key ( ' memberUid ' ) :
memberUid = info [ 0 ] [ 1 ] [ ' memberUid ' ]
groupId = info [ 0 ] [ 1 ] [ ' gidNumber ' ] [ 0 ]
primaryUids = self . getUnixUidPrimGroup ( groupId )
memberUid = primaryUids + memberUid
uniqueUid = [ ]
# Удаляем одинаковые элементы
for uid in memberUid :
if not uid in uniqueUid :
uniqueUid . append ( uid )
info [ 0 ] [ 1 ] [ ' memberUid ' ] = uniqueUid
for attr in retrAttrs :
if attr in info [ 0 ] [ 1 ] :
ldapValue = info [ 0 ] [ 1 ] [ attr ]
@ -10980,7 +11009,7 @@ with another option."))
if service == " unix " :
data = [ ( _ ( " Group " ) , " cn " ) ,
( _ ( " Name " ) , " description " ) ,
( " gid " , " gidNumber " ) ,
( " GID " , " gidNumber " ) ,
( _ ( " Member UID " ) , " memberUid " ) ]
if fields == " short " :
delData = [ _ ( " Member UID " ) ]
@ -11125,6 +11154,17 @@ with another option."))
loginsUsers . append ( listAttr )
return ( headers , loginsUsers )
def getUnixUidPrimGroup ( self , groupId ) :
""" Находим пользователей с указанной первичной группой в сервисе Unix
"""
servObj = servUnix ( )
searchUsers = servObj . searchUnixUserPrimGroup ( groupId )
users = [ ]
if searchUsers :
for dataUser in searchUsers :
users . append ( dataUser [ 0 ] [ 1 ] [ ' uid ' ] [ 0 ] )
return users
def modGroupAttr ( self , attr , value , service ) :
""" Модифицирует аттрибуты группы для вывода на печать """
retValue = value