Source
_('memberOf is a preferable way to configure groups because it is faster. Use groupOfNames if your LDAP server does not support memberOf or group filtering is required.')
<?php declare(strict_types = 0);
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/**
* @var CView $this
* @var array $data
*/
$form_action = (new CUrl('zabbix.php'))
->setArgument('action', 'popup.ldap.check')
->getUrl();
$form = (new CForm('post', $form_action))
->addItem(getMessages())
->addVar('row_index', $data['row_index'])
->addVar('userdirectoryid', $data['userdirectoryid']);
// Enable form submitting on Enter.
$form->addItem((new CSubmitButton())->addClass(ZBX_STYLE_FORM_SUBMIT_HIDDEN));
$form
->addItem((new CFormGrid())
->addItem([
(new CLabel(_('Name'), 'name'))->setAsteriskMark(),
new CFormField(
(new CTextBox('name', $data['name'], false, DB::getFieldLength('userdirectory', 'name')))
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->setAriaRequired()
->setAttribute('autofocus', 'autofocus')
)
])
->addItem([
(new CLabel(_('Host'), 'host'))->setAsteriskMark(),
new CFormField(
(new CTextBox('host', $data['host'], false, DB::getFieldLength('userdirectory_ldap', 'host')))
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->setAriaRequired()
)
])
->addItem([
(new CLabel(_('Port'), 'port'))->setAsteriskMark(),
new CFormField(
(new CNumericBox('port', $data['port'], 5, false, false, false))
->setWidth(ZBX_TEXTAREA_NUMERIC_STANDARD_WIDTH)
->setAriaRequired()
)
])
->addItem([
(new CLabel(_('Base DN'), 'base_dn'))->setAsteriskMark(),
new CFormField(