TASK-230 Delete ldap directories xmlform and templates
This commit is contained in:
@@ -33,34 +33,21 @@ $G_SUB_MENU = 'users';
|
|||||||
$G_ID_MENU_SELECTED = 'USERS';
|
$G_ID_MENU_SELECTED = 'USERS';
|
||||||
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
$G_ID_SUB_MENU_SELECTED = 'AUTH_SOURCES';
|
||||||
|
|
||||||
|
|
||||||
$G_PUBLISH = new Publisher();
|
$G_PUBLISH = new Publisher();
|
||||||
$fields = $RBAC->getAuthSource($_GET['sUID']);
|
$fields = $RBAC->getAuthSource($_GET['sUID']);
|
||||||
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
|
|
||||||
$pluginEnabled = 1;
|
|
||||||
if ($pluginEnabled == 0) {
|
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => G::LoadTranslation('ID_AUTH_SOURCE_FEATURE_MISSING') ));
|
|
||||||
G::RenderPage('publish', 'blank');
|
|
||||||
} else {
|
|
||||||
$c = new Configurations();
|
|
||||||
$configPage = $c->getConfiguration('additionalTablesList', 'pageSize', '', $_SESSION['USER_LOGGED']);
|
|
||||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
|
||||||
|
|
||||||
$oHeadPublisher = headPublisher::getSingleton();
|
$c = new Configurations();
|
||||||
|
$configPage = $c->getConfiguration('additionalTablesList', 'pageSize', '', $_SESSION['USER_LOGGED']);
|
||||||
|
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||||
|
|
||||||
$oHeadPublisher->assign("FORMATS", $c->getFormats());
|
$oHeadPublisher = headPublisher::getSingleton();
|
||||||
$oHeadPublisher->assign("CONFIG", $Config);
|
$oHeadPublisher->assign("FORMATS", $c->getFormats());
|
||||||
|
$oHeadPublisher->assign("CONFIG", $Config);
|
||||||
|
$oHeadPublisher->assign("Fields", $fields);
|
||||||
|
|
||||||
if (file_exists(PATH_XMLFORM . 'ldapAdvanced/' . $fields['AUTH_SOURCE_PROVIDER'] . 'Flag')) {
|
$oHeadPublisher->addExtJsScript(PATH_TPL. 'authSources/authSourcesSearchUsersLibrary', false, true);
|
||||||
$oHeadPublisher = headPublisher::getSingleton();
|
$oHeadPublisher->addExtJsScript(PATH_TPL. 'authSources/authSourcesSearchUsers', false, true);
|
||||||
|
|
||||||
$oHeadPublisher->assign("Fields", $fields);
|
G::RenderPage('publish', 'extJs');
|
||||||
$oHeadPublisher->addExtJsScript(PATH_TPL. 'ldapAdvanced/library', false, true);
|
die();
|
||||||
$oHeadPublisher->addExtJsScript(PATH_TPL. 'ldapAdvanced/ldapAdvancedSearch', false, true);
|
|
||||||
G::RenderPage('publish', 'extJs');
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'authSources/authSources_SearchUsers', '', array('AUTH_SOURCE_UID' => $_GET['sUID']), '../authSources/authSources_ImportUsers');
|
|
||||||
G::RenderPage('publish', 'blank');
|
|
||||||
|
|||||||
@@ -1,237 +0,0 @@
|
|||||||
var ldapFormAnonymousOnChange = function (combo, arrayObject)
|
|
||||||
{
|
|
||||||
var flagAnonymous = (combo.getValue() == "1")? true : false;
|
|
||||||
|
|
||||||
arrayObject["ldapFormSearchUser"].allowBlank = flagAnonymous;
|
|
||||||
arrayObject["ldapFormPassword"].allowBlank = flagAnonymous;
|
|
||||||
|
|
||||||
arrayObject["ldapFormSearchUser"].setVisible(!flagAnonymous);
|
|
||||||
arrayObject["ldapFormPassword"].setVisible(!flagAnonymous);
|
|
||||||
};
|
|
||||||
|
|
||||||
var ldapFormId = new Ext.form.Hidden({
|
|
||||||
name: 'AUTH_SOURCE_UID',
|
|
||||||
id: 'AUTH_SOURCE_UID'
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapFormName = new Ext.form.TextField({
|
|
||||||
fieldLabel: '<span style="color: red">*</span>' + _('ID_NAME'),
|
|
||||||
name: 'AUTH_SOURCE_NAME',
|
|
||||||
id: 'AUTH_SOURCE_NAME',
|
|
||||||
autoCreate: {tag: 'input', type: 'text', maxlength: '50'},
|
|
||||||
allowBlank: false,
|
|
||||||
width: 210
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapFormProvider = new Ext.form.Hidden({
|
|
||||||
name: 'AUTH_SOURCE_PROVIDER',
|
|
||||||
id: 'AUTH_SOURCE_PROVIDER'
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapFormType = new Ext.form.ComboBox({
|
|
||||||
valueField: 'ID',
|
|
||||||
displayField: 'VALUE',
|
|
||||||
value: 'ldap',
|
|
||||||
|
|
||||||
fieldLabel: '<span style="color: red">*</span>' + _('ID_TYPE'),
|
|
||||||
typeAhead: true,
|
|
||||||
forceSelection: true,
|
|
||||||
triggerAction: 'all',
|
|
||||||
editable: true,
|
|
||||||
name: 'LDAP_TYPE',
|
|
||||||
id: 'LDAP_TYPE',
|
|
||||||
width: 130,
|
|
||||||
allowBlank: false,
|
|
||||||
store: [["ldap", "OpenLDAP"], ["ad", "Active Directory"], ["ds", "389 DS"]],
|
|
||||||
listeners:{
|
|
||||||
select: function(combo, record) {
|
|
||||||
ldapFormIdentifier.setValue((combo.getValue() == "ad")? "samaccountname" : "uid");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapFormAutoRegister = new Ext.form.ComboBox({
|
|
||||||
valueField: 'ID',
|
|
||||||
displayField: 'VALUE',
|
|
||||||
value: '0',
|
|
||||||
|
|
||||||
fieldLabel: '<span style="color: red">*</span>' + _("ID_ENABLE_AUTOMATIC_REGISTER"),
|
|
||||||
typeAhead: true,
|
|
||||||
forceSelection: true,
|
|
||||||
triggerAction: 'all',
|
|
||||||
editable: true,
|
|
||||||
name: 'AUTH_SOURCE_AUTO_REGISTER',
|
|
||||||
id: 'AUTH_SOURCE_AUTO_REGISTER',
|
|
||||||
width: 130,
|
|
||||||
allowBlank: false,
|
|
||||||
store: [['0',_('ID_NO')],['1',_('ID_YES')]]
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapFormServerName = new Ext.form.TextField({
|
|
||||||
fieldLabel: '<span style="color: red">*</span>' + _("ID_SERVER_ADDRESS"),
|
|
||||||
name: 'AUTH_SOURCE_SERVER_NAME',
|
|
||||||
id: 'AUTH_SOURCE_SERVER_NAME',
|
|
||||||
autoCreate: {tag: 'input', type: 'text', maxlength: '50'},
|
|
||||||
allowBlank: false,
|
|
||||||
width: 210
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapFormPort = new Ext.form.NumberField({
|
|
||||||
fieldLabel: '<span style="color: red">*</span>' + _('ID_PORT'),
|
|
||||||
name: 'AUTH_SOURCE_PORT',
|
|
||||||
id: 'AUTH_SOURCE_PORT',
|
|
||||||
allowBlank: true,
|
|
||||||
width: 130,
|
|
||||||
value: '389',
|
|
||||||
autoCreate: {tag: 'input', type: 'text', maxlength: '5'}
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapFormTls = new Ext.form.ComboBox({
|
|
||||||
valueField: 'ID',
|
|
||||||
displayField: 'VALUE',
|
|
||||||
|
|
||||||
fieldLabel: '<span style="color: red">*</span>' + _('ID_ENABLED_TLS'),
|
|
||||||
typeAhead: true,
|
|
||||||
forceSelection: true,
|
|
||||||
triggerAction: 'all',
|
|
||||||
editable: true,
|
|
||||||
name: 'AUTH_SOURCE_ENABLED_TLS',
|
|
||||||
id: 'AUTH_SOURCE_ENABLED_TLS',
|
|
||||||
width: 130,
|
|
||||||
allowBlank: false,
|
|
||||||
value: '0',
|
|
||||||
store: [['0',_('ID_NO')],['1',_('ID_YES')]]
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapFormBaseDN = new Ext.form.TextField({
|
|
||||||
fieldLabel: '<span style="color: red">*</span>' + _('ID_BASE_DN'),
|
|
||||||
name: 'AUTH_SOURCE_BASE_DN',
|
|
||||||
id: 'AUTH_SOURCE_BASE_DN',
|
|
||||||
autoCreate: {tag: 'input', type: 'text', maxlength: '128'},
|
|
||||||
allowBlank: false,
|
|
||||||
width: 210
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapFormAnonymous = new Ext.form.ComboBox({
|
|
||||||
valueField: 'ID',
|
|
||||||
displayField: 'VALUE',
|
|
||||||
|
|
||||||
fieldLabel: '<span style="color: red">*</span>' + _('ID_ANONYMOUS'),
|
|
||||||
typeAhead: true,
|
|
||||||
forceSelection: true,
|
|
||||||
triggerAction: 'all',
|
|
||||||
editable: true,
|
|
||||||
name: 'AUTH_ANONYMOUS',
|
|
||||||
id: 'AUTH_ANONYMOUS',
|
|
||||||
width: 130,
|
|
||||||
allowBlank: false,
|
|
||||||
value: '0',
|
|
||||||
store: [['0',_('ID_NO')],['1',_('ID_YES')]],
|
|
||||||
listeners:{
|
|
||||||
select: function(combo, record) {
|
|
||||||
var arrayObject = [];
|
|
||||||
arrayObject["ldapFormSearchUser"] = ldapFormSearchUser;
|
|
||||||
arrayObject["ldapFormPassword"] = ldapFormPassword;
|
|
||||||
|
|
||||||
ldapFormAnonymousOnChange(combo, arrayObject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapFormSearchUser = new Ext.form.TextField({
|
|
||||||
fieldLabel: '<span style="color: red">*</span>' + _('ID_USERNAME'),
|
|
||||||
name: 'AUTH_SOURCE_SEARCH_USER',
|
|
||||||
id: 'AUTH_SOURCE_SEARCH_USER',
|
|
||||||
autoCreate: {tag: 'input', type: 'text', maxlength: '128'},
|
|
||||||
allowBlank: false,
|
|
||||||
width: 210
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapFormPassword = new Ext.form.TextField({
|
|
||||||
fieldLabel: '<span style="color: red">*</span>' + _('ID_PASSWORD'),
|
|
||||||
inputType: 'password',
|
|
||||||
name: 'AUTH_SOURCE_PASSWORD',
|
|
||||||
id: 'AUTH_SOURCE_PASSWORD',
|
|
||||||
autoCreate: {tag: 'input', type: 'text', maxlength: '32'},
|
|
||||||
allowBlank: false,
|
|
||||||
width: 210
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapFormIdentifier = new Ext.form.TextField({
|
|
||||||
fieldLabel: '<span style="color: red">*</span>' + _("ID_USER_IDENTIFIER"),
|
|
||||||
name: 'AUTH_SOURCE_IDENTIFIER_FOR_USER',
|
|
||||||
id: 'AUTH_SOURCE_IDENTIFIER_FOR_USER',
|
|
||||||
autoCreate: {tag: 'input', type: 'text', maxlength: '20'},
|
|
||||||
allowBlank: false,
|
|
||||||
width: 210,
|
|
||||||
value: 'uid'
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapFormUsersFilter = new Ext.form.TextField({
|
|
||||||
fieldLabel: _("ID_FILTER_TO_SEARCH_USERS"),
|
|
||||||
name: 'AUTH_SOURCE_USERS_FILTER',
|
|
||||||
id: 'AUTH_SOURCE_USERS_FILTER',
|
|
||||||
autoCreate: {tag: 'input', type: 'text', maxlength: '200'},
|
|
||||||
allowBlank: true,
|
|
||||||
width: 210
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapFormRetiredEmployees = new Ext.form.TextField({
|
|
||||||
fieldLabel: _("ID_OU_FOR_RETIRED_EMPLOYEES_OU"),
|
|
||||||
name: 'AUTH_SOURCE_RETIRED_OU',
|
|
||||||
id: 'AUTH_SOURCE_RETIRED_OU',
|
|
||||||
autoCreate: {tag: 'input', type: 'text', maxlength: '128'},
|
|
||||||
allowBlank: true,
|
|
||||||
width: 210
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapFormAttrinuteIds = new Ext.form.Hidden({
|
|
||||||
name: 'AUTH_SOURCE_ATTRIBUTE_IDS',
|
|
||||||
id: 'AUTH_SOURCE_ATTRIBUTE_IDS'
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapFormShowGrid = new Ext.form.Hidden({
|
|
||||||
name: 'AUTH_SOURCE_SHOWGRID',
|
|
||||||
id: 'AUTH_SOURCE_SHOWGRID'
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapFormGridText = new Ext.form.Hidden({
|
|
||||||
name: 'AUTH_SOURCE_GRID_TEXT',
|
|
||||||
id: 'AUTH_SOURCE_GRID_TEXT'
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
var ldapFormData = new Ext.form.FieldSet({
|
|
||||||
style: {
|
|
||||||
border: "0px"
|
|
||||||
},
|
|
||||||
|
|
||||||
labelWidth : 170,
|
|
||||||
items :[
|
|
||||||
ldapFormId, ldapFormName, ldapFormProvider, ldapFormType, ldapFormAutoRegister, ldapFormServerName,
|
|
||||||
ldapFormPort, ldapFormTls, ldapFormBaseDN, ldapFormAnonymous, ldapFormSearchUser, ldapFormPassword,
|
|
||||||
ldapFormIdentifier, ldapFormUsersFilter, ldapFormRetiredEmployees,
|
|
||||||
{
|
|
||||||
xtype: 'label',
|
|
||||||
fieldLabel: ' ',
|
|
||||||
id:'passwordReview',
|
|
||||||
width: 300,
|
|
||||||
style: 'font: 9px tahoma,arial,helvetica,sans-serif;',
|
|
||||||
text: _("ID_DEFAULT_SET_TO"),
|
|
||||||
labelSeparator: ''
|
|
||||||
}, ldapFormAttrinuteIds, ldapFormShowGrid, ldapFormGridText
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
var pnlData = new Ext.Panel({
|
|
||||||
height: 425,
|
|
||||||
|
|
||||||
bodyStyle: "border-top: 0px; padding-top: 10px;",
|
|
||||||
|
|
||||||
title: "<div style=\"height: 20px;\">" + _("ID_INFORMATION") + "</div>",
|
|
||||||
|
|
||||||
items: [ldapFormData]
|
|
||||||
});
|
|
||||||
|
|
||||||
@@ -1,487 +0,0 @@
|
|||||||
Ext.onReady(function() {
|
|
||||||
//Head - Add style
|
|
||||||
var nhead = document.getElementsByTagName("head")[0];
|
|
||||||
var nstyle = document.createElement("style");
|
|
||||||
var strCss = "\
|
|
||||||
.ext-mb-ok {\
|
|
||||||
background: transparent url(/images/dialog-ok-apply.png) no-repeat top left;\
|
|
||||||
}";
|
|
||||||
|
|
||||||
nstyle.setAttribute("type", "text/css");
|
|
||||||
|
|
||||||
nhead.appendChild(nstyle);
|
|
||||||
|
|
||||||
if (nstyle.styleSheet) {
|
|
||||||
//IE
|
|
||||||
nstyle.styleSheet.cssText = strCss;
|
|
||||||
} else {
|
|
||||||
//Others browsers
|
|
||||||
nstyle.appendChild(document.createTextNode(strCss));
|
|
||||||
}
|
|
||||||
|
|
||||||
//Init
|
|
||||||
Ext.QuickTips.init();
|
|
||||||
Ext.form.Field.prototype.msgTarget = 'side';
|
|
||||||
|
|
||||||
var ldapGridProxy = new Ext.data.HttpProxy({
|
|
||||||
method: 'POST',
|
|
||||||
api: {
|
|
||||||
read : 'ldapAdvancedProxy.php?functionAccion=ldapGrid&tipo=read',
|
|
||||||
create : 'ldapAdvancedProxy.php?functionAccion=ldapGrid&tipo=create',
|
|
||||||
save : 'ldapAdvancedProxy.php?functionAccion=ldapGrid&tipo=save',
|
|
||||||
destroy : 'ldapAdvancedProxy.php?functionAccion=ldapGrid&tipo=destroy',
|
|
||||||
update : 'ldapAdvancedProxy.php?functionAccion=ldapGrid&tipo=update'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapGridReader = new Ext.data.JsonReader({
|
|
||||||
totalProperty: 'total',
|
|
||||||
successProperty: 'success',
|
|
||||||
messageProperty: 'message',
|
|
||||||
idProperty: 'ID',
|
|
||||||
root: 'data',
|
|
||||||
fields: [
|
|
||||||
{name: 'ID'},
|
|
||||||
{name: 'ATTRIBUTE_LDAP'},
|
|
||||||
{name: 'ATTRIBUTE_USER'}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapGridWriter = new Ext.data.JsonWriter({
|
|
||||||
encode: true,
|
|
||||||
writeAllFields: true,
|
|
||||||
listful: true
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapGridStore = new Ext.data.Store({
|
|
||||||
proxy: ldapGridProxy,
|
|
||||||
reader: ldapGridReader,
|
|
||||||
writer: ldapGridWriter,
|
|
||||||
autoSave: true,
|
|
||||||
listeners:{
|
|
||||||
load: function() {
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Ext.data.DataProxy.addListener('beforewrite', function(proxy, action) {
|
|
||||||
/*
|
|
||||||
if(action != 'create')
|
|
||||||
{
|
|
||||||
Ext.MessageBox.show({
|
|
||||||
msg: 'Guardando su información, espere un momento por favor',
|
|
||||||
progressText: 'Saving...',
|
|
||||||
width:300,
|
|
||||||
wait:true,
|
|
||||||
waitConfig: {interval:200},
|
|
||||||
animEl: 'mb7'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
});
|
|
||||||
|
|
||||||
Ext.data.DataProxy.addListener('write', function(proxy, action, result, res, rs) {
|
|
||||||
//
|
|
||||||
});
|
|
||||||
|
|
||||||
Ext.data.DataProxy.addListener('exception', function(proxy, type, action, options, res) {
|
|
||||||
/*
|
|
||||||
Ext.MessageBox.show({
|
|
||||||
title: 'Error de almacenamiento',
|
|
||||||
msg: 'Error al almacenar datos',
|
|
||||||
buttons: Ext.MessageBox.OK,
|
|
||||||
animEl: 'mb9',
|
|
||||||
icon: Ext.MessageBox.ERROR
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapGridFieldLdap = new Ext.form.TextField({
|
|
||||||
name: 'DELETE1',
|
|
||||||
id: 'DELETE1',
|
|
||||||
autoCreate: {tag: 'input', type: 'text', maxlength: '50'}
|
|
||||||
});
|
|
||||||
|
|
||||||
var values = Fields.AUTH_SOURCE_ATTRIBUTE_IDS;
|
|
||||||
values = values.trim();
|
|
||||||
var allValues = new Array();
|
|
||||||
var comboValues = new Array();
|
|
||||||
allValues = values.split('|');
|
|
||||||
for (var i = 0; i < allValues.length; i++) {
|
|
||||||
if (allValues[i] != '') {
|
|
||||||
comboValues.push([allValues[i],allValues[i]]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var ldapGridFieldUser = new Ext.form.ComboBox({
|
|
||||||
valueField: 'ID',
|
|
||||||
displayField: 'VALUE',
|
|
||||||
value: '0',
|
|
||||||
|
|
||||||
typeAhead: true,
|
|
||||||
forceSelection: true,
|
|
||||||
triggerAction: 'all',
|
|
||||||
name: 'DELETE2',
|
|
||||||
id: 'DELETE2',
|
|
||||||
editable: true,
|
|
||||||
width: 130,
|
|
||||||
store: comboValues
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapGridCol = [
|
|
||||||
{
|
|
||||||
id: 'ID',
|
|
||||||
dataIndex: 'ID',
|
|
||||||
sortable: true,
|
|
||||||
hidden: true,
|
|
||||||
hideable:false
|
|
||||||
},{
|
|
||||||
id: 'ATTRIBUTE_LDAP',
|
|
||||||
header: _("ID_LDAP_FIELD"),
|
|
||||||
dataIndex: 'ATTRIBUTE_LDAP',
|
|
||||||
width: 10,
|
|
||||||
sortable: true,
|
|
||||||
editor: ldapGridFieldLdap
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'ATTRIBUTE_USER',
|
|
||||||
header: _("ID_USER_FIELD"),
|
|
||||||
dataIndex: 'ATTRIBUTE_USER',
|
|
||||||
width: 10,
|
|
||||||
sortable: true,
|
|
||||||
editor: ldapGridFieldUser
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
var ldapGridEditor = new Ext.ux.grid.RowEditor({
|
|
||||||
saveText: _('ID_SAVE'),
|
|
||||||
cancelText: _('ID_CANCEL'),
|
|
||||||
listeners: {
|
|
||||||
canceledit: function(grid,obj){
|
|
||||||
//
|
|
||||||
},
|
|
||||||
afteredit: function(grid,obj,record){
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var ldapGrid = new Ext.grid.GridPanel({
|
|
||||||
store: ldapGridStore,
|
|
||||||
loadMask : true,
|
|
||||||
plugins: [ldapGridEditor],
|
|
||||||
frame: true,
|
|
||||||
height: 365,
|
|
||||||
columns : ldapGridCol,
|
|
||||||
autoShow: true,
|
|
||||||
autoFill:true,
|
|
||||||
nocache: true,
|
|
||||||
autoWidth: true,
|
|
||||||
stripeRows: true,
|
|
||||||
stateful: true,
|
|
||||||
animCollapse: true,
|
|
||||||
enableColumnResize: true,
|
|
||||||
enableHdMenu: true,
|
|
||||||
columnLines: true,
|
|
||||||
|
|
||||||
tbar: [{
|
|
||||||
text: _('ID_ADD'),
|
|
||||||
iconCls: ' x-btn-text button_menu_ext ss_sprite ss_add',
|
|
||||||
handler: onAdd
|
|
||||||
}, '-', {
|
|
||||||
text: _('ID_REMOVE'),
|
|
||||||
iconCls: ' x-btn-text button_menu_ext ss_sprite ss_delete',
|
|
||||||
handler: onDelete
|
|
||||||
}],
|
|
||||||
viewConfig: {
|
|
||||||
forceFit: true
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function onAdd(btn, ev) {
|
|
||||||
var row = new ldapGrid.store.recordType({
|
|
||||||
ID: 'NUEVO',
|
|
||||||
ATTRIBUTE_LDAP: '',
|
|
||||||
ATTRIBUTE_USER: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
var length = ldapGrid.getStore().data.length;
|
|
||||||
ldapGridEditor.stopEditing();
|
|
||||||
ldapGridStore.insert(length, row);
|
|
||||||
ldapGrid.getView().refresh();
|
|
||||||
ldapGrid.getSelectionModel().selectRow(length);
|
|
||||||
ldapGridEditor.startEditing(length);
|
|
||||||
}
|
|
||||||
|
|
||||||
function onDelete() {
|
|
||||||
var rec = ldapGrid.getSelectionModel().getSelected();
|
|
||||||
if (!rec) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
ldapGrid.store.remove(rec);
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
var pnlAttribute = new Ext.Panel({
|
|
||||||
height: 425,
|
|
||||||
bodyStyle: "border-top: 0px; padding: 10px;",
|
|
||||||
|
|
||||||
title: "<div id=\"containerChkAttribute\" style=\"height: 20px;\"></div>",
|
|
||||||
items: [ldapGrid],
|
|
||||||
|
|
||||||
listeners: {
|
|
||||||
afterrender: function (panel)
|
|
||||||
{
|
|
||||||
var chk = new Ext.form.Checkbox({
|
|
||||||
id: "AUTH_SOURCE_SHOWGRID-checkbox",
|
|
||||||
name: "AUTH_SOURCE_SHOWGRID-checkbox",
|
|
||||||
boxLabel: _("ID_MATCH_ATTRIBUTES_TO_SYNC"),
|
|
||||||
renderTo: "containerChkAttribute",
|
|
||||||
|
|
||||||
listeners: {
|
|
||||||
check: function (chk, checked)
|
|
||||||
{
|
|
||||||
ldapGrid.setVisible(checked);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
var ldapFormSubmit = function ()
|
|
||||||
{
|
|
||||||
var itemsLdapGrid = ldapGrid.store.data.items;
|
|
||||||
var arrayDetail = [];
|
|
||||||
|
|
||||||
for (var i = 0; i <= itemsLdapGrid.length - 1; i++) {
|
|
||||||
var newItem = {
|
|
||||||
attributeLdap: itemsLdapGrid[i].data.ATTRIBUTE_LDAP,
|
|
||||||
attributeUser: itemsLdapGrid[i].data.ATTRIBUTE_USER
|
|
||||||
};
|
|
||||||
|
|
||||||
arrayDetail[i] = newItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ext.get("LDAP_TYPE").dom.value = ldapFormType.getValue();
|
|
||||||
Ext.get("AUTH_SOURCE_AUTO_REGISTER").dom.value = ldapFormAutoRegister.getValue();
|
|
||||||
Ext.get("AUTH_SOURCE_ENABLED_TLS").dom.value = ldapFormTls.getValue();
|
|
||||||
Ext.get("AUTH_ANONYMOUS").dom.value = ldapFormAnonymous.getValue();
|
|
||||||
Ext.get("AUTH_SOURCE_GRID_TEXT").dom.value = Ext.util.JSON.encode(arrayDetail);
|
|
||||||
|
|
||||||
ldapForm.getForm().submit({
|
|
||||||
method: "POST",
|
|
||||||
waitTitle: _('ID_CONNECTING'),
|
|
||||||
waitMsg: _("ID_SAVING"),
|
|
||||||
success: function (form, action)
|
|
||||||
{
|
|
||||||
redirectPage("../authSources/authSources_List?" + randomNum(1, 9999999));
|
|
||||||
},
|
|
||||||
failure: function (form, action)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var ldapForm = new Ext.FormPanel({
|
|
||||||
url : 'ldapAdvancedProxy.php?functionAccion=ldapSave',
|
|
||||||
frame : true,
|
|
||||||
title : _("ID_AUTHENTICATION_SOURCE_INFORMATION"),
|
|
||||||
border : false,
|
|
||||||
autoScroll: true,
|
|
||||||
monitorValid : true,
|
|
||||||
|
|
||||||
items:[
|
|
||||||
{
|
|
||||||
layout:'column',
|
|
||||||
autoScroll:true,
|
|
||||||
|
|
||||||
bodyStyle: "border: 0px;",
|
|
||||||
|
|
||||||
items:[{
|
|
||||||
columnWidth: 0.5,
|
|
||||||
bodyStyle: "border: 0px;",
|
|
||||||
items: [pnlData]
|
|
||||||
},{
|
|
||||||
columnWidth: 0.5,
|
|
||||||
bodyStyle: "border: 0px; padding-left: 10px;",
|
|
||||||
items: [pnlAttribute]
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
layout: "column",
|
|
||||||
autoScroll: true,
|
|
||||||
|
|
||||||
bodyStyle: "margin-top: 0.5em; border: 0px;",
|
|
||||||
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
columnWidth: 1,
|
|
||||||
bodyStyle: "border: 0px;",
|
|
||||||
html: _("ID_MINIMUM_DATA_REQUIRED_TO_RUN_THE")
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
buttons: [
|
|
||||||
{
|
|
||||||
text: _("ID_SAVE"),
|
|
||||||
formBind: true,
|
|
||||||
handler: function ()
|
|
||||||
{
|
|
||||||
if (typeof(Fields.AUTH_SOURCE_UID) != "undefined" && typeof(Fields.AUTH_SOURCE_BASE_DN) != "undefined" && ldapFormBaseDN.getValue() != Fields.AUTH_SOURCE_BASE_DN) {
|
|
||||||
Ext.Ajax.request({
|
|
||||||
url: "ldapAdvancedProxy.php",
|
|
||||||
method: "POST",
|
|
||||||
params: {
|
|
||||||
functionAccion: "ldapVerifyIfExistsRecordsInDb",
|
|
||||||
authenticationSourceUid: Fields.AUTH_SOURCE_UID
|
|
||||||
},
|
|
||||||
|
|
||||||
success: function (response, opts)
|
|
||||||
{
|
|
||||||
var dataResponse = Ext.util.JSON.decode(response.responseText);
|
|
||||||
|
|
||||||
if (dataResponse.status) {
|
|
||||||
if (dataResponse.status == "OK" && dataResponse.existsRecords + "" == "1") {
|
|
||||||
Ext.MessageBox.confirm(
|
|
||||||
_("ID_CONFIRM"),
|
|
||||||
"System has detected that there are synchronized elements with the \"Authentication Source \" you are editing, if you change the \"Base DN\" those synchronized elements could have problems. Are you sure you want to change the \"Base DN\"?",
|
|
||||||
function (btn)
|
|
||||||
{
|
|
||||||
if (btn == "yes") {
|
|
||||||
ldapFormSubmit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
ldapFormSubmit();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ldapFormSubmit();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
failure: function (response, opts)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
ldapFormSubmit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: _('ID_TEST_CONNECTION'),
|
|
||||||
formBind: true,
|
|
||||||
handler: function ()
|
|
||||||
{
|
|
||||||
var loadMaskAux = new Ext.LoadMask(Ext.getBody(), {msg: _('ID_TESTING_CONNECTION')});
|
|
||||||
loadMaskAux.show();
|
|
||||||
|
|
||||||
Ext.Ajax.request({
|
|
||||||
url: "ldapAdvancedProxy.php",
|
|
||||||
method: "POST",
|
|
||||||
params: {
|
|
||||||
functionAccion: "ldapTestConnection",
|
|
||||||
AUTH_SOURCE_SERVER_NAME: Ext.getCmp("AUTH_SOURCE_SERVER_NAME").getValue(),
|
|
||||||
AUTH_SOURCE_PORT: Ext.getCmp("AUTH_SOURCE_PORT").getValue(),
|
|
||||||
AUTH_SOURCE_ENABLED_TLS: Ext.getCmp("AUTH_SOURCE_ENABLED_TLS").getValue(),
|
|
||||||
AUTH_ANONYMOUS: Ext.getCmp("AUTH_ANONYMOUS").getValue(),
|
|
||||||
AUTH_SOURCE_SEARCH_USER: Ext.getCmp("AUTH_SOURCE_SEARCH_USER").getValue(),
|
|
||||||
AUTH_SOURCE_PASSWORD: Ext.getCmp("AUTH_SOURCE_PASSWORD").getValue(),
|
|
||||||
AUTH_SOURCE_VERSION: 3
|
|
||||||
},
|
|
||||||
|
|
||||||
success: function (response, opts)
|
|
||||||
{
|
|
||||||
var dataResponse = Ext.util.JSON.decode(response.responseText);
|
|
||||||
|
|
||||||
if (dataResponse.status) {
|
|
||||||
Ext.MessageBox.show({
|
|
||||||
title: _('ID_TEST_CONNECTION'),
|
|
||||||
msg: (dataResponse.status == "OK")? _('ID_SUCCESSFULLY_CONNECTED') : dataResponse.message,
|
|
||||||
|
|
||||||
icon: (dataResponse.status == "OK")? "ext-mb-ok" : Ext.MessageBox.ERROR,
|
|
||||||
buttons: {ok: _("ID_ACCEPT")}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
loadMaskAux.hide();
|
|
||||||
},
|
|
||||||
failure: function (response, opts)
|
|
||||||
{
|
|
||||||
loadMaskAux.hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: _("ID_CANCEL"),
|
|
||||||
handler: function ()
|
|
||||||
{
|
|
||||||
redirectPage("../authSources/authSources_List?" + randomNum(1, 9999999));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
var gridAttribute = '';
|
|
||||||
if (typeof(Fields.AUTH_SOURCE_UID) == 'undefined' || Fields.AUTH_SOURCE_UID == '') {
|
|
||||||
ldapFormProvider.setValue(Fields.AUTH_SOURCE_PROVIDER);
|
|
||||||
ldapFormAttrinuteIds.setValue(Fields.AUTH_SOURCE_ATTRIBUTE_IDS);
|
|
||||||
gridAttribute = '';
|
|
||||||
} else {
|
|
||||||
ldapFormId.setValue(Fields.AUTH_SOURCE_UID);
|
|
||||||
ldapFormName.setValue(Fields.AUTH_SOURCE_NAME);
|
|
||||||
ldapFormProvider.setValue(Fields.AUTH_SOURCE_PROVIDER);
|
|
||||||
ldapFormType.setValue(Fields.LDAP_TYPE);
|
|
||||||
ldapFormAutoRegister.setValue(Fields.AUTH_SOURCE_AUTO_REGISTER);
|
|
||||||
ldapFormServerName.setValue(Fields.AUTH_SOURCE_SERVER_NAME);
|
|
||||||
|
|
||||||
ldapFormPort.setValue(Fields.AUTH_SOURCE_PORT);
|
|
||||||
ldapFormTls.setValue(Fields.AUTH_SOURCE_ENABLED_TLS);
|
|
||||||
ldapFormBaseDN.setValue(Fields.AUTH_SOURCE_BASE_DN);
|
|
||||||
ldapFormAnonymous.setValue(Fields.AUTH_ANONYMOUS);
|
|
||||||
ldapFormSearchUser.setValue(Fields.AUTH_SOURCE_SEARCH_USER);
|
|
||||||
ldapFormPassword.setValue(Fields.AUTH_SOURCE_PASSWORD);
|
|
||||||
ldapFormIdentifier.setValue(Fields.AUTH_SOURCE_IDENTIFIER_FOR_USER);
|
|
||||||
ldapFormUsersFilter.setValue(Fields.AUTH_SOURCE_USERS_FILTER);
|
|
||||||
ldapFormRetiredEmployees.setValue(Fields.AUTH_SOURCE_RETIRED_OU);
|
|
||||||
|
|
||||||
if (typeof(Fields.AUTH_SOURCE_GRID_ATTRIBUTE) != 'undefined') {
|
|
||||||
gridAttribute = Ext.util.JSON.encode(Fields.AUTH_SOURCE_GRID_ATTRIBUTE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ldapGridStore.load({
|
|
||||||
params:{'data': gridAttribute}
|
|
||||||
});
|
|
||||||
|
|
||||||
var arrayObject = [];
|
|
||||||
arrayObject["ldapFormSearchUser"] = ldapFormSearchUser;
|
|
||||||
arrayObject["ldapFormPassword"] = ldapFormPassword;
|
|
||||||
|
|
||||||
ldapFormAnonymousOnChange(ldapFormAnonymous, arrayObject);
|
|
||||||
|
|
||||||
new Ext.Viewport({
|
|
||||||
layout:'fit',
|
|
||||||
border: false,
|
|
||||||
items: [ldapForm]
|
|
||||||
});
|
|
||||||
|
|
||||||
ldapFormProvider.setValue(Fields.AUTH_SOURCE_PROVIDER);
|
|
||||||
ldapFormAttrinuteIds.setValue(Fields.AUTH_SOURCE_ATTRIBUTE_IDS);
|
|
||||||
|
|
||||||
Ext.getCmp("AUTH_SOURCE_SHOWGRID-checkbox").setValue(typeof(Fields.AUTH_SOURCE_GRID_ATTRIBUTE) != "undefined");
|
|
||||||
ldapGrid.setVisible(typeof(Fields.AUTH_SOURCE_GRID_ATTRIBUTE) != "undefined");
|
|
||||||
});
|
|
||||||
|
|
||||||
@@ -1,180 +0,0 @@
|
|||||||
var caseData = '';
|
|
||||||
var appTitle = new Ext.form.Label({
|
|
||||||
fieldLabel: _('ID_CASE_TITLE'),
|
|
||||||
labelStyle: 'font-weight:bold;padding-right:30px;'
|
|
||||||
});
|
|
||||||
|
|
||||||
var process = new Ext.form.Label({
|
|
||||||
fieldLabel: _('ID_PROCESS_UID'),
|
|
||||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
|
||||||
});
|
|
||||||
|
|
||||||
var processTitle = new Ext.form.Label({
|
|
||||||
fieldLabel: _('ID_PROCESS'),
|
|
||||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
|
||||||
});
|
|
||||||
|
|
||||||
var appUid = new Ext.form.Label({
|
|
||||||
fieldLabel: _('ID_APP_UID'),
|
|
||||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
|
||||||
});
|
|
||||||
|
|
||||||
var caseNumber = new Ext.form.Label({
|
|
||||||
fieldLabel: _('ID_CASE_NUMBER'),
|
|
||||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
|
||||||
});
|
|
||||||
|
|
||||||
var initUser = new Ext.form.Label({
|
|
||||||
fieldLabel: _('ID_INIT_USER'),
|
|
||||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
|
||||||
});
|
|
||||||
|
|
||||||
var finishUser = new Ext.form.Label({
|
|
||||||
fieldLabel: _('ID_FINISH_USER'),
|
|
||||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
|
||||||
});
|
|
||||||
|
|
||||||
var createDate = new Ext.form.Label({
|
|
||||||
fieldLabel: _('ID_CREATE_DATE'),
|
|
||||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
|
||||||
});
|
|
||||||
|
|
||||||
var finishDate = new Ext.form.Label({
|
|
||||||
fieldLabel: _('ID_FINISH_DATE'),
|
|
||||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
|
||||||
});
|
|
||||||
|
|
||||||
var fileName = new Ext.form.Label({
|
|
||||||
fieldLabel: _('ID_FILE_NAME'),
|
|
||||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
|
||||||
});
|
|
||||||
|
|
||||||
var statusCaseWin = new Ext.form.Label({
|
|
||||||
fieldLabel: _('ID_CASESLIST_APP_STATUS'),
|
|
||||||
labelStyle: 'font-weight:bold;padding-right:35px;'
|
|
||||||
});
|
|
||||||
|
|
||||||
var formCase = new Ext.FormPanel({
|
|
||||||
labelWidth : 120,
|
|
||||||
labelAlign : 'right',
|
|
||||||
autoScroll: true,
|
|
||||||
frame: true,
|
|
||||||
bodyStyle : 'padding-top:20px;padding-left:20px;',
|
|
||||||
items:[
|
|
||||||
appTitle,
|
|
||||||
caseNumber,
|
|
||||||
processTitle,
|
|
||||||
initUser,
|
|
||||||
finishUser,
|
|
||||||
createDate,
|
|
||||||
finishDate,
|
|
||||||
fileName,
|
|
||||||
statusCaseWin
|
|
||||||
],
|
|
||||||
buttons:[{
|
|
||||||
text : "Restore case",
|
|
||||||
id: 'BUTTON_UNARCHIVE_CASE',
|
|
||||||
iconCls: 'button_menu_ext ss_sprite ss_folder_go',
|
|
||||||
formBind : true,
|
|
||||||
handler : function(){
|
|
||||||
if (caseData!='') {
|
|
||||||
Ext.MessageBox.confirm("Confirm", "Are you sure you want to restore the case?", function (val) {
|
|
||||||
if (val == 'yes') {
|
|
||||||
dataCase = caseData;
|
|
||||||
Ext.MessageBox.show({
|
|
||||||
msg: _('ID_RESTORING_CASE') + ' ' + dataCase.CASE_NUMBER + ' ...',
|
|
||||||
progressText: _('ID_SAVING'),
|
|
||||||
width:300,
|
|
||||||
wait:true,
|
|
||||||
waitConfig: {interval:200},
|
|
||||||
animEl: 'mb7'
|
|
||||||
});
|
|
||||||
Ext.Ajax.request({
|
|
||||||
params: {
|
|
||||||
'APP_UID': dataCase.APP_UID,
|
|
||||||
'FILENAME_TAR': dataCase.FILENAME_TAR,
|
|
||||||
'functionExecute': 'unarchiveCase'
|
|
||||||
},
|
|
||||||
url : 'controllers/searchListProxy.php',
|
|
||||||
success: function (returnData) {
|
|
||||||
Ext.MessageBox.hide();
|
|
||||||
|
|
||||||
var resp = Ext.decode(returnData.responseText);
|
|
||||||
if (resp.success) {
|
|
||||||
Ext.MessageBox.show({
|
|
||||||
title: _('ID_CASE_UNARHIVE'),
|
|
||||||
msg: _('ID_CASE') + ' ' + dataCase.CASE_NUMBER + ' ' + _('ID_RESTORED_SUCESSFULLY'),
|
|
||||||
buttons: Ext.MessageBox.OK,
|
|
||||||
animEl: 'mb9',
|
|
||||||
icon: Ext.MessageBox.INFO
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
Ext.MessageBox.show({
|
|
||||||
title: _('ID_ERROR'),
|
|
||||||
msg: resp.message,
|
|
||||||
buttons: Ext.MessageBox.OK,
|
|
||||||
animEl: 'mb9',
|
|
||||||
icon: Ext.MessageBox.ERROR
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
storeGridSearch.load();
|
|
||||||
},
|
|
||||||
failure: function () {
|
|
||||||
Ext.MessageBox.alert("Error", _('ID_ERROR_IN_SERVER'));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text : _('ID_CLOSE'),
|
|
||||||
iconCls: 'button_menu_ext ss_sprite ss_folder_delete',
|
|
||||||
formBind : true,
|
|
||||||
handler : function(){
|
|
||||||
summaryWindow.hide();
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
});
|
|
||||||
|
|
||||||
var summaryWindow = new Ext.Window({
|
|
||||||
title: _('ID_DETAIL_CASE'),
|
|
||||||
layout: 'fit',
|
|
||||||
width: 500,
|
|
||||||
height: 320,
|
|
||||||
resizable: true,
|
|
||||||
closable: true,
|
|
||||||
closeAction : 'hide',
|
|
||||||
modal: true,
|
|
||||||
autoScroll:true,
|
|
||||||
constrain: true,
|
|
||||||
items: [formCase]
|
|
||||||
});
|
|
||||||
|
|
||||||
function showCaseSummary(dataCase) {
|
|
||||||
if (dataCase) {
|
|
||||||
caseData = dataCase;
|
|
||||||
|
|
||||||
if(dataCase.STATUS == 'RESTORED'){
|
|
||||||
Ext.getCmp('BUTTON_UNARCHIVE_CASE').disable();
|
|
||||||
} else {
|
|
||||||
Ext.getCmp('BUTTON_UNARCHIVE_CASE').enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
appTitle.setText(dataCase.APP_TITLE, false);
|
|
||||||
process.setText(dataCase.PRO_UID, false);
|
|
||||||
processTitle.setText(dataCase.PRO_TITLE, false);
|
|
||||||
appUid.setText(dataCase.APP_UID, false);
|
|
||||||
caseNumber.setText(dataCase.CASE_NUMBER, false);
|
|
||||||
initUser.setText(dataCase.INIT_USER_NAME, false);
|
|
||||||
finishUser.setText(dataCase.FINISH_USER_NAME, false);
|
|
||||||
createDate.setText(renderDate(dataCase.CREATE_DATE, false));
|
|
||||||
finishDate.setText(renderDate(dataCase.FINISH_DATE, false));
|
|
||||||
fileName.setText(dataCase.FILENAME_TAR+'.tar', false);
|
|
||||||
statusCaseWin.setText(dataCase.STATUS, false);
|
|
||||||
|
|
||||||
summaryWindow.show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<dynaForm type="grid" name="ldapAdvanced/gridAttribute" enabletemplate="0" mode="">
|
|
||||||
<attributeLdap type="text" maxlength="64" validate="Any" required="0" readonly="0" size="15" mode="edit" btn_cancel="Cancel">
|
|
||||||
<en><![CDATA[LDAP Field]]></en>
|
|
||||||
<pt-BR><![CDATA[Campo LDAP]]></pt-BR>
|
|
||||||
</attributeLdap>
|
|
||||||
<attributeUser type="dropdown" required="0" readonly="0" mode="edit" options="Array" btn_cancel="Cancel">
|
|
||||||
<en><![CDATA[User Field]]></en>
|
|
||||||
<pt-BR><![CDATA[Campo de Usuário]]></pt-BR>
|
|
||||||
</attributeUser>
|
|
||||||
</dynaForm>
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<dynaForm name="Ldap Setup Form" type="xmlform" width="550">
|
|
||||||
<TITLE type="title" group="1">
|
|
||||||
<en><![CDATA[Ldap Advance Plugin]]></en>
|
|
||||||
<pt-BR><![CDATA[Ldap Plugin Adiantamento]]></pt-BR>
|
|
||||||
</TITLE>
|
|
||||||
<HelpText type="subtitle" maxlength="100" size="60">
|
|
||||||
<en><![CDATA[Please check the User Section in order to Synchronize or Import users from an authentication source using this plugin. There is no further configuration needed.]]></en>
|
|
||||||
<pt-BR><![CDATA[Por favor verifique a seção do usuário, a fim de sincronizar ou importar usuários a partir de uma fonte de autenticação usando este plugin. Não há nenhuma configuração adicional necessário.]]></pt-BR>
|
|
||||||
</HelpText>
|
|
||||||
</dynaForm>
|
|
||||||
@@ -1,215 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<dynaForm name="authSources/ldap_Edit" type="xmlform" width="650" enabletemplate="0" mode="">
|
|
||||||
<title type="title">
|
|
||||||
<en><![CDATA[Authentication Source Information]]></en>
|
|
||||||
<pt-BR><![CDATA[Informações de fonte de autenticação]]></pt-BR>
|
|
||||||
</title>
|
|
||||||
<AUTH_SOURCE_UID type="hidden"/>
|
|
||||||
<AUTH_SOURCE_NAME type="text" size="50" maxlength="50" required="1">
|
|
||||||
<en><![CDATA[Name]]></en>
|
|
||||||
<pt-BR><![CDATA[Nome]]></pt-BR>
|
|
||||||
</AUTH_SOURCE_NAME>
|
|
||||||
<AUTH_SOURCE_PROVIDER type="hidden" defaultValue="ldap"/>
|
|
||||||
<LDAP_TYPE type="dropdown" required="0">
|
|
||||||
<en><![CDATA[Type]]><option name="ldap"><![CDATA[OpenLDAP]]></option><option name="ad"><![CDATA[Active Directory]]></option><option name="ds"><![CDATA[389 DS]]></option></en>
|
|
||||||
<pt-BR><![CDATA[Tipo]]><option name="ldap"><![CDATA[OpenLDAP]]></option><option name="ad"><![CDATA[Active Directory]]></option><option name="ds"><![CDATA[389 DS]]></option></pt-BR>
|
|
||||||
</LDAP_TYPE>
|
|
||||||
<AUTH_SOURCE_AUTO_REGISTER type="dropdown">
|
|
||||||
<en><![CDATA[Enable automatic register]]><option name="0"><![CDATA[No]]></option><option name="1"><![CDATA[Yes]]></option></en>
|
|
||||||
<pt-BR><![CDATA[Ativado automatic registrar]]><option name="0"><![CDATA[Não]]></option><option name="1"><![CDATA[Sim]]></option></pt-BR>
|
|
||||||
</AUTH_SOURCE_AUTO_REGISTER>
|
|
||||||
<AUTH_SOURCE_SERVER_NAME type="text" size="50" maxlength="50" required="1">
|
|
||||||
<en><![CDATA[Server Address]]></en>
|
|
||||||
<pt-BR><![CDATA[Endereço do Servidor]]></pt-BR>
|
|
||||||
</AUTH_SOURCE_SERVER_NAME>
|
|
||||||
<AUTH_SOURCE_PORT type="text" size="5" maxlength="5" required="1" defaultValue="389" validate="Int">
|
|
||||||
<en><![CDATA[Port]]></en>
|
|
||||||
<pt-BR><![CDATA[Porto]]></pt-BR>
|
|
||||||
</AUTH_SOURCE_PORT>
|
|
||||||
<AUTH_SOURCE_ENABLED_TLS type="dropdown">
|
|
||||||
<en><![CDATA[Enabled TLS]]><option name="0"><![CDATA[No]]></option><option name="1"><![CDATA[Yes]]></option></en>
|
|
||||||
<pt-BR><![CDATA[Ativado TLS]]><option name="0"><![CDATA[Não]]></option><option name="1"><![CDATA[Sim]]></option></pt-BR>
|
|
||||||
</AUTH_SOURCE_ENABLED_TLS>
|
|
||||||
<AUTH_SOURCE_BASE_DN type="text" size="50" maxlength="128" required="1">
|
|
||||||
<en><![CDATA[Base DN]]></en>
|
|
||||||
<pt-BR><![CDATA[Base DN]]></pt-BR>
|
|
||||||
</AUTH_SOURCE_BASE_DN>
|
|
||||||
<AUTH_ANONYMOUS type="dropdown">
|
|
||||||
<en><![CDATA[Anonymous]]><option name="0"><![CDATA[No]]></option><option name="1"><![CDATA[Yes]]></option></en>
|
|
||||||
<pt-BR><![CDATA[anônimo]]><option name="0"><![CDATA[Não]]></option><option name="1"><![CDATA[Sim]]></option></pt-BR>
|
|
||||||
</AUTH_ANONYMOUS>
|
|
||||||
<AUTH_SOURCE_SEARCH_USER type="text" size="50" maxlength="128" required="0">
|
|
||||||
<en><![CDATA[Username]]></en>
|
|
||||||
<pt-BR><![CDATA[Usuário]]></pt-BR>
|
|
||||||
</AUTH_SOURCE_SEARCH_USER>
|
|
||||||
<AUTH_SOURCE_PASSWORD type="password" size="20" maxlength="32" required="0">
|
|
||||||
<en><![CDATA[Password]]></en>
|
|
||||||
<pt-BR><![CDATA[Senha]]></pt-BR>
|
|
||||||
</AUTH_SOURCE_PASSWORD>
|
|
||||||
<AUTH_SOURCE_IDENTIFIER_FOR_USER type="text" size="20" maxlength="20" required="1" defaultValue="uid">
|
|
||||||
<en><![CDATA[User Identifier]]></en>
|
|
||||||
<pt-BR><![CDATA[Identificador de usuário]]></pt-BR>
|
|
||||||
</AUTH_SOURCE_IDENTIFIER_FOR_USER>
|
|
||||||
<AUTH_SOURCE_USERS_FILTER type="text" size="50" maxlength="200" required="0" defaultValue="">
|
|
||||||
<en><![CDATA[Filter to search users (Default set to (&(!(objectClass=organizationalUnit))))]]></en>
|
|
||||||
<pt-BR><![CDATA[Filtro para os usuários de busca (Default set to (&(!(objectClass=organizationalUnit))))]]></pt-BR>
|
|
||||||
</AUTH_SOURCE_USERS_FILTER>
|
|
||||||
<AUTH_SOURCE_RETIRED_OU type="text" size="50" maxlength="128" required="0">
|
|
||||||
<en><![CDATA[OU for Retired Employees OU]]></en>
|
|
||||||
<pt-BR><![CDATA[OU ao Aposentado UO]]></pt-BR>
|
|
||||||
</AUTH_SOURCE_RETIRED_OU>
|
|
||||||
<AUTH_SOURCE_ATTRIBUTE_IDS type="hidden"/>
|
|
||||||
<AUTH_SOURCE_SHOWGRID_FLAG type="hidden"/>
|
|
||||||
<AUTH_SOURCE_GRID_TEXT type="hidden"/>
|
|
||||||
<AUTH_SOURCE_ATTRIBUTE_SUBTITLE type="subtitle" enablehtml="1" btn_cancel="Cancel" required="0" readonly="0" savelabel="0">
|
|
||||||
<en><![CDATA[<input type="checkbox" name="form[AUTH_SOURCE_SHOWGRID]" id="form[AUTH_SOURCE_SHOWGRID]"> Match attributes to sync]]></en>
|
|
||||||
<pt-BR><![CDATA[<input type="checkbox" name="form[AUTH_SOURCE_SHOWGRID]" id="form[AUTH_SOURCE_SHOWGRID]"> Combinar atributos para sincronizar]]></pt-BR>
|
|
||||||
</AUTH_SOURCE_ATTRIBUTE_SUBTITLE>
|
|
||||||
<AUTH_SOURCE_GRID_ATTRIBUTE type="grid" xmlgrid="ldapAdvanced/gridAttribute" addrow="1" deleterow="1" btn_cancel="Cancel"/>
|
|
||||||
<SUBTITLETESTCONNECTION type="subtitle">
|
|
||||||
<en><![CDATA[Minimum data required to run the "Test Connection": "Server Address, Port, Enabled TLS, Anonymous, Username, Password"]]></en>
|
|
||||||
<pt-BR><![CDATA[Dados mínimos necessários para executar o "Test Connection": "Server Address, Port, TLS Habilitado, Anonymous, Nome de usuário, Senha"]]></pt-BR>
|
|
||||||
</SUBTITLETESTCONNECTION>
|
|
||||||
<btnSave type="submit">
|
|
||||||
<en><![CDATA[Save]]></en>
|
|
||||||
<pt-BR><![CDATA[Salvar]]></pt-BR>
|
|
||||||
</btnSave>
|
|
||||||
<BTNTESTCONNECTION type="button" onclick="testConnection();">
|
|
||||||
<en><![CDATA[Test connection]]></en>
|
|
||||||
<pt-BR><![CDATA[Teste de conexão]]></pt-BR>
|
|
||||||
</BTNTESTCONNECTION>
|
|
||||||
<btnCancel type="button" onclick="history.go(-1);">
|
|
||||||
<en><![CDATA[Cancel]]></en>
|
|
||||||
<pt-BR><![CDATA[Cancel]]></pt-BR>
|
|
||||||
</btnCancel>
|
|
||||||
<JS type="javascript"><![CDATA[
|
|
||||||
|
|
||||||
var dynaformOnload = function() {
|
|
||||||
getField('AUTH_SOURCE_SHOWGRID').checked = (getField('AUTH_SOURCE_SHOWGRID_FLAG').value == 1) ? true : false;
|
|
||||||
var fieldGridTd = getField('AUTH_SOURCE_GRID_ATTRIBUTE').parentNode.parentNode.parentNode;
|
|
||||||
fieldGridTd.style.display = 'none';
|
|
||||||
leimnud.event.add(getField('AUTH_ANONYMOUS'), 'change', hideShowSearchUser);
|
|
||||||
leimnud.event.add(getField('LDAP_TYPE'), 'change', hideShowSuggest);
|
|
||||||
leimnud.event.add(getField('AUTH_SOURCE_SHOWGRID'), 'click', showGrid);
|
|
||||||
hideShowSearchUser();
|
|
||||||
hideShowSuggest();
|
|
||||||
showGrid();
|
|
||||||
|
|
||||||
var valuesDrop = getField('AUTH_SOURCE_ATTRIBUTE_IDS').value;
|
|
||||||
valuesDropArray = valuesDrop.split('|');
|
|
||||||
|
|
||||||
for (var i = 0 ; i < valuesDropArray.length ; i++) {
|
|
||||||
if (valuesDropArray[i] != '') {
|
|
||||||
var iRows = Number_Rows_Grid('AUTH_SOURCE_GRID_ATTRIBUTE','attributeLdap');
|
|
||||||
for (cont=1 ; cont<=iRows ; cont=cont+1) {
|
|
||||||
eval(" var newOption = document.createElement('option'); newOption.text = valuesDropArray[i]; newOption.value = valuesDropArray[i]; try { getField('AUTH_SOURCE_GRID_ATTRIBUTE][" + cont + "][attributeUser').add(newOption, null);} catch(ex) { getField('AUTH_SOURCE_GRID_ATTRIBUTE][" + cont + "][attributeUser').add(newOption);}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var valuesGrid = getField('AUTH_SOURCE_GRID_TEXT').value;
|
|
||||||
valuesGridArray = valuesGrid.split('|');
|
|
||||||
var fil = 1;
|
|
||||||
for (var i = 0 ; i < valuesGridArray.length ; i++) {
|
|
||||||
if(valuesGridArray[i] != '')
|
|
||||||
{
|
|
||||||
var valuesFielddGrid = valuesGridArray[i].split("/");
|
|
||||||
getField('AUTH_SOURCE_GRID_ATTRIBUTE][' + fil + '][attributeUser').value = valuesFielddGrid['1'];
|
|
||||||
fil++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function showGrid() {
|
|
||||||
if (getField('AUTH_SOURCE_SHOWGRID').checked == true) {
|
|
||||||
fieldGridTd.style.display = 'block';
|
|
||||||
fieldGridTd.removeAttribute("style",0);
|
|
||||||
} else {
|
|
||||||
fieldGridTd.style.display = 'none';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var hideShowSearchUser = function() {
|
|
||||||
if (getField('AUTH_ANONYMOUS').value == '1') {
|
|
||||||
hideRowById('AUTH_SOURCE_SEARCH_USER');
|
|
||||||
hideRowById('AUTH_SOURCE_PASSWORD');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
showRowById('AUTH_SOURCE_SEARCH_USER');
|
|
||||||
showRowById('AUTH_SOURCE_PASSWORD');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
var hideShowSuggest = function ()
|
|
||||||
{
|
|
||||||
getField("AUTH_SOURCE_IDENTIFIER_FOR_USER").value = (getField("LDAP_TYPE").value == "ad")? "samaccountname" : "uid";
|
|
||||||
};
|
|
||||||
|
|
||||||
var testConnection = function ()
|
|
||||||
{
|
|
||||||
var strArgs = "functionAccion=ldapTestConnection&";
|
|
||||||
strArgs += "AUTH_SOURCE_SERVER_NAME=" + getField("AUTH_SOURCE_SERVER_NAME").value + "&";
|
|
||||||
strArgs += "AUTH_SOURCE_PORT=" + getField("AUTH_SOURCE_PORT").value + "&";
|
|
||||||
strArgs += "AUTH_SOURCE_ENABLED_TLS=" + getField("AUTH_SOURCE_ENABLED_TLS").value + "&";
|
|
||||||
strArgs += "AUTH_ANONYMOUS=" + getField("AUTH_ANONYMOUS").value + "&";
|
|
||||||
strArgs += "AUTH_SOURCE_SEARCH_USER=" + getField("AUTH_SOURCE_SEARCH_USER").value + "&";
|
|
||||||
strArgs += "AUTH_SOURCE_PASSWORD=" + getField("AUTH_SOURCE_PASSWORD").value + "&";
|
|
||||||
strArgs += "AUTH_SOURCE_VERSION=3";
|
|
||||||
|
|
||||||
var rpcAjax = new leimnud.module.rpc.xmlhttp({
|
|
||||||
url: "../ldapAdvanced/controllers/ldapAdvancedProxy.php",
|
|
||||||
method: "POST",
|
|
||||||
args: strArgs
|
|
||||||
});
|
|
||||||
|
|
||||||
rpcAjax.callback = function (rpc)
|
|
||||||
{
|
|
||||||
var dataResponse = rpc.xmlhttp.responseText.parseJSON();
|
|
||||||
|
|
||||||
if (dataResponse.status) {
|
|
||||||
var panel = new leimnud.module.panel();
|
|
||||||
|
|
||||||
panel.options = {
|
|
||||||
statusBarButtons: [{value: _("ID_ACCEPT")}],
|
|
||||||
position: {center: true},
|
|
||||||
size: {
|
|
||||||
w: 400,
|
|
||||||
h: 125
|
|
||||||
},
|
|
||||||
control: {
|
|
||||||
close: true,
|
|
||||||
resize: false
|
|
||||||
},
|
|
||||||
fx: {modal: true}
|
|
||||||
};
|
|
||||||
|
|
||||||
panel.setStyle = {
|
|
||||||
content:{
|
|
||||||
padding: 10,
|
|
||||||
paddingLeft: 50,
|
|
||||||
textAlign: "left",
|
|
||||||
background: "url(/images/" + ((dataResponse.status == "OK")? "dialog-ok-apply" : "error") + ".png)",
|
|
||||||
backgroundRepeat: "no-repeat",
|
|
||||||
backgroundPosition: "2% 10%",
|
|
||||||
backgroundColor: "transparent",
|
|
||||||
borderWidth: 0
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
panel.make();
|
|
||||||
panel.addContent((dataResponse.status == "OK")? "Successfully connected" : dataResponse.message);
|
|
||||||
panel.fixContent();
|
|
||||||
panel.elements.statusBarButtons[0].onmouseup = function ()
|
|
||||||
{
|
|
||||||
panel.remove();
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}.extend(this);
|
|
||||||
}
|
|
||||||
}.extend(this);
|
|
||||||
|
|
||||||
rpcAjax.make();
|
|
||||||
};
|
|
||||||
]]></JS>
|
|
||||||
</dynaForm>
|
|
||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Bandera para habilitar nueva interfaz extjs
|
|
||||||
Reference in New Issue
Block a user