def __init__(self, name, driver, base_url, uri="", certificate="", basedn="", binddn="", password="", preset_ldap=True): """""" UserIdResolver.__init__(self, name, driver, base_url) self.uri = uri.lower() self.certificate = certificate self.basedn = basedn self.binddn = binddn self.password = password self.preset_ldap = preset_ldap self.name_for_list = self.name + " [ldapresolver]" self.testbutton_id = "button_test_ldap" driver.find_element_by_id("button_new_resolver_type_ldap").click() if self.preset_ldap: driver.find_element_by_id("button_preset_ldap").click() else: driver.find_element_by_id("button_preset_ad").click() driver.find_element_by_id("ldap_resolvername").clear() driver.find_element_by_id("ldap_resolvername").send_keys(self.name) driver.find_element_by_id("ldap_uri").clear() driver.find_element_by_id("ldap_uri").send_keys(self.uri) if self.uri.startswith("ldaps"): driver.find_element_by_id("ldap_certificate").clear() driver.find_element_by_id("ldap_certificate").send_keys(self.certificate) driver.find_element_by_id("ldap_basedn").clear() driver.find_element_by_id("ldap_basedn").send_keys(self.basedn) ldap_binddn = driver.find_element_by_id("ldap_binddn") ldap_binddn.clear() ldap_binddn.send_keys(self.binddn) driver.find_element_by_id("ldap_password").clear() driver.find_element_by_id("ldap_password").send_keys(self.password) driver.find_element_by_id("button_ldap_resolver_save").click() time.sleep(1) driver.find_element_by_id("button_resolver_close").click()
def __init__(self, name, driver, base_url, server="", database="", user="", password="", table="", limit="", encoding=""): """""" UserIdResolver.__init__(self, name, driver, base_url) self.server = server self.database = database self.user = user self.password = password self.table = table self.limit = limit self.encoding = encoding self.name_for_list = self.name + " [sqlresolver]" self.testbutton_id = "button_test_sql" driver.find_element_by_id("button_new_resolver_type_sql").click() driver.find_element_by_id("sql_resolvername").clear() driver.find_element_by_id("sql_resolvername").send_keys(self.name) driver.find_element_by_id("sql_server").clear() driver.find_element_by_id("sql_server").send_keys(self.server) driver.find_element_by_id("sql_database").clear() driver.find_element_by_id("sql_database").send_keys(self.database) driver.find_element_by_id("sql_user").clear() driver.find_element_by_id("sql_user").send_keys(self.user) driver.find_element_by_id("sql_password").clear() driver.find_element_by_id("sql_password").send_keys(self.password) driver.find_element_by_id("sql_table").clear() driver.find_element_by_id("sql_table").send_keys(self.table) driver.find_element_by_id("sql_limit").clear() driver.find_element_by_id("sql_limit").send_keys(self.limit) driver.find_element_by_id("sql_encoding").send_keys(self.encoding) driver.find_element_by_id("button_resolver_sql_save").click() time.sleep(1) driver.find_element_by_id("button_resolver_close").click()
def __init__(self, name, driver, base_url, filename="/etc/passwd"): """""" UserIdResolver.__init__(self, name, driver, base_url) self.filename = filename self.name_for_list = self.name + " [passwdresolver]" driver.find_element_by_id("button_new_resolver_type_file").click() driver.find_element_by_id("file_resolvername").clear() driver.find_element_by_id("file_resolvername").send_keys(self.name) driver.find_element_by_id("file_filename").clear() driver.find_element_by_id("file_filename").send_keys(self.filename) driver.find_element_by_id("button_resolver_file_save").click() time.sleep(1) driver.find_element_by_id("button_resolver_close").click()