diff --git a/server/www/teleport/static/js/user/user-list.js b/server/www/teleport/static/js/user/user-list.js index 50b6b87..f08cae4 100755 --- a/server/www/teleport/static/js/user/user-list.js +++ b/server/www/teleport/static/js/user/user-list.js @@ -1392,11 +1392,11 @@ $app.create_dlg_ldap_config = function () { // $tp.notify_error('请填写LDAP的用户属性与teleport用户属性的映射关系!'); // return false; // } - if (tp_is_empty_str(dlg.ldap_config.attr_username)) { - dlg.dom.attr_username.focus(); - $tp.notify_error('请填写映射为teleport登录账号的LDAP用户属性!'); - return false; - } + // if (tp_is_empty_str(dlg.ldap_config.attr_username)) { + // dlg.dom.attr_username.focus(); + // $tp.notify_error('请填写映射为teleport登录账号的LDAP用户属性!'); + // return false; + // } return true; }; @@ -1429,6 +1429,11 @@ $app.create_dlg_ldap_config = function () { dlg.do_test = function () { if (!dlg.check_fields()) return; + if (tp_is_empty_str(dlg.ldap_config.attr_username)) { + dlg.dom.attr_username.focus(); + $tp.notify_error('请填写映射为teleport登录账号的LDAP用户属性!'); + return false; + } dlg.dom.btn_test.attr('disabled', 'disabled'); $tp.ajax_post_json('/system/do-ldap-config-test', { ldap: dlg.ldap_config @@ -1532,29 +1537,26 @@ $app.create_dlg_ldap_test_result = function () { dlg.dom.table.empty(); var h = []; - var dn, x; - var th_created = false; - for (dn in data) { - if (!th_created) { - h.push(''); - for (x in data[dn]) { - h.push(''); - h.push(x); - h.push(''); - } - h.push(''); - th_created = true; - } + h.push(''); + h.push('登录名'); + h.push('姓名'); + h.push('邮箱'); + h.push(''); + var _mktd = function(h, d) { + if((!_.isUndefined(d)) && !_.isEmpty(d)) + h.push(''+d+''); + else + h.push(''); + }; + + var dn; + for (dn in data) { h.push(''); - for (x in data[dn]) { - h.push(''); - if (!_.isEmpty(data[dn][x])) - h.push(data[dn][x]); - else - h.push(''); - h.push(''); - } + console.log(data[dn]); + _mktd(h, data[dn]['username']); + _mktd(h, data[dn]['surname']); + _mktd(h, data[dn]['email']); h.push(''); } diff --git a/server/www/teleport/view/user/user-list.mako b/server/www/teleport/view/user/user-list.mako index dab83ca..1051b11 100644 --- a/server/www/teleport/view/user/user-list.mako +++ b/server/www/teleport/view/user/user-list.mako @@ -644,7 +644,7 @@ - - ##
- ##
- ## LDAP用户列表: - ##
- ## - ##
- ## - ##
- ## - ##
- ## - ##
- ## - ##
-