DN chooser
This commit is contained in:
parent
a202ed8824
commit
89df814e77
|
@ -1,3 +1,7 @@
|
||||||
|
December 2018 6.6
|
||||||
|
- New import/export in tools menu
|
||||||
|
|
||||||
|
|
||||||
25.09.2018 6.5
|
25.09.2018 6.5
|
||||||
- Password change possible via LDAP EXOP operation (set LDAP_EXOP as password hash, requires PHP 7.2)
|
- Password change possible via LDAP EXOP operation (set LDAP_EXOP as password hash, requires PHP 7.2)
|
||||||
- Support Imagick and GD
|
- Support Imagick and GD
|
||||||
|
@ -25,6 +29,7 @@
|
||||||
- Fixed bugs:
|
- Fixed bugs:
|
||||||
-> Error on password reset page when custom fields is used (194)
|
-> Error on password reset page when custom fields is used (194)
|
||||||
|
|
||||||
|
|
||||||
19.03.2018 6.3
|
19.03.2018 6.3
|
||||||
- Server profile: added option if referential integrity overlay is active to skip cleanup actions
|
- Server profile: added option if referential integrity overlay is active to skip cleanup actions
|
||||||
- Unix: several options are now specific to subaccount types (reconfiguration required!)
|
- Unix: several options are now specific to subaccount types (reconfiguration required!)
|
||||||
|
|
|
@ -472,6 +472,8 @@ class htmlInputField extends htmlElement {
|
||||||
protected $autocompleteMinLength = 1;
|
protected $autocompleteMinLength = 1;
|
||||||
/** show calendar */
|
/** show calendar */
|
||||||
protected $showCalendar = false;
|
protected $showCalendar = false;
|
||||||
|
/** show DN selection */
|
||||||
|
protected $showDnSelection = false;
|
||||||
/** calendar format */
|
/** calendar format */
|
||||||
protected $calendarFormat = '';
|
protected $calendarFormat = '';
|
||||||
/** title attribute */
|
/** title attribute */
|
||||||
|
@ -589,8 +591,19 @@ class htmlInputField extends htmlElement {
|
||||||
if (!empty($this->title)) {
|
if (!empty($this->title)) {
|
||||||
$title = ' title="' . $this->title . '"';
|
$title = ' title="' . $this->title . '"';
|
||||||
}
|
}
|
||||||
|
if ($this->showDnSelection) {
|
||||||
|
echo '<span class="nowrap">';
|
||||||
|
}
|
||||||
echo '<input type="' . $inputType . '"' . $class . $name . $id . $value . $maxLength
|
echo '<input type="' . $inputType . '"' . $class . $name . $id . $value . $maxLength
|
||||||
. $min . $max . $size . $fieldTabIndex . $onKeyPress . $onKeyUp . $title . $disabled . '>';
|
. $min . $max . $size . $fieldTabIndex . $onKeyPress . $onKeyUp . $title . $disabled . '>';
|
||||||
|
if ($this->showDnSelection) {
|
||||||
|
echo '<img class="align-middle" src="../../graphics/view.png"
|
||||||
|
width="16" height="16" title="' . _('Choose entry') . '"
|
||||||
|
onclick="window.lam.html.showDnSelection(\'' . $this->fieldName . '\', \'' . _('Choose entry') . '\'
|
||||||
|
, \'' . _('Ok') . '\', \'' . _('Cancel') . '\', \'' . getSecurityTokenName() . '\'
|
||||||
|
, \'' . getSecurityTokenValue() . '\');">';
|
||||||
|
echo '</span>';
|
||||||
|
}
|
||||||
// autocompletion
|
// autocompletion
|
||||||
if ($this->autocomplete) {
|
if ($this->autocomplete) {
|
||||||
echo "<script type=\"text/javascript\">\n";
|
echo "<script type=\"text/javascript\">\n";
|
||||||
|
@ -805,6 +818,13 @@ class htmlInputField extends htmlElement {
|
||||||
$this->calendarFormat = $format;
|
$this->calendarFormat = $format;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows a DN selection next to input field.
|
||||||
|
*/
|
||||||
|
public function showDnSelection() {
|
||||||
|
$this->showDnSelection = true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the title for the input field.
|
* Sets the title for the input field.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1011,6 +1011,51 @@ window.lam.importexport.startExport = function(tokenName, tokenValue) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
window.lam.html = window.lam.html || {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows a DN selection for the given input field.
|
||||||
|
*
|
||||||
|
* @param fieldId id of input field
|
||||||
|
* @param title title of dialog
|
||||||
|
* @param okText ok button text
|
||||||
|
* @param cancelText cancel button text
|
||||||
|
* @param tokenName CSRF token name
|
||||||
|
* @param tokenValue CSRF token value
|
||||||
|
*/
|
||||||
|
window.lam.html.showDnSelection = function(fieldId, title, okText, cancelText, tokenName, tokenValue) {
|
||||||
|
var field = jQuery('#' + fieldId);
|
||||||
|
var fieldDiv = jQuery('#dlg_' + fieldId);
|
||||||
|
if (!fieldDiv.length > 0) {
|
||||||
|
jQuery('body').append(jQuery('<div class="hidden" id="dlg_' + fieldId + '"></div>'));
|
||||||
|
}
|
||||||
|
var dnValue = field.val();
|
||||||
|
var data = {
|
||||||
|
jsonInput: ''
|
||||||
|
};
|
||||||
|
data[tokenName] = tokenValue;
|
||||||
|
data['dn'] = dnValue;
|
||||||
|
jQuery.ajax({
|
||||||
|
url: '../misc/ajax.php?function=dnselection',
|
||||||
|
method: 'POST',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
.done(function(jsonData){
|
||||||
|
})
|
||||||
|
.fail(function() {
|
||||||
|
});
|
||||||
|
var buttonList = {};
|
||||||
|
buttonList[okText] = function() { alert('OK'); };
|
||||||
|
buttonList[cancelText] = function() { jQuery(this).dialog("close"); };
|
||||||
|
jQuery('#dlg_' + fieldId).dialog({
|
||||||
|
modal: true,
|
||||||
|
title: title,
|
||||||
|
dialogClass: 'defaultBackground',
|
||||||
|
buttons: buttonList,
|
||||||
|
width: 'auto'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
window.lam.gui.equalHeight();
|
window.lam.gui.equalHeight();
|
||||||
window.lam.form.autoTrim();
|
window.lam.form.autoTrim();
|
||||||
|
|
|
@ -262,7 +262,9 @@ function printExportTabContent(&$tabindex) {
|
||||||
$container = new htmlResponsiveRow();
|
$container = new htmlResponsiveRow();
|
||||||
$container->add(new htmlTitle(_("Export")), 12);
|
$container->add(new htmlTitle(_("Export")), 12);
|
||||||
|
|
||||||
$container->add(new htmlResponsiveInputField(_('Base DN'), 'baseDn', getDefaultBaseDn(), '751', true), 12);
|
$baseDnField = new htmlResponsiveInputField(_('Base DN'), 'baseDn', getDefaultBaseDn(), '751', true);
|
||||||
|
$baseDnField->showDnSelection();
|
||||||
|
$container->add($baseDnField, 12);
|
||||||
|
|
||||||
$searchScopes = array(
|
$searchScopes = array(
|
||||||
_('Base (base dn only)') => 'base',
|
_('Base (base dn only)') => 'base',
|
||||||
|
|
Loading…
Reference in New Issue