summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2013-11-11 15:16:54 +0100
committerArthur Schiwon <blizzz@owncloud.com>2013-11-11 15:16:54 +0100
commitda61c6ef72abd54d98e9b1aa4300dba6a0eff3f0 (patch)
treeed73bb12812830ee08dd403fd4a6d5555bf32402
parentea9f392f4e571bac223f0e8b0c5ee122b16ac76a (diff)
downloadnextcloud-server-da61c6ef72abd54d98e9b1aa4300dba6a0eff3f0.tar.gz
nextcloud-server-da61c6ef72abd54d98e9b1aa4300dba6a0eff3f0.zip
LDAP Wizard: determine port without credentials. don't hide the port input field
-rw-r--r--apps/user_ldap/js/settings.js19
-rw-r--r--apps/user_ldap/lib/wizard.php4
-rw-r--r--apps/user_ldap/templates/part.wizard-server.php2
3 files changed, 12 insertions, 13 deletions
diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js
index 721674ee8e4..6496c6aee59 100644
--- a/apps/user_ldap/js/settings.js
+++ b/apps/user_ldap/js/settings.js
@@ -202,7 +202,7 @@ var LdapWizard = {
},
function (result) {
LdapWizard.hideSpinner('#ldap_base');
- LdapWizard.showInfoBox('Please specify a port');
+ LdapWizard.showInfoBox('Please specify a Base DN');
}
);
}
@@ -210,28 +210,28 @@ var LdapWizard = {
checkPort: function() {
host = $('#ldap_host').val();
- user = $('#ldap_dn').val();
- pass = $('#ldap_agent_password').val();
+ port = $('#ldap_port').val();
- if(host && user && pass) {
+ if(host && !port) {
param = 'action=guessPortAndTLS'+
'&ldap_serverconfig_chooser='+$('#ldap_serverconfig_chooser').val();
LdapWizard.showSpinner('#ldap_port');
+ $('#ldap_port').prop('disabled', 'disabled');
LdapWizard.ajax(param,
function(result) {
LdapWizard.applyChanges(result);
LdapWizard.hideSpinner('#ldap_port');
if($('#ldap_port').val()) {
LdapWizard.checkBaseDN();
- $('#ldap_port').removeClass('invisible');
+ $('#ldap_port').prop('disabled', false);
LdapWizard.hideInfoBox();
}
},
function (result) {
LdapWizard.hideSpinner('#ldap_port');
- $('#ldap_port').removeClass('invisible');
- LdapWizard.showInfoBox('Please specify the BaseDN');
+ $('#ldap_port').prop('disabled', false);
+ LdapWizard.showInfoBox('Please specify the Port');
}
);
}
@@ -459,9 +459,6 @@ var LdapWizard = {
},
init: function() {
- if($('#ldap_port').val()) {
- $('#ldap_port').removeClass('invisible');
- }
LdapWizard.basicStatusCheck();
},
@@ -516,6 +513,8 @@ var LdapWizard = {
},
processChanges: function(triggerObj) {
+ LdapWizard.hideInfoBox();
+
if(triggerObj.id == 'ldap_host'
|| triggerObj.id == 'ldap_port'
|| triggerObj.id == 'ldap_dn'
diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/wizard.php
index 7e8ea0696a7..0b2a6a540ff 100644
--- a/apps/user_ldap/lib/wizard.php
+++ b/apps/user_ldap/lib/wizard.php
@@ -995,9 +995,9 @@ class Wizard extends LDAPUtility {
//In case the port is already provided, we will check this first
if($port > 0) {
$hostInfo = parse_url($host);
- if(is_array($hostInfo)
+ if(!(is_array($hostInfo)
&& isset($hostInfo['scheme'])
- && stripos($hostInfo['scheme'], 'ldaps') === false) {
+ && stripos($hostInfo['scheme'], 'ldaps') !== false)) {
$portSettings[] = array('port' => $port, 'tls' => true);
}
$portSettings[] =array('port' => $port, 'tls' => false);
diff --git a/apps/user_ldap/templates/part.wizard-server.php b/apps/user_ldap/templates/part.wizard-server.php
index 82ee9b2b23a..fde7c36cdd1 100644
--- a/apps/user_ldap/templates/part.wizard-server.php
+++ b/apps/user_ldap/templates/part.wizard-server.php
@@ -32,7 +32,7 @@
/>
<span>
<input type="number" id="ldap_port" name="ldap_port"
- class="invisible lwautosave"
+ class="lwautosave"
placeholder="<?php p($l->t('Port'));?>" />
</span>
</div>