]>
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 onGetValues: function(values
) {
89 Proxmox
.Utils
.assemble_field_data(values
, { 'delete': 'verify' });
94 return me
.callParent([values
]);
98 Ext
.define('PVE.panel.LDAPSyncInputPanel', {
99 extend
: 'Proxmox.panel.InputPanel',
100 xtype
: 'pveAuthLDAPSyncPanel',
102 editableAttributes
: ['email'],
103 editableDefaults
: ['scope', 'enable-new'],
107 // (de)construct the sync-attributes from the list above,
108 // not touching all others
109 onGetValues: function(values
) {
111 me
.editableDefaults
.forEach((attr
) => {
113 me
.default_opts
[attr
] = values
[attr
];
116 delete me
.default_opts
[attr
];
119 let vanished_opts
= [];
120 ['acl', 'entry', 'properties'].forEach((prop
) => {
121 if (values
[`remove-vanished-${prop}`]) {
122 vanished_opts
.push(prop
);
124 delete values
[`remove-vanished-${prop}`];
126 me
.default_opts
['remove-vanished'] = vanished_opts
.join(';');
128 values
['sync-defaults-options'] = PVE
.Parser
.printPropertyString(me
.default_opts
);
129 me
.editableAttributes
.forEach((attr
) => {
131 me
.sync_attributes
[attr
] = values
[attr
];
134 delete me
.sync_attributes
[attr
];
137 values
.sync_attributes
= PVE
.Parser
.printPropertyString(me
.sync_attributes
);
139 PVE
.Utils
.delete_if_default(values
, 'sync-defaults-options');
140 PVE
.Utils
.delete_if_default(values
, 'sync_attributes');
142 // Force values.delete to be an array
143 if (typeof values
.delete === 'string') {
144 values
.delete = values
.delete.split(',');
148 delete values
.delete; // on create we cannot delete values
154 setValues: function(values
) {
156 if (values
.sync_attributes
) {
157 me
.sync_attributes
= PVE
.Parser
.parsePropertyString(values
.sync_attributes
);
158 delete values
.sync_attributes
;
159 me
.editableAttributes
.forEach((attr
) => {
160 if (me
.sync_attributes
[attr
]) {
161 values
[attr
] = me
.sync_attributes
[attr
];
165 if (values
['sync-defaults-options']) {
166 me
.default_opts
= PVE
.Parser
.parsePropertyString(values
['sync-defaults-options']);
167 delete values
.default_opts
;
168 me
.editableDefaults
.forEach((attr
) => {
169 if (me
.default_opts
[attr
]) {
170 values
[attr
] = me
.default_opts
[attr
];
174 if (me
.default_opts
['remove-vanished']) {
175 let opts
= me
.default_opts
['remove-vanished'].split(';');
176 for (const opt
of opts
) {
177 values
[`remove-vanished-${opt}`] = 1;
181 return me
.callParent([values
]);
186 xtype
: 'proxmoxtextfield',
189 emptyText
: Proxmox
.Utils
.noneText
,
190 fieldLabel
: gettext('Bind User'),
193 xtype
: 'proxmoxtextfield',
194 inputType
: 'password',
196 emptyText
: gettext('Unchanged'),
197 fieldLabel
: gettext('Bind Password'),
200 xtype
: 'proxmoxtextfield',
202 fieldLabel
: gettext('E-Mail attribute'),
205 xtype
: 'proxmoxtextfield',
206 name
: 'group_name_attr',
208 fieldLabel
: gettext('Groupname attr.'),
211 xtype
: 'displayfield',
212 value
: gettext('Default Sync Options'),
215 xtype
: 'proxmoxKVComboBox',
217 emptyText
: Proxmox
.Utils
.NoneText
,
218 fieldLabel
: gettext('Scope'),
219 value
: '__default__',
222 ['__default__', Proxmox
.Utils
.NoneText
],
223 ['users', gettext('Users')],
224 ['groups', gettext('Groups')],
225 ['both', gettext('Users and Groups')],
232 xtype
: 'proxmoxtextfield',
233 name
: 'user_classes',
234 fieldLabel
: gettext('User classes'),
236 emptyText
: 'inetorgperson, posixaccount, person, user',
239 xtype
: 'proxmoxtextfield',
240 name
: 'group_classes',
241 fieldLabel
: gettext('Group classes'),
243 emptyText
: 'groupOfNames, group, univentionGroup, ipausergroup',
246 xtype
: 'proxmoxtextfield',
248 fieldLabel
: gettext('User Filter'),
252 xtype
: 'proxmoxtextfield',
253 name
: 'group_filter',
254 fieldLabel
: gettext('Group Filter'),
259 xtype
: 'displayfield',
263 xtype
: 'proxmoxKVComboBox',
264 value
: '__default__',
270 gettext("{0} ({1})"),
271 Proxmox
.Utils
.yesText
,
272 Proxmox
.Utils
.defaultText
,
275 ['1', Proxmox
.Utils
.yesText
],
276 ['0', Proxmox
.Utils
.noText
],
279 fieldLabel
: gettext('Enable new users'),
286 title
: gettext('Remove Vanished Options'),
289 xtype
: 'proxmoxcheckbox',
290 fieldLabel
: gettext('ACL'),
291 name
: 'remove-vanished-acl',
292 boxLabel
: gettext('Remove ACLs of vanished users and groups.'),
295 xtype
: 'proxmoxcheckbox',
296 fieldLabel
: gettext('Entry'),
297 name
: 'remove-vanished-entry',
298 boxLabel
: gettext('Remove vanished user and group entries.'),
301 xtype
: 'proxmoxcheckbox',
302 fieldLabel
: gettext('Properties'),
303 name
: 'remove-vanished-properties',
304 boxLabel
: gettext('Remove vanished properties from synced users.'),