2022-01-06 00:34:40 +00:00
|
|
|
#!/usr/bin/python
|
2021-08-19 22:41:35 +00:00
|
|
|
|
2022-06-26 00:13:57 +00:00
|
|
|
# A wrapper script over ldapvi
|
|
|
|
# Requires http://www.lichteblau.com/ldapvi/
|
|
|
|
|
2022-01-06 00:09:54 +00:00
|
|
|
from sys import argv
|
2022-06-25 23:08:57 +00:00
|
|
|
from subprocess import run
|
|
|
|
from ldappass import ldappass
|
|
|
|
|
|
|
|
|
|
|
|
def moduser(username):
|
|
|
|
"""Modify an existing user"""
|
|
|
|
|
|
|
|
if username == 'Manager':
|
2022-06-26 00:13:57 +00:00
|
|
|
run(['ldapvi', '-w', open('/etc/ldappass', 'r').read(), '--user', 'cn=Manager,dc=exozy,dc=me'])
|
2022-06-25 23:08:57 +00:00
|
|
|
else:
|
|
|
|
run(['ldapvi', '--user', 'uid=' + username + ',ou=People,dc=exozy,dc=me'])
|
2021-08-19 22:41:35 +00:00
|
|
|
|
2022-01-06 00:34:40 +00:00
|
|
|
|
2022-01-25 02:15:49 +00:00
|
|
|
moduser(argv[1])
|