scripts/moduser.py

12 lines
321 B
Python
Raw Normal View History

from subprocess import run
2022-01-25 04:21:41 +00:00
from ldappass import ldappass
2022-01-25 04:21:41 +00:00
def moduser(username):
"""Modify an existing user"""
if username == 'Manager':
2022-01-25 04:21:41 +00:00
run(['ldapvi', '-w', ldappass(), '--user', 'cn=Manager,dc=exozy,dc=me'])
else:
2022-01-25 04:21:41 +00:00
run(['ldapvi', '--user', 'uid=' + username + ',ou=People,dc=exozy,dc=me'])