No more office/syscom entries. Check if group is valid

This commit is contained in:
Michael Ellis 2010-06-18 21:03:17 -04:00
parent 67b56af44c
commit 1d73841693
4 changed files with 34 additions and 22 deletions

View File

@ -232,6 +232,15 @@ def get(userid):
return ldapi.lookup(ld, 'uid', userid, cfg['ldap_users_base'])
def get_group(group):
"""
Look up group by groupname
Returns a dictionary of group attributes
"""
return ldapi.lookup(ld, 'cn', group, cfg['ldap_groups_base'])
def uid2dn(uid):
return 'uid=%s,%s' % (ldapi.escape(uid), cfg['ldap_users_base'])

View File

@ -37,11 +37,7 @@ class IntroPage(WizardPanel):
urwid.Text( "Adding a member to a club will also grant them "
"access to the club's files and allow them to "
"become_club."
"\n\n"
"Do not manage office and syscom related groups using "
"this interface. Instead use the \"Manage Office "
"Staff\" and \"Manage Systems Committee\" entries "
"from the main menu." )
"\n\n")
]
def focusable(self):
return False
@ -57,13 +53,27 @@ class InfoPage(WizardPanel):
]
def check(self):
group = self.group.get_edit_text()
# TODO - check that group is valid
group_name = group # TODO
# check if group is valid
if not group or not members.get_group(group):
set_status("Group not found")
self.focus_widget(self.group)
return True
data = {
"name" : group,
"group" : group_name,
"group" : group,
"groups" : [],
}
# Office Staff and Syscom get added to more groups
if group == "syscom":
data["name"] = "Systems Committee"
data["groups"] = [ "office", "staff", "adm", "src" ]
elif group == "office":
data["name"] = "Office Staff"
data["groups"] = [ "cdrom", "audio", "video", "www" ]
group_members(data)
class ChangeMember(WizardPanel):

View File

@ -30,18 +30,6 @@ def program_name():
return "%s %s %s" % (cword, eword, oword)
office_data = {
"name" : "Office Staff",
"group" : "office",
"groups" : [ "cdrom", "audio", "video", "www" ],
}
syscom_data = {
"name" : "Systems Committee",
"group" : "syscom",
"groups" : [ "office", "staff", "adm", "src" ],
}
def new_member(*args, **kwargs):
push_wizard("New Member", [
newmember.IntroPage,
@ -159,8 +147,6 @@ def top_menu():
syscom_only = [
("Manage Club or Group Members", manage_group, None),
("Manage Positions", manage_positions, None),
("Manage Office Staff", groups.group_members, office_data),
("Manage Systems Committee", groups.group_members, syscom_data),
]
unrestricted = [
("Display Member", display_member, None),

7
debian/changelog vendored
View File

@ -1,3 +1,10 @@
ceo (0.5.7+nmu2) stable; urgency=low
* Removed the need for separate entries to manage office and syscom
* Added check to ensure group is valid
-- Michael Ellis <m2ellis@caffeine.csclub.uwaterloo.ca> Fri, 18 Jun 2010 20:59:40 -0400
ceo (0.5.7+nmu1) stable; urgency=low
* Non-maintainer upload.