No more office/syscom entries. Check if group is valid
This commit is contained in:
parent
67b56af44c
commit
1d73841693
|
@ -232,6 +232,15 @@ def get(userid):
|
||||||
|
|
||||||
return ldapi.lookup(ld, 'uid', userid, cfg['ldap_users_base'])
|
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):
|
def uid2dn(uid):
|
||||||
return 'uid=%s,%s' % (ldapi.escape(uid), cfg['ldap_users_base'])
|
return 'uid=%s,%s' % (ldapi.escape(uid), cfg['ldap_users_base'])
|
||||||
|
|
||||||
|
|
|
@ -37,11 +37,7 @@ class IntroPage(WizardPanel):
|
||||||
urwid.Text( "Adding a member to a club will also grant them "
|
urwid.Text( "Adding a member to a club will also grant them "
|
||||||
"access to the club's files and allow them to "
|
"access to the club's files and allow them to "
|
||||||
"become_club."
|
"become_club."
|
||||||
"\n\n"
|
"\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." )
|
|
||||||
]
|
]
|
||||||
def focusable(self):
|
def focusable(self):
|
||||||
return False
|
return False
|
||||||
|
@ -57,13 +53,27 @@ class InfoPage(WizardPanel):
|
||||||
]
|
]
|
||||||
def check(self):
|
def check(self):
|
||||||
group = self.group.get_edit_text()
|
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 = {
|
data = {
|
||||||
"name" : group,
|
"name" : group,
|
||||||
"group" : group_name,
|
"group" : group,
|
||||||
"groups" : [],
|
"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)
|
group_members(data)
|
||||||
|
|
||||||
class ChangeMember(WizardPanel):
|
class ChangeMember(WizardPanel):
|
||||||
|
|
|
@ -30,18 +30,6 @@ def program_name():
|
||||||
|
|
||||||
return "%s %s %s" % (cword, eword, oword)
|
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):
|
def new_member(*args, **kwargs):
|
||||||
push_wizard("New Member", [
|
push_wizard("New Member", [
|
||||||
newmember.IntroPage,
|
newmember.IntroPage,
|
||||||
|
@ -159,8 +147,6 @@ def top_menu():
|
||||||
syscom_only = [
|
syscom_only = [
|
||||||
("Manage Club or Group Members", manage_group, None),
|
("Manage Club or Group Members", manage_group, None),
|
||||||
("Manage Positions", manage_positions, None),
|
("Manage Positions", manage_positions, None),
|
||||||
("Manage Office Staff", groups.group_members, office_data),
|
|
||||||
("Manage Systems Committee", groups.group_members, syscom_data),
|
|
||||||
]
|
]
|
||||||
unrestricted = [
|
unrestricted = [
|
||||||
("Display Member", display_member, None),
|
("Display Member", display_member, None),
|
||||||
|
|
|
@ -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
|
ceo (0.5.7+nmu1) stable; urgency=low
|
||||||
|
|
||||||
* Non-maintainer upload.
|
* Non-maintainer upload.
|
||||||
|
|
Loading…
Reference in New Issue