]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/dc/AuthEditLDAP.js
1 Ext
.define('PVE.panel.LDAPInputPanel', {
2 extend
: 'PVE.panel.AuthBase',
3 xtype
: 'pveAuthLDAPPanel',
5 initComponent: function() {
8 if (me
.type
!== 'ldap') {
16 fieldLabel
: gettext('Base Domain Name'),
17 emptyText
: 'CN=Users,DC=Company,DC=net',
23 emptyText
: 'uid / sAMAccountName',
24 fieldLabel
: gettext('User Attribute Name'),
32 fieldLabel
: gettext('Server'),
37 xtype
: 'proxmoxtextfield',
38 fieldLabel
: gettext('Fallback Server'),
39 deleteEmpty
: !me
.isCreate
,
43 xtype
: 'proxmoxintegerfield',
45 fieldLabel
: gettext('Port'),
48 emptyText
: gettext('Default'),
49 submitEmptyText
: false,
52 xtype
: 'proxmoxcheckbox',
57 change: function(field
, newValue
) {
58 let verifyCheckbox
= field
.nextSibling('proxmoxcheckbox[name=verify]');
59 if (newValue
=== true) {
60 verifyCheckbox
.enable();
62 verifyCheckbox
.disable();
63 verifyCheckbox
.setValue(0);
69 xtype
: 'proxmoxcheckbox',
70 fieldLabel
: gettext('Verify Certificate'),
77 'data-qtip': gettext('Verify SSL certificate of the server'),
84 xtype
: 'proxmoxcheckbox',
85 fieldLabel
: gettext('Check connection'),
86 name
: 'check-connection',
92 gettext('Verify connection parameters and bind credentials on save'),
99 onGetValues: function(values
) {
102 if (!values
.verify
) {
104 Proxmox
.Utils
.assemble_field_data(values
, { 'delete': 'verify' });
106 delete values
.verify
;
109 return me
.callParent([values
]);
113 Ext
.define('PVE.panel.LDAPSyncInputPanel', {
114 extend
: 'Proxmox.panel.InputPanel',
115 xtype
: 'pveAuthLDAPSyncPanel',
117 editableAttributes
: ['email'],
118 editableDefaults
: ['scope', 'enable-new'],
122 // (de)construct the sync-attributes from the list above,
123 // not touching all others
124 onGetValues: function(values
) {
126 me
.editableDefaults
.forEach((attr
) => {
128 me
.default_opts
[attr
] = values
[attr
];
131 delete me
.default_opts
[attr
];
134 let vanished_opts
= [];
135 ['acl', 'entry', 'properties'].forEach((prop
) => {
136 if (values
[`remove-vanished-${prop}`]) {
137 vanished_opts
.push(prop
);
139 delete values
[`remove-vanished-${prop}`];
141 me
.default_opts
['remove-vanished'] = vanished_opts
.join(';');
143 values
['sync-defaults-options'] = PVE
.Parser
.printPropertyString(me
.default_opts
);
144 me
.editableAttributes
.forEach((attr
) => {
146 me
.sync_attributes
[attr
] = values
[attr
];
149 delete me
.sync_attributes
[attr
];
152 values
.sync_attributes
= PVE
.Parser
.printPropertyString(me
.sync_attributes
);
154 PVE
.Utils
.delete_if_default(values
, 'sync-defaults-options');
155 PVE
.Utils
.delete_if_default(values
, 'sync_attributes');
157 // Force values.delete to be an array
158 if (typeof values
.delete === 'string') {
159 values
.delete = values
.delete.split(',');
163 delete values
.delete; // on create we cannot delete values
169 setValues: function(values
) {
171 if (values
.sync_attributes
) {
172 me
.sync_attributes
= PVE
.Parser
.parsePropertyString(values
.sync_attributes
);
173 delete values
.sync_attributes
;
174 me
.editableAttributes
.forEach((attr
) => {
175 if (me
.sync_attributes
[attr
]) {
176 values
[attr
] = me
.sync_attributes
[attr
];
180 if (values
['sync-defaults-options']) {
181 me
.default_opts
= PVE
.Parser
.parsePropertyString(values
['sync-defaults-options']);
182 delete values
.default_opts
;
183 me
.editableDefaults
.forEach((attr
) => {
184 if (me
.default_opts
[attr
]) {
185 values
[attr
] = me
.default_opts
[attr
];
189 if (me
.default_opts
['remove-vanished']) {
190 let opts
= me
.default_opts
['remove-vanished'].split(';');
191 for (const opt
of opts
) {
192 values
[`remove-vanished-${opt}`] = 1;
196 return me
.callParent([values
]);
201 xtype
: 'proxmoxtextfield',
204 emptyText
: Proxmox
.Utils
.noneText
,
205 fieldLabel
: gettext('Bind User'),
208 xtype
: 'proxmoxtextfield',
209 inputType
: 'password',
211 emptyText
: gettext('Unchanged'),
212 fieldLabel
: gettext('Bind Password'),
215 xtype
: 'proxmoxtextfield',
217 fieldLabel
: gettext('E-Mail attribute'),
220 xtype
: 'proxmoxtextfield',
221 name
: 'group_name_attr',
223 fieldLabel
: gettext('Groupname attr.'),
226 xtype
: 'displayfield',
227 value
: gettext('Default Sync Options'),
230 xtype
: 'proxmoxKVComboBox',
232 emptyText
: Proxmox
.Utils
.NoneText
,
233 fieldLabel
: gettext('Scope'),
234 value
: '__default__',
237 ['__default__', Proxmox
.Utils
.NoneText
],
238 ['users', gettext('Users')],
239 ['groups', gettext('Groups')],
240 ['both', gettext('Users and Groups')],
247 xtype
: 'proxmoxtextfield',
248 name
: 'user_classes',
249 fieldLabel
: gettext('User classes'),
251 emptyText
: 'inetorgperson, posixaccount, person, user',
254 xtype
: 'proxmoxtextfield',
255 name
: 'group_classes',
256 fieldLabel
: gettext('Group classes'),
258 emptyText
: 'groupOfNames, group, univentionGroup, ipausergroup',
261 xtype
: 'proxmoxtextfield',
263 fieldLabel
: gettext('User Filter'),
267 xtype
: 'proxmoxtextfield',
268 name
: 'group_filter',
269 fieldLabel
: gettext('Group Filter'),
274 xtype
: 'displayfield',
278 xtype
: 'proxmoxKVComboBox',
279 value
: '__default__',
285 gettext("{0} ({1})"),
286 Proxmox
.Utils
.yesText
,
287 Proxmox
.Utils
.defaultText
,
290 ['1', Proxmox
.Utils
.yesText
],
291 ['0', Proxmox
.Utils
.noText
],
294 fieldLabel
: gettext('Enable new users'),
301 title
: gettext('Remove Vanished Options'),
304 xtype
: 'proxmoxcheckbox',
305 fieldLabel
: gettext('ACL'),
306 name
: 'remove-vanished-acl',
307 boxLabel
: gettext('Remove ACLs of vanished users and groups.'),
310 xtype
: 'proxmoxcheckbox',
311 fieldLabel
: gettext('Entry'),
312 name
: 'remove-vanished-entry',
313 boxLabel
: gettext('Remove vanished user and group entries.'),
316 xtype
: 'proxmoxcheckbox',
317 fieldLabel
: gettext('Properties'),
318 name
: 'remove-vanished-properties',
319 boxLabel
: gettext('Remove vanished properties from synced users.'),