if (isset($this->data['change_bind_password']) || zbx_empty($this->data['config']['ldap_bind_password'])) { $authenticationForm->addVar('change_bind_password', 1); $authenticationFormList->addRow(_('Bind password'), new CPassBox('ldap_bind_password', null, ZBX_TEXTBOX_SMALL_SIZE)); } else { $authenticationFormList->addRow(_('Bind password'), new CSubmit('change_bind_password', _('Change password'), null, 'formlist')); } $authenticationFormList->addRow(_('Test authentication'), ' [' . _('must be a valid LDAP user') . ']'); $authenticationFormList->addRow(_('Login'), $userComboBox); $authenticationFormList->addRow(_('User password'), new CPassBox('user_password', null, ZBX_TEXTBOX_SMALL_SIZE)); } // append form list to tab $authenticationTab = new CTabView(); $authenticationTab->addTab('authenticationTab', $this->data['title'], $authenticationFormList); // append tab to form $authenticationForm->addItem($authenticationTab); // create save button $saveButton = new CSubmit('save', _('Save')); if ($this->data['is_authentication_type_changed']) { $saveButton->addAction('onclick', 'javascript: ' . 'if (Confirm("' . _('Switching authentication method will reset all except this session! Continue?') . '")) {' . 'jQuery("#authenticationForm").submit(); return true; } else { return false; }'); } elseif ($this->data['config']['authentication_type'] != ZBX_AUTH_LDAP) { $saveButton->setAttribute('disabled', 'true'); } // append buttons to form if ($this->data['config']['authentication_type'] == ZBX_AUTH_LDAP) { $authenticationForm->addItem(makeFormFooter($saveButton, new CSubmit('test', _('Test')))); } else { $authenticationForm->addItem(makeFormFooter($saveButton)); } // append form to widget $authenticationWidget->addItem($authenticationForm); return $authenticationWidget;