*/ include("session.php"); function get_ldap_parameters() { //Return a full array with all parameters in ldap_config or //return false if an error is occured $xmlconfig = @simplexml_load_file($_SESSION['config']['ldap_config_path']); if (!$xmlconfig) { return false; } else { $ldap_config = array(); foreach($xmlconfig->config as $CONFIG) { $ldap_config['type_ldap'] = utf8_decode((string) $CONFIG->type_ldap); $ldap_config['group_prefix_ldap'] = utf8_decode((string) $CONFIG->group_prefix_ldap); $ldap_config['domain'] = utf8_decode((string) $CONFIG->domain); $ldap_config['login_admin'] = utf8_decode((string) $CONFIG->login_admin); $ldap_config['pass'] = utf8_decode((string) $CONFIG->pass); $ldap_config['ssl'] = utf8_decode((string) $CONFIG->ssl); $ldap_config['purge_log'] = utf8_decode((string) $CONFIG->purge_log); $ldap_config['lost_users'] = utf8_decode((string) $CONFIG->lost_users); $ldap_config['pass_is_login'] = utf8_decode((string) $CONFIG->pass_is_login); } $ldap_config['exclude_user'] = array(); $ldap_config['exclude_group'] = array(); return $ldap_config; } } function show_ldap_parameters($ldap_param) { ?>
0 ) { $ssl = "true"; } else { $ssl = "false"; } if (count($_POST['lost_users']) > 0 ) { $lost_users = "true"; } else { $lost_users = "false"; } if (count($_POST['pass_is_login']) > 0 ) { $pass_is_login = "true"; } else { $pass_is_login = "false"; } foreach($xmlconfig->config as $CONFIG) { $CONFIG->type_ldap = utf8_encode($_POST['type_ldap']); $CONFIG->group_prefix_ldap = utf8_encode($_POST['group_prefix_ldap']); $CONFIG->domain = utf8_encode($_POST['domain']); $CONFIG->login_admin = utf8_encode($_POST['login_admin']); $CONFIG->pass = utf8_encode($_POST['pass']); $CONFIG->ssl = $ssl; $CONFIG->purge_log = utf8_encode($_POST['purge_log']); $CONFIG->lost_users = $lost_users; $CONFIG->pass_is_login = $pass_is_login; } $xml_reg = new SimpleXmlElement($xmlconfig -> asXML()); //Ouverture du fichier xml $fp = fopen($_SESSION['config']['ldap_config_path'],"wr+"); fputs($fp,$xml_reg -> asXML()); fclose($fp); echo ""._LDAP_CONFIG_UPDATED."
"; } } //-------------- if ($_POST['valid'] == "true") { create_new_xml_ldap($_POST); } ?>"._ERROR_WITH_LDAP."
"; } ?>