summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/js/wizard/view.js
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2015-05-13 16:21:50 +0200
committerArthur Schiwon <blizzz@owncloud.com>2015-05-13 16:21:50 +0200
commit2bf92e0a43c6acdf863cb0092d3d3fb738a23080 (patch)
tree89e5d30ef75d2974027e37498f1a97d43d50be23 /apps/user_ldap/js/wizard/view.js
parent5941e826b8e6005de08fdcb777efb3def5ca8101 (diff)
downloadnextcloud-server-2bf92e0a43c6acdf863cb0092d3d3fb738a23080.tar.gz
nextcloud-server-2bf92e0a43c6acdf863cb0092d3d3fb738a23080.zip
include base dn test in functionality test
Diffstat (limited to 'apps/user_ldap/js/wizard/view.js')
-rw-r--r--apps/user_ldap/js/wizard/view.js23
1 files changed, 22 insertions, 1 deletions
diff --git a/apps/user_ldap/js/wizard/view.js b/apps/user_ldap/js/wizard/view.js
index 7743c277d61..7dedfab75f0 100644
--- a/apps/user_ldap/js/wizard/view.js
+++ b/apps/user_ldap/js/wizard/view.js
@@ -168,6 +168,26 @@ OCA = OCA || {};
},
/**
+ * Base DN test results will arrive here
+ *
+ * @param {WizardTabElementary} view
+ * @param {FeaturePayload} payload
+ */
+ onDetectionTestCompleted: function(view, payload) {
+ if(payload.feature === 'TestBaseDN') {
+ if(payload.data.status === 'success') {
+ var objectsFound = parseInt(payload.data.changes.ldap_test_base, 10);
+ if(objectsFound > 0) {
+ view._updateStatusIndicator(view.STATUS_SUCCESS);
+ return;
+ }
+ }
+ view._updateStatusIndicator(view.STATUS_ERROR);
+ OC.Notification.showTemporary(t('user_ldap', 'The Base DN appears to be wrong'));
+ }
+ },
+
+ /**
* updates the status indicator based on the configuration test result
*
* @param {WizardView} [view]
@@ -176,7 +196,7 @@ OCA = OCA || {};
*/
onTestCompleted: function(view, result) {
if(result.isSuccess) {
- view._updateStatusIndicator(view.STATUS_SUCCESS);
+ view.configModel.requestWizard('ldap_test_base');
} else {
view._updateStatusIndicator(view.STATUS_ERROR);
}
@@ -272,6 +292,7 @@ OCA = OCA || {};
this.configModel.on('setRequested', this.onSetRequested, this);
this.configModel.on('setCompleted', this.onSetRequestDone, this);
this.configModel.on('configurationTested', this.onTestCompleted, this);
+ this.configModel.on('receivedLdapFeature', this.onDetectionTestCompleted, this);
},
/**