summaryrefslogtreecommitdiffstats
path: root/templates/sysconfig
diff options
context:
space:
mode:
authorSimon Rettberg2016-02-18 17:56:58 +0100
committerSimon Rettberg2016-02-18 17:56:58 +0100
commit4ea13ba83c760f6c2baff4d25c54f08fdb4a82ec (patch)
tree46c375a139bce3475adf2db4b85ca310f66a8334 /templates/sysconfig
parent[statistics] Smart values, show last log lines, location support (diff)
downloadslx-admin-4ea13ba83c760f6c2baff4d25c54f08fdb4a82ec.tar.gz
slx-admin-4ea13ba83c760f6c2baff4d25c54f08fdb4a82ec.tar.xz
slx-admin-4ea13ba83c760f6c2baff4d25c54f08fdb4a82ec.zip
[adauth] Add field for homeDirectory attribute
Diffstat (limited to 'templates/sysconfig')
-rw-r--r--templates/sysconfig/ad-selfsearch.html39
-rw-r--r--templates/sysconfig/ad-start.html21
-rw-r--r--templates/sysconfig/ad_ldap-checkconnection.html2
-rw-r--r--templates/sysconfig/ad_ldap-checkcredentials.html2
4 files changed, 61 insertions, 3 deletions
diff --git a/templates/sysconfig/ad-selfsearch.html b/templates/sysconfig/ad-selfsearch.html
index f77bd5fb..76952dc3 100644
--- a/templates/sysconfig/ad-selfsearch.html
+++ b/templates/sysconfig/ad-selfsearch.html
@@ -5,6 +5,10 @@
<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 style="display:none" id="haselect">
+ <div class="slx-bold">{{lang_selectHomeAttribute}}</div>
+ {{lang_homeAttributeExplanation}}
+ </div>
</div>
<i>{{lang_onProblemSearchBase}}</i>
<br><br>
@@ -18,6 +22,7 @@
<input name="binddn" value="{{binddn}}" type="hidden">
<input name="bindpw" value="{{bindpw}}" type="hidden">
<input name="home" value="{{home}}" type="hidden">
+ <input name="homeattr" value="{{homeattr}}" type="hidden">
{{#ssl}}
<input name="ssl" value="on" type="hidden">
<input type="hidden" name="certificate" value="{{certificate}}">
@@ -36,13 +41,13 @@
<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">
+ <input id="home" name="home" value="{{home}}" type="hidden">
+ <input id="homeattr" name="homeattr" value="{{homeattr}}" 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}} &raquo;</button>
</form>
</div>
@@ -66,9 +71,33 @@
}
$('#fulldn').val(fulldn);
$('#result').text("BindDN: " + fulldn + "\nWinDomain: " + domain + "\nSearchBase: " + search).show();
- if (typeof search !== 'string' || search.length === 0 || search.length + 2 >= fulldn.length) {
+ var attrlist = [];
+ var tryHomeAttr = false;
+ {{#tryHomeAttr}}
+ tryHomeAttr = true;
+ if (task.data.home && task.data.home.length) attrlist = task.data.home;
+ {{/tryHomeAttr}}
+ if (typeof search !== 'string' || search.length === 0 || search.length + 2 >= fulldn.length
+ || (tryHomeAttr && $('#home').val().length === 0 && $('#homeattr').val().length === 0 && attrlist.length === 0)) {
$('#nextbutton').html('{{lang_continueAnyway}}');
+ } else if (attrlist.length > 1 && $('#homeattr').val().length === 0) {
+ var sel = $('<select>').attr('onchange', 'slxSetHomeAttr(this)').addClass('form-control');
+ var best = 0;
+ for (var i = 1; i < attrlist.length; ++i) {
+ if (attrlist[i].score > attrlist[best].score) best = i;
+ }
+ for (var i = 0; i < attrlist.length; ++i) {
+ var opt = $('<option>').attr('value', attrlist[i].attr).text(attrlist[i].attr + ' (' + attrlist[i].value + ')');
+ if (i === best) opt.attr('selected', 'selected');
+ sel.append(opt);
+ }
+ $('#haselect').append(sel).append('<br>').show();
+ slxSetHomeAttr(sel[0]);
+ $('#nextbutton').html('{{lang_next}}');
} else {
+ if (attrlist.length === 1 && $('#homeattr').val().length === 0) {
+ $('#homeattr').val(attrlist[0].attr);
+ }
$('#nextform').submit();
}
} else {
@@ -76,4 +105,8 @@
}
$('#nextbutton').show();
}
+
+ function slxSetHomeAttr(sel) {
+ $('#homeattr').val(sel.options[sel.selectedIndex].value);
+ }
</script>
diff --git a/templates/sysconfig/ad-start.html b/templates/sysconfig/ad-start.html
index 9d026153..98546140 100644
--- a/templates/sysconfig/ad-start.html
+++ b/templates/sysconfig/ad-start.html
@@ -45,6 +45,13 @@
<a class="btn btn-default" data-toggle="modal" data-target="#help-home"><span class="glyphicon glyphicon-question-sign"></span></a>
</span>
</div>
+ <div class="input-group">
+ <span class="input-group-addon slx-ga">{{lang_homeAttr}}</span>
+ <input tabindex="6" name="homeattr" value="{{homeattr}}" type="text" class="form-control" placeholder="homeDirectory">
+ <span class="input-group-btn">
+ <a class="btn btn-default" data-toggle="modal" data-target="#help-homeattr"><span class="glyphicon glyphicon-question-sign"></span></a>
+ </span>
+ </div>
<br>
<div>
<label>
@@ -98,3 +105,17 @@ MIIFfTCCA...
</div>
</div>
</div>
+
+<div class="modal fade" id="help-homeattr" tabindex="-1" role="dialog">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">{{lang_helpHomeAttrHead}}</div>
+ <div class="modal-body">
+ <p>
+ {{lang_helpHomeAttrText}}
+ </p>
+ </div>
+ <div class="modal-footer"><a class="btn btn-primary" data-dismiss="modal">{{lang_close}}</a></div>
+ </div>
+ </div>
+</div>
diff --git a/templates/sysconfig/ad_ldap-checkconnection.html b/templates/sysconfig/ad_ldap-checkconnection.html
index 788978f2..5925829a 100644
--- a/templates/sysconfig/ad_ldap-checkconnection.html
+++ b/templates/sysconfig/ad_ldap-checkconnection.html
@@ -19,6 +19,7 @@
<input name="binddn" value="{{binddn}}" type="hidden">
<input name="bindpw" value="{{bindpw}}" type="hidden">
<input name="home" value="{{home}}" type="hidden">
+ <input name="homeattr" value="{{homeattr}}" type="hidden">
{{#ssl}}
<input name="ssl" value="on" type="hidden">
<input type="hidden" name="certificate" value="{{certificate}}">
@@ -37,6 +38,7 @@
<input name="binddn" value="{{binddn}}" type="hidden">
<input name="bindpw" value="{{bindpw}}" type="hidden">
<input name="home" value="{{home}}" type="hidden">
+ <input name="homeattr" value="{{homeattr}}" type="hidden">
{{#ssl}}
<input id="ssl" name="ssl" value="on" type="hidden">
<input id="fingerprint" name="fingerprint" value="" type="hidden">
diff --git a/templates/sysconfig/ad_ldap-checkcredentials.html b/templates/sysconfig/ad_ldap-checkcredentials.html
index 9f5ccf01..0586209b 100644
--- a/templates/sysconfig/ad_ldap-checkcredentials.html
+++ b/templates/sysconfig/ad_ldap-checkcredentials.html
@@ -17,6 +17,7 @@
<input name="binddn" value="{{binddn}}" type="hidden">
<input name="bindpw" value="{{bindpw}}" type="hidden">
<input name="home" value="{{home}}" type="hidden">
+ <input name="homeattr" value="{{homeattr}}" type="hidden">
{{#ssl}}
<input name="ssl" value="on" type="hidden">
<input type="hidden" name="certificate" value="{{certificate}}">
@@ -35,6 +36,7 @@
<input name="binddn" value="{{binddn}}" type="hidden">
<input name="bindpw" value="{{bindpw}}" type="hidden">
<input name="home" value="{{home}}" type="hidden">
+ <input name="homeattr" value="{{homeattr}}" type="hidden">
{{#ssl}}
<input name="ssl" value="on" type="hidden">
<input type="hidden" name="certificate" value="{{certificate}}">