summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/js
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2015-05-07 21:09:10 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-05-18 18:14:05 +0200
commitb9e53097577499b519f9fcdd053421cb1507bab3 (patch)
tree993d979ffb581936309934c2a2d068f61c1ebdb2 /apps/user_ldap/js
parentb085f5855362bb8c305083c1d60ebfd459323a96 (diff)
downloadnextcloud-server-b9e53097577499b519f9fcdd053421cb1507bab3.tar.gz
nextcloud-server-b9e53097577499b519f9fcdd053421cb1507bab3.zip
catch unallowed anonymous auth attempt and show specific error
Diffstat (limited to 'apps/user_ldap/js')
-rw-r--r--apps/user_ldap/js/wizard/wizardTabElementary.js9
-rw-r--r--apps/user_ldap/js/wizard/wizardTabGeneric.js5
-rw-r--r--apps/user_ldap/js/wizard/wizardTabUserFilter.js6
3 files changed, 19 insertions, 1 deletions
diff --git a/apps/user_ldap/js/wizard/wizardTabElementary.js b/apps/user_ldap/js/wizard/wizardTabElementary.js
index b8ab367dfd1..75664275a9c 100644
--- a/apps/user_ldap/js/wizard/wizardTabElementary.js
+++ b/apps/user_ldap/js/wizard/wizardTabElementary.js
@@ -165,6 +165,12 @@ OCA = OCA || {};
* @inheritdoc
*/
overrideErrorMessage: function(message, key) {
+ var original = message;
+ message = this._super(message, key);
+ if(original !== message) {
+ // we pass the parents change
+ return message;
+ }
switch(key) {
case 'ldap_port':
if (message === 'Invalid credentials') {
@@ -267,7 +273,8 @@ OCA = OCA || {};
message = t('user_ldap', objectsFound + ' entries available within the provided Base DN');
}
} else {
- message = t('user_ldap', 'An error occurred. Please check the Base DN, as well as connection settings and credentials.');
+ message = view.overrideErrorMessage(payload.data.message);
+ message = message || t('user_ldap', 'An error occurred. Please check the Base DN, as well as connection settings and credentials.');
if(payload.data.message) {
console.warn(payload.data.message);
}
diff --git a/apps/user_ldap/js/wizard/wizardTabGeneric.js b/apps/user_ldap/js/wizard/wizardTabGeneric.js
index 720628fa609..c272df7e3cc 100644
--- a/apps/user_ldap/js/wizard/wizardTabGeneric.js
+++ b/apps/user_ldap/js/wizard/wizardTabGeneric.js
@@ -70,6 +70,11 @@ OCA = OCA || {};
* @returns {string}
*/
overrideErrorMessage: function(message, key) {
+ if(message === 'LDAP authentication method rejected'
+ && !this.configModel.configuration.ldap_dn)
+ {
+ message = t('user_ldap', 'Anonymous bind is not allowed. Please provide a User DN and Password.');
+ }
return message;
},
diff --git a/apps/user_ldap/js/wizard/wizardTabUserFilter.js b/apps/user_ldap/js/wizard/wizardTabUserFilter.js
index 992c1ccf379..4fe223ee075 100644
--- a/apps/user_ldap/js/wizard/wizardTabUserFilter.js
+++ b/apps/user_ldap/js/wizard/wizardTabUserFilter.js
@@ -122,6 +122,12 @@ OCA = OCA || {};
* @inheritdoc
*/
overrideErrorMessage: function(message, key) {
+ var original = message;
+ message = this._super(message, key);
+ if(original !== message) {
+ // we pass the parents change
+ return message;
+ }
if( key === 'ldap_userfilter_groups'
&& message === 'memberOf is not supported by the server'
) {