summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2013-10-17 18:33:58 +0200
committerArthur Schiwon <blizzz@owncloud.com>2013-10-17 19:13:29 +0200
commit6b160d8507806f38eaeed2daea2f30621fb000b4 (patch)
treec00c1f5934bb73188a8d09daf62078e9fc51fdf4 /apps/user_ldap
parent63e9c56d48b257fd155de9fa6a978d2bfadffc1f (diff)
downloadnextcloud-server-6b160d8507806f38eaeed2daea2f30621fb000b4.tar.gz
nextcloud-server-6b160d8507806f38eaeed2daea2f30621fb000b4.zip
LDAP Wizard: make Back and Continue work
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/js/settings.js58
-rw-r--r--apps/user_ldap/templates/part.wizardcontrols.php5
2 files changed, 61 insertions, 2 deletions
diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js
index 0ccf7ecf425..7ce1014a85d 100644
--- a/apps/user_ldap/js/settings.js
+++ b/apps/user_ldap/js/settings.js
@@ -159,6 +159,22 @@ var LdapWizard = {
LdapWizard.functionalityCheck();
},
+ basicStatusCheck: function() {
+ //criterias to continue from the first tab
+ // - host, port, user filter, agent dn, password, base dn
+ host = $('#ldap_host').val();
+ port = $('#ldap_port').val();
+ agent = $('#ldap_dn').val();
+ pwd = $('#ldap_agent_password').val();
+ base = $('#ldap_base').val();
+
+ if(host && port && agent && pwd && base) {
+ $('.ldap_action_continue').removeAttr('disabled');
+ } else {
+ $('.ldap_action_continue').attr('disabled', 'disabled');
+ }
+ },
+
checkBaseDN: function() {
host = $('#ldap_host').val();
port = $('#ldap_port').val();
@@ -245,6 +261,35 @@ var LdapWizard = {
);
},
+ controlBack: function() {
+ curTabIndex = $('#ldapSettings').tabs('option', 'active');
+ if(curTabIndex == 0) {
+ return;
+ }
+ if(curTabIndex == 1) {
+ $('.ldap_action_back').addClass('invisible');
+ }
+ $('#ldapSettings').tabs('option', 'active', curTabIndex - 1);
+ if(curTabIndex == 3) {
+ $('.ldap_action_continue').removeClass('invisible');
+ }
+ },
+
+ controlContinue: function() {
+ curTabIndex = $('#ldapSettings').tabs('option', 'active');
+ if(curTabIndex == 3) {
+ return;
+ }
+ $('#ldapSettings').tabs('option', 'active', 1 + curTabIndex);
+ if(curTabIndex == 2) {
+ //now last tab
+ $('.ldap_action_continue').addClass('invisible');
+ }
+ if(curTabIndex == 0) {
+ $('.ldap_action_back').removeClass('invisible');
+ }
+ },
+
_countThings: function(method) {
param = 'action='+method+
'&ldap_serverconfig_chooser='+$('#ldap_serverconfig_chooser').val();
@@ -404,6 +449,7 @@ var LdapWizard = {
if($('#ldap_port').val()) {
$('#ldap_port').removeClass('invisible');
}
+ LdapWizard.basicStatusCheck();
},
initGroupFilter: function() {
@@ -470,6 +516,10 @@ var LdapWizard = {
|| triggerObj.id == 'ldap_loginfilter_email') {
LdapWizard.composeFilter('login');
}
+
+ if($('#ldapSettings').tabs('option', 'active') == 0) {
+ LdapWizard.basicStatusCheck();
+ }
},
save: function(inputObj) {
@@ -595,6 +645,14 @@ $(document).ready(function() {
$('#toggleRawUserFilter').click(LdapWizard.toggleRawUserFilter);
$('#toggleRawGroupFilter').click(LdapWizard.toggleRawGroupFilter);
LdapConfiguration.refreshConfig();
+ $('.ldap_action_continue').click(function(event) {
+ event.preventDefault();
+ LdapWizard.controlContinue();
+ });
+ $('.ldap_action_back').click(function(event) {
+ event.preventDefault();
+ LdapWizard.controlBack();
+ });
$('#ldap_action_test_connection').click(function(event){
event.preventDefault();
$.post(
diff --git a/apps/user_ldap/templates/part.wizardcontrols.php b/apps/user_ldap/templates/part.wizardcontrols.php
index 4d05586bdfb..db99145d514 100644
--- a/apps/user_ldap/templates/part.wizardcontrols.php
+++ b/apps/user_ldap/templates/part.wizardcontrols.php
@@ -1,8 +1,9 @@
<div class="ldapWizardControls">
- <button id="ldap_action_back" name="ldap_action_back" class="invisible">
+ <button class="ldap_action_back invisible" name="ldap_action_back"
+ type="button">
<?php p($l->t('Back'));?>
</button>
- <button id="ldap_action_continue" name="ldap_action_continue">
+ <button class="ldap_action_continue" name="ldap_action_continue" type="button">
<?php p($l->t('Continue'));?>
</button>
<a href="<?php p($theme->getDocBaseUrl()); ?>/server/5.0/admin_manual/auth_ldap.html"