if exist disabledLocalUser parameter in json

This commit is contained in:
Tuncay ÇOLAK 2020-04-23 23:55:37 +03:00
parent 18193c3c97
commit 8de806f0e3
2 changed files with 35 additions and 28 deletions

View file

@ -30,7 +30,6 @@ class ADLogin(AbstractPlugin):
ad_username = self.data['ad_username']
admin_password = self.data['admin_password']
ad_port = self.data['ad_port']
disabled_local_user = self.data['disableLocalUser']
execution_result = self.ad_authentication.authenticate(domain_name, hostname, ip_address, admin_password, ad_username)
if execution_result is False:
@ -39,6 +38,8 @@ class ADLogin(AbstractPlugin):
content_type=self.get_content_type().APPLICATION_JSON.value)
else:
# if get disabled_local_user TRUE set user_disabled in ahenk.conf. disabled local users then client reboot
if self.has_attr_json(self.data, 'disableLocalUser') is True:
disabled_local_user = self.data['disableLocalUser']
self.config.read(self.ahenk_conf_path)
if disabled_local_user is True:
# self.registration.disable_local_users()

View file

@ -29,7 +29,11 @@ class LDAPLogin(AbstractPlugin):
# version = self.data['version']
admin_dn = self.data['admin-dn']
admin_password = self.data['admin-password']
disabled_local_user = self.data['disableLocalUser']
if admin_password is None:
self.config.read(self.ahenk_conf_path)
if self.config.has_section('CONNECTION'):
admin_password = self.config.get("CONNECTION", "password")
execution_result = self.sssd_authentication.authenticate(server_address, dn, admin_dn, admin_password)
if execution_result is False:
@ -38,6 +42,8 @@ class LDAPLogin(AbstractPlugin):
content_type=self.get_content_type().APPLICATION_JSON.value)
else:
# if get disabled_local_user TRUE set user_disabled in ahenk.conf. disabled local users then client reboot
if self.has_attr_json(self.data, 'disableLocalUser') is True:
disabled_local_user = self.data['disableLocalUser']
self.config.read(self.ahenk_conf_path)
if disabled_local_user is True:
# self.registration.disable_local_users()