| 123456789101112131415161718192021222324252627282930 |
- import typer
- import config
- from misc import apache_ldap
- app = typer.Typer()
- cfg = config.Config()
- @app.command()
- def backup():
- cred = cfg.cognos11.credentials
- apache_ldap.ldap_backup(cred.username, cred.password, f"{cfg.cognos11.config_dir}\\apacheds_backup.ldif")
- @app.command()
- def restore(backup_file: str):
- cred = cfg.cognos11.credentials
- apache_ldap.restore_ldap(cred.username, cred.password, backup_file)
- @app.command()
- def admin_password(old_password: str, new_password: str) -> bool:
- return apache_ldap.ldap_change_admin_password(old_password, new_password)
- @app.command()
- def create_user(new_username: str, new_password: str) -> bool:
- cred = cfg.cognos11.credentials
- return apache_ldap.ldap_create_user(cred.username, cred.password, new_username, new_password, "")
|