summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-04-27 14:55:56 +0000
committerErmal <eri@pfsense.org>2010-04-27 14:55:56 +0000
commit7a938f1b105c97c4d7e1668d2ddc8be2d3d24f36 (patch)
treebb2896af06e6a395357bb379aef0f8ab33b32ad8 /usr/local/www
parentb567f5893ce8c257229ee6612de088ce3fe654bb (diff)
downloadpfsense-7a938f1b105c97c4d7e1668d2ddc8be2d3d24f36.zip
pfsense-7a938f1b105c97c4d7e1668d2ddc8be2d3d24f36.tar.gz
Ticket #389. Correctly make the ldap object picker work and handle various errors.
Diffstat (limited to 'usr/local/www')
-rw-r--r--usr/local/www/system_authservers.php15
-rw-r--r--usr/local/www/system_usermanager_settings_ldapacpicker.php63
2 files changed, 48 insertions, 30 deletions
diff --git a/usr/local/www/system_authservers.php b/usr/local/www/system_authservers.php
index a91e30f..ca47289 100644
--- a/usr/local/www/system_authservers.php
+++ b/usr/local/www/system_authservers.php
@@ -345,6 +345,21 @@ function radius_srvcschange(){
}
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 == '') {
+ alert("Please fill the required values.");
+ return;
+ }
+ if (!document.getElementById("ldap_anon").checked) {
+ if (document.getElementById("ldap_binddn").value == '' ||
+ document.getElementById("ldap_bindpw").value == '') {
+ alert("Please fill the bind username/password.");
+ return;
+ }
+ }
var url = 'system_usermanager_settings_ldapacpicker.php?';
url += 'port=' + document.getElementById("ldap_port").value;
url += '&host=' + document.getElementById("ldap_host").value;
diff --git a/usr/local/www/system_usermanager_settings_ldapacpicker.php b/usr/local/www/system_usermanager_settings_ldapacpicker.php
index 6a3d186..40212b1 100644
--- a/usr/local/www/system_usermanager_settings_ldapacpicker.php
+++ b/usr/local/www/system_usermanager_settings_ldapacpicker.php
@@ -33,7 +33,9 @@
require("guiconfig.inc");
require_once("auth.inc");
+
$ous = array();
+
if($_GET) {
$authcfg = array();
$authcfg['ldap_port'] = $_GET['port'];
@@ -47,7 +49,29 @@ if($_GET) {
$authcfg['ldap_authcn'] = explode(";", $_GET['authcn']);
$ous = ldap_get_user_ous(true, $authcfg);
}
+
?>
+<html>
+ <head>
+ <STYLE type="text/css">
+ TABLE {
+ border-width: 1px 1px 1px 1px;
+ border-spacing: 0px;
+ border-style: solid solid solid solid;
+ border-color: gray gray gray gray;
+ border-collapse: separate;
+ background-color: collapse;
+ }
+ TD {
+ border-width: 0px 0px 0px 0px;
+ border-spacing: 0px;
+ border-style: solid solid solid solid;
+ border-color: gray gray gray gray;
+ border-collapse: collapse;
+ background-color: white;
+ }
+ </STYLE>
+ </head>
<script language="JavaScript">
function post_choices() {
@@ -61,34 +85,17 @@ function post_choices() {
opener.document.forms[0].ldapauthcontainers.value+=document.forms[0].ou[i].value;
}
}
- //this.close();
+ window.close();
-->
}
</script>
-<html>
- <head>
- <STYLE type="text/css">
- TABLE {
- border-width: 1px 1px 1px 1px;
- border-spacing: 0px;
- border-style: solid solid solid solid;
- border-color: gray gray gray gray;
- border-collapse: separate;
- background-color: collapse;
- }
- TD {
- border-width: 0px 0px 0px 0px;
- border-spacing: 0px;
- border-style: solid solid solid solid;
- border-color: gray gray gray gray;
- border-collapse: collapse;
- background-color: white;
- }
- </STYLE>
- </head>
<body link="#000000" vlink="#000000" alink="#000000" >
<form method="post" action="system_usermanager_settings_ldapacpicker.php">
+<?php if (empty($ous)): ?>
+ <p>Sorry, we could not connect to the LDAP server. Please try later.</p>
+ <input type='button' value='Close' onClick="window.close();">
+<?php else: ?>
<b>Please select which containers to Authenticate against:</b>
<p/>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
@@ -96,11 +103,7 @@ function post_choices() {
<td class="tabnavtbl">
<table width="100%">
<?php
- if(!is_array($ous)) {
- echo "Sorry, we could not connect to the LDAP server. Please try later.";
- //exit;
- }
- else if(is_array($ous)) {
+ if(is_array($ous)) {
foreach($ous as $ou) {
if(in_array($ou, $authcfg['ldap_authcn']))
$CHECKED=" CHECKED";
@@ -109,7 +112,7 @@ function post_choices() {
echo " <tr><td><input type='checkbox' value='{$ou}' id='ou' name='ou[]'{$CHECKED}> {$ou}<br/></td></tr>\n";
}
}
-?>
+?>
</table>
</td>
</tr>
@@ -118,7 +121,7 @@ function post_choices() {
<p/>
<input type='button' value='Save' onClick="post_choices();">
-
+<?php endif; ?>
+ </form>
</body>
</html>
-
OpenPOWER on IntegriCloud