12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import typer
- import config
- from misc import apache_ldap
- from misc.headers import create_headerfiles
- app = typer.Typer()
- cfg = config.Config()
- @app.command()
- def headers():
- create_headerfiles(cfg.system_dir + "\\Export")
- @app.command()
- def ldap_backup():
- cred = cfg.cognos11.credentials
- apache_ldap.ldap_backup(cred.username, cred.password, cfg.cognos11.config_dir + "\\apacheds_backup.ldif")
- @app.command()
- def ldap_restore(backup_file: str):
- cred = cfg.cognos11.credentials
- apache_ldap.restore_ldap(cred.username, cred.password, backup_file)
- @app.command()
- def ldap_password(old_password: str, new_password: str) -> bool:
- return apache_ldap.ldap_change_admin_password(old_password, new_password)
- @app.command()
- def ldap_admin():
- if ldap_password("gc01gapsC$", ""):
- print("Passwort ist bereits aktuell.")
- for p in ["Cognos#11Cognos#11", "mEn$q3b%P9p1j!A-ku", "Never4getpw#!!##"]:
- if ldap_password(p, "gc01gapsC$"):
- break
- if __name__ == "__main__":
- headers()
|