r95913 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95912‎ | r95913 | r95914 >
Date:22:42, 31 August 2011
Author:laner
Status:ok
Tags:
Comment:
Changing group objectclasses and attributes, since we are switching them for SVN and Labs LDAP
Modified paths:
  • /trunk/tools/subversion/user-management/add-ldap-group (modified) (history)
  • /trunk/tools/subversion/user-management/modify-ldap-group (modified) (history)

Diff [purge]

Index: trunk/tools/subversion/user-management/modify-ldap-group
@@ -67,23 +67,23 @@
6868 checkuid = pwd.getpwnam(raw_member)
6969
7070 membertoadd = 'uid=' + raw_member + ',ou=people,' + base
71 - # uniqueMember expects DNs
72 - if 'uniqueMember' in NewPosixData.keys():
73 - if membertoadd in NewPosixData['uniqueMember']:
 71+ # member expects DNs
 72+ if 'member' in NewPosixData.keys():
 73+ if membertoadd in NewPosixData['member']:
7474 sys.stderr.write(raw_member + " is already a member of the group, skipping.\n")
7575 else:
76 - NewPosixData['uniqueMember'].append(membertoadd)
 76+ NewPosixData['member'].append(membertoadd)
7777 else:
78 - NewPosixData['uniqueMember'] = [ membertoadd ]
 78+ NewPosixData['member'] = [ membertoadd ]
7979 except KeyError:
8080 sys.stderr.write(raw_member + " doesn't exist, and won't be added to the group.\n")
8181 elif options.deleteMembers:
8282 raw_members = options.deleteMembers.split(',')
8383 for raw_member in raw_members:
8484 membertoremove = 'uid=' + raw_member + ',ou=people,' + base
85 - if 'uniqueMember' in NewPosixData.keys():
86 - if membertoremove in NewPosixData['uniqueMember']:
87 - NewPosixData['uniqueMember'].remove(membertoremove)
 85+ if 'member' in NewPosixData.keys():
 86+ if membertoremove in NewPosixData['member']:
 87+ NewPosixData['member'].remove(membertoremove)
8888 else:
8989 sys.stderr.write(raw_member + " isn't a member of the group, skipping.\n")
9090 else:
Index: trunk/tools/subversion/user-management/add-ldap-group
@@ -36,7 +36,7 @@
3737
3838 dn = 'cn=' + groupname + ',ou=group,' + base
3939 cn = groupname
40 - objectClasses = ['posixGroup', 'groupOfUniqueNames', 'top']
 40+ objectClasses = ['posixGroup', 'groupOfNames', 'top']
4141 if options.gidNumber:
4242 try:
4343 groupcheck = grp.getgrgid(options.gidNumber)
@@ -64,7 +64,7 @@
6565 # TODO: make this use LDAP calls instead of getent
6666 checkuid = pwd.getpwnam(raw_member)
6767
68 - # uniqueMember expects DNs
 68+ # member expects DNs
6969 members.append('uid=' + raw_member + ',ou=people,' + base)
7070 except KeyError:
7171 sys.stderr.write(raw_member + " doesn't exist, and won't be added to the group.\n")
@@ -74,7 +74,7 @@
7575 groupEntry['gidNumber'] = gidNumber
7676 groupEntry['cn'] = cn
7777 if members:
78 - groupEntry['uniqueMember'] = members
 78+ groupEntry['member'] = members
7979
8080 modlist = ldap.modlist.addModlist(groupEntry)
8181 ds.add_s(dn, modlist)

Status & tagging log