Add LDAP group API routes

This commit is contained in:
Tanner Collin 2020-09-10 20:41:29 -06:00
parent 6cd0ea7bd0
commit 3133114f93

View File

@ -46,5 +46,25 @@ def set_password():
ldap_functions.set_password(username, password)
return ''
@app.route('/add-to-group', methods=['POST'])
def add_to_group():
check_auth()
groupname = request.form['groupname']
username = request.form['username']
ldap_functions.add_to_group(groupname, username)
return ''
@app.route('/remove-from-group', methods=['POST'])
def remove_from_group():
check_auth()
groupname = request.form['groupname']
username = request.form['username']
ldap_functions.remove_from_group(groupname, username)
return ''
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')