예제 #1
0
파일: groups.py 프로젝트: hreeder/RomeoAuth
def groupremove(id, group):
	if ("admin" not in current_user.get_authgroups()) and ("admin-%s" % group not in current_user.get_authgroups()):
		flash("You do not have the right to do that.", "danger")
		return redirect("/groups/admin")
	id = str(id)
	group = str(group)
	ldaptools.modgroup(id, MOD_DELETE, group)
	flash("Membership of %s removed for %s" % (group, id), "success")
	return redirect("/groups/list/"+group)
예제 #2
0
파일: groups.py 프로젝트: hreeder/RomeoAuth
def groupmkadmin(id, group):
	if ("admin" not in current_user.get_authgroups()) and ("admin-%s" % group not in current_user.get_authgroups()):
		flash("You do not have the right to do that.", "danger")
		return redirect("/groups/admin")
	id = str(id)
	group = str(group)
	try:
		ldaptools.modgroup(id, MOD_ADD, "admin-%s" % group)
		flash("Membership of admin-%s added for %s" % (group, id), "success")
	except:
		flash("That user is already in that group.", "danger")
	return redirect("/groups/list/"+group)
예제 #3
0
파일: groups.py 프로젝트: hreeder/RomeoAuth
def groupdeny(id, group):
	if ("admin" not in current_user.get_authgroups()) and ("admin-%s" % group not in current_user.get_authgroups()):
		flash("You do not have the right to do that.", "danger")
		return redirect("/groups/admin")
	try:
		id = str(id)
		group = str(group)
		ldaptools.modgroup(id, MOD_DELETE, group+"-pending")
		flash("Membership of %s denied for %s" % (group, id), "success")
		return redirect("/groups/admin")
	except:
		flash("Membership application not found", "danger")
		return redirect("/groups/admin")
예제 #4
0
파일: ping.py 프로젝트: hreeder/RomeoAuth
def ping_send_group():
	if ("ping" not in current_user.get_authgroups()) and ("ping-%s" % request.form["group"] not in current_user.get_authgroups()):
		flash("You do not have the right to do that.", "danger")
		return redirect("/ping")
	count = pingbot.groupbroadcast(current_user.get_name(), "(|(authGroup={0}))".format(request.form["group"]), request.form["message"], request.form["group"])
	flash("Broadcast sent to %d members in %s" % (count, request.form["group"]), "success")
	return redirect("/ping")
예제 #5
0
def groups():
	yourgroups = current_user.get_authgroups() + current_user.get_pending_authgroups()
	notyours = lambda x: x not in yourgroups
	if "Ineligible" in current_user.accountStatus:
		return render_template("groups.html", closed_groups=filter(notyours, []), open_groups=filter(notyours, app.config["groups"]["publicgroups"]))
	else:
		return render_template("groups.html", closed_groups=filter(notyours, app.config["groups"]["closedgroups"]), open_groups=filter(notyours, app.config["groups"]["opengroups"]))
예제 #6
0
파일: groups.py 프로젝트: hreeder/RomeoAuth
def groups():
	yourgroups = current_user.get_authgroups() + current_user.get_pending_authgroups()
	notyours = lambda x: x not in yourgroups
	return render_template("groups.html", closed_groups=filter(notyours, app.config["groups"]["closedgroups"]), open_groups=filter(notyours, app.config["groups"]["opengroups"]))