diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-09-03 13:56:33 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-09-03 13:56:33 -0400 |
commit | 7b4b0ad38eb0e3f00c7b1c8f9939a6c53d4d2df2 (patch) | |
tree | cd2be5863bbce43a85db8e4278aaf40bf4b66576 /src/usr/local/www/system_authservers.php | |
parent | 4392e82299d6fbd28e468d431ed3578c6fcface9 (diff) | |
download | pfsense-7b4b0ad38eb0e3f00c7b1c8f9939a6c53d4d2df2.zip pfsense-7b4b0ad38eb0e3f00c7b1c8f9939a6c53d4d2df2.tar.gz |
Fixed #5088
Functionality was not present in 2.2. Added $pconfig = $_POST to restore form contents on validation failure
Diffstat (limited to 'src/usr/local/www/system_authservers.php')
-rw-r--r-- | src/usr/local/www/system_authservers.php | 72 |
1 files changed, 38 insertions, 34 deletions
diff --git a/src/usr/local/www/system_authservers.php b/src/usr/local/www/system_authservers.php index 4b6f7b9..137d497 100644 --- a/src/usr/local/www/system_authservers.php +++ b/src/usr/local/www/system_authservers.php @@ -197,6 +197,7 @@ if ($_POST) { "name type ldap_host ldap_port " . "ldap_urltype ldap_protver ldap_scope " . "ldap_attr_user ldap_attr_group ldap_attr_member ldapauthcontainers"); + $reqdfieldsn = array( gettext("Descriptive name"), gettext("Type"), @@ -352,13 +353,16 @@ if ($_POST) { pfSenseHeader("system_authservers.php"); } + else { + $pconfig = $_POST; // Restore the form contents so the user doesn't have to re-eneter it + } } include("head.inc"); if ($input_errors) print_input_errors($input_errors); - + if ($savemsg) print_info_box($savemsg, 'success'); @@ -699,17 +703,17 @@ print $form; events.push(function(){ function select_clicked() { if (document.getElementById("ldap_port").value == '' || - document.getElementById("ldap_host").value == '' || - document.getElementById("ldap_scope").value == '' || - document.getElementById("ldap_basedn").value == '' || - document.getElementById("ldapauthcontainers").value == '') { + document.getElementById("ldap_host").value == '' || + document.getElementById("ldap_scope").value == '' || + document.getElementById("ldap_basedn").value == '' || + document.getElementById("ldapauthcontainers").value == '') { alert("<?=gettext("Please fill the required values.");?>"); return; } - + if (!document.getElementById("ldap_anon").checked) { if (document.getElementById("ldap_binddn").value == '' || - document.getElementById("ldap_bindpw").value == '') { + document.getElementById("ldap_bindpw").value == '') { alert("<?=gettext("Please fill the bind username/password.");?>"); return; } @@ -729,28 +733,28 @@ events.push(function(){ <?php else: ?> url += '&cert='; <?php endif; ?> - + var oWin = window.open(url, "pfSensePop", "width=620,height=400,top=150,left=150"); if (oWin == null || typeof(oWin) == "undefined") { - alert("<?=gettext('Popup blocker detected. Action aborted.');?>"); + alert("<?=gettext('Popup blocker detected. Action aborted.');?>"); } } - + function set_ldap_port() { - if($('#ldap_urltype').find(":selected").index() == 0) + if($('#ldap_urltype').find(":selected").index() == 0) $('#ldap_port').val('389'); else - $('#ldap_port').val('636'); + $('#ldap_port').val('636'); + } + + // Hides all elements of the specified class. This will usually be a section + function hideClass(s_class, hide) { + if(hide) + $('.' + s_class).hide(); + else + $('.' + s_class).show(); } - - // Hides all elements of the specified class. This will usually be a section - function hideClass(s_class, hide) { - if(hide) - $('.' + s_class).hide(); - else - $('.' + s_class).show(); - } - + function ldap_tmplchange() { switch ($('#ldap_tmpltype').find(":selected").index()) { <?php @@ -774,7 +778,7 @@ events.push(function(){ hideClass('ldapanon', $('#ldap_anon').prop('checked')); $("#Select").prop('type','button'); - + if($('#ldap_port').val() == "") set_ldap_port(); @@ -782,12 +786,12 @@ events.push(function(){ if($act == 'edit') { ?> $('#type option:not(:selected)').each(function(){ - $(this).attr('disabled', 'disabled'); + $(this).attr('disabled', 'disabled'); }); - + <?php if(!$input_errors) { -?> +?> $('#name').prop("readonly", true); <?php } @@ -798,17 +802,17 @@ events.push(function(){ ldap_tmplchange(); }); - $('#ldap_anon').click(function () { - hideClass('ldapanon', this.checked); - }); - + $('#ldap_anon').click(function () { + hideClass('ldapanon', this.checked); + }); + $('#ldap_urltype').on('change', function() { set_ldap_port(); - }); - - $('#Select').click(function () { - select_clicked(); - }); + }); + + $('#Select').click(function () { + select_clicked(); + }); }); //]]> </script> |