diff options
author | Simon Rettberg | 2015-11-10 11:04:15 +0100 |
---|---|---|
committer | Simon Rettberg | 2015-11-10 11:04:15 +0100 |
commit | b65db7eb93773a828bb5be76799b46cdaab56dc1 (patch) | |
tree | d53cfd8cfc220ae07a91803b6f353f1b25b432a5 /templates | |
parent | [news.inc.php] fix newline not beeing escaped properly (diff) | |
download | slx-admin-b65db7eb93773a828bb5be76799b46cdaab56dc1.tar.gz slx-admin-b65db7eb93773a828bb5be76799b46cdaab56dc1.tar.xz slx-admin-b65db7eb93773a828bb5be76799b46cdaab56dc1.zip |
[adauth] Add intermediate step to determine binddn if windows style domain is given
Diffstat (limited to 'templates')
-rw-r--r-- | templates/sysconfig/ad-selfsearch.html | 79 | ||||
-rw-r--r-- | templates/sysconfig/ad_ldap-checkconnection.html | 2 | ||||
-rw-r--r-- | templates/sysconfig/ad_ldap-checkcredentials.html | 13 |
3 files changed, 81 insertions, 13 deletions
diff --git a/templates/sysconfig/ad-selfsearch.html b/templates/sysconfig/ad-selfsearch.html new file mode 100644 index 00000000..f77bd5fb --- /dev/null +++ b/templates/sysconfig/ad-selfsearch.html @@ -0,0 +1,79 @@ +<p> + {{lang_dnLookup}} +</p> + +<div id="zeug"> + <div data-tm-id="{{self-search}}" data-tm-log="messages" data-tm-callback="selfCb">LDAP Self-Query</div> + <pre style="display:none" id="result"></pre> +</div> +<i>{{lang_onProblemSearchBase}}</i> +<br><br> +<div class="pull-left"> + <form role="form" method="post" action="?do=SysConfig&action=addmodule&step={{prev}}"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="edit" value="{{edit}}"> + <input name="title" value="{{title}}" type="hidden"> + <input name="server" value="{{server}}" type="hidden"> + <input name="searchbase" value="{{searchbase}}" type="hidden"> + <input name="binddn" value="{{binddn}}" type="hidden"> + <input name="bindpw" value="{{bindpw}}" type="hidden"> + <input name="home" value="{{home}}" type="hidden"> + {{#ssl}} + <input name="ssl" value="on" type="hidden"> + <input type="hidden" name="certificate" value="{{certificate}}"> + {{/ssl}} + <button type="submit" class="btn btn-primary">« {{lang_back}}</button> + </form> +</div> +<div class="pull-right"> + <form id="nextform" role="form" method="post" action="?do=SysConfig&action=addmodule&step={{next}}"> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="edit" value="{{edit}}"> + <input name="title" value="{{title}}" type="hidden"> + <input name="server" value="{{server}}" type="hidden"> + <input name="port" value="{{port}}" type="hidden"> + <input id="searchbase" name="searchbase" value="{{searchbase}}" type="hidden"> + <input id="fulldn" name="binddn" value="" type="hidden"> + <input id="givendn" name="originalbinddn" value="{{binddn}}" type="hidden"> + <input name="bindpw" value="{{bindpw}}" type="hidden"> + <input name="home" value="{{home}}" type="hidden"> + {{#ssl}} + <input name="ssl" value="on" type="hidden"> + <input type="hidden" name="certificate" value="{{certificate}}"> + {{/ssl}} + <input name="fingerprint" value="{{fingerprint}}" type="hidden"> + <input name="originalbinddn" value="{{binddn}}" type="hidden"> + <button id="nextbutton" type="submit" class="btn btn-primary" style="display:none">{{lang_skip}} »</button> + </form> +</div> +<script type="text/javascript"> + function selfCb(task) + { + if (!task || !task.statusCode || task.statusCode === 'TASK_WAITING' || task.statusCode === 'TASK_PROCESSING') + return; + if (task.statusCode === 'TASK_FINISHED' && task.data && task.data.dn) { + var fulldn = task.data.dn; + var domain = "-"; + var search = $('#searchbase').val(); + if ($('#searchbase').val().length < 2) { + domain = $('#givendn').val().replace(/[\/\\]\S+$/i, ''); + var idx = fulldn.search(new RegExp('\\w+=' + domain + ',', "i")); + console.log(idx); + if (idx !== -1) { + search = fulldn.substring(idx); + } + $('#searchbase').val(search); + } + $('#fulldn').val(fulldn); + $('#result').text("BindDN: " + fulldn + "\nWinDomain: " + domain + "\nSearchBase: " + search).show(); + if (typeof search !== 'string' || search.length === 0 || search.length + 2 >= fulldn.length) { + $('#nextbutton').html('{{lang_continueAnyway}}'); + } else { + $('#nextform').submit(); + } + } else { + $('#nextbutton').html('{{lang_continueAnyway}}'); + } + $('#nextbutton').show(); + } +</script> diff --git a/templates/sysconfig/ad_ldap-checkconnection.html b/templates/sysconfig/ad_ldap-checkconnection.html index 58196958..788978f2 100644 --- a/templates/sysconfig/ad_ldap-checkconnection.html +++ b/templates/sysconfig/ad_ldap-checkconnection.html @@ -60,7 +60,7 @@ var ssl = $('#ssl').length > 0; var ports = task.data.ports; var verRes = -1; - var cert = $('#certificate').val().length > 10; + var cert = ssl && $('#certificate').val().length > 10; for (var i = 0; i < ports.length; ++i) { if (!ports[i].open || !ports[i].port) continue; if ($.isNumeric($('#port').val()) && $('#port').val() < ports[i].port) continue; // Prefer the global LDAP ports over the specific AD ports diff --git a/templates/sysconfig/ad_ldap-checkcredentials.html b/templates/sysconfig/ad_ldap-checkcredentials.html index 5a9d6b38..9f5ccf01 100644 --- a/templates/sysconfig/ad_ldap-checkcredentials.html +++ b/templates/sysconfig/ad_ldap-checkcredentials.html @@ -3,7 +3,6 @@ </p> <div id="zeug"> - {{#self-search}}<div data-tm-id="{{self-search}}" data-tm-log="messages" data-tm-callback="selfCb">LDAP Self-Query</div>{{/self-search}} <div data-tm-id="{{tm-search}}" data-tm-log="messages" data-tm-callback="ldapCb">LDAP Test-Query</div> </div> <i>{{lang_onProblemSearchBase}}</i> @@ -33,7 +32,7 @@ <input name="server" value="{{server}}" type="hidden"> <input name="searchbase" value="{{searchbase}}" type="hidden"> <input id="setbase" name="somedn" value="" type="hidden"> - <input id="setdn" name="binddn" value="{{binddn}}" type="hidden"> + <input name="binddn" value="{{binddn}}" type="hidden"> <input name="bindpw" value="{{bindpw}}" type="hidden"> <input name="home" value="{{home}}" type="hidden"> {{#ssl}} @@ -63,14 +62,4 @@ $('#nextbutton').show(); } } - function selfCb(task) - { - if (!task || !task.statusCode) - return; - if (task.statusCode === 'TASK_FINISHED' && task.data && task.data.dn) { - $('#setdn').val(task.data.dn); - } else { - $('#nextbutton').html('Trotzdem weiter »'); - } - } </script> |