|
|
|
@ -144,8 +144,9 @@ class UnixGroups(object):
|
|
|
|
|
raise self.exception(_("Group %s not found") % value)
|
|
|
|
|
if not ldap_group and unix_group:
|
|
|
|
|
raise self.exception(
|
|
|
|
|
_("You should create group %s (%d) in Unix service") %
|
|
|
|
|
(unix_group.group_name, unix_group.gid))
|
|
|
|
|
_("You should create group {groupname} ({groupid}) "
|
|
|
|
|
"in Unix service").format(groupname=unix_group.group_name,
|
|
|
|
|
groupid=unix_group.gid))
|
|
|
|
|
|
|
|
|
|
def group_dn(self, group):
|
|
|
|
|
return "cn=%s,%s" % (group, self.groups_dn)
|
|
|
|
@ -466,7 +467,7 @@ class Unix(Ldap):
|
|
|
|
|
users_dn = self.clVars.Get('ld_unix_users_dn')
|
|
|
|
|
uu = UnixUsers(ldap_connect, users_dn)
|
|
|
|
|
for user in uu.iterate_ldap_user("gidNumber=%d" % old_gid):
|
|
|
|
|
self.printSUCCESS(_("Change primary group for user {user}").format(
|
|
|
|
|
self.printSUCCESS(_("Changed primary group for user {user}").format(
|
|
|
|
|
user=user.username))
|
|
|
|
|
uu.update_user_group_id(user.username, str(gid))
|
|
|
|
|
return True
|
|
|
|
@ -571,7 +572,8 @@ class Unix(Ldap):
|
|
|
|
|
if gid is not None and user.gid != gid:
|
|
|
|
|
params['gid'] = str(gid)
|
|
|
|
|
self.printSUCCESS(
|
|
|
|
|
_("Changed primary group for user %s") % user.username)
|
|
|
|
|
_("Changed primary group for user {user}").format(
|
|
|
|
|
user.username))
|
|
|
|
|
if comment is not None and user.comment != comment:
|
|
|
|
|
params['comment'] = comment
|
|
|
|
|
self.printSUCCESS(
|
|
|
|
|