Verified Commit 323a3c8c authored by Côme Chilliet's avatar Côme Chilliet
Browse files

🚑 fix(freeradius) Use standard attribute for group selection

issue #6040
parent 1b4941bd
......@@ -73,9 +73,11 @@ class freeradiusAccount extends simplePlugin
'name' => _('Groups'),
'attrs' => [
new SetAttribute(
new SelectAttribute(
new ObjectSelectAttribute(
_('Groups'), _('FreeRadius Groups'),
'radiusGroupName', FALSE
'radiusGroupName', FALSE,
['group'], 'cn', 'cn',
'(objectClass=radiusprofile)'
)
),
],
......@@ -161,22 +163,4 @@ class freeradiusAccount extends simplePlugin
],
];
}
/*!
* \brief Constructor of the freeradiusAccount
* It will build the select groups choices
*/
function __construct (string $dn = NULL, $object = NULL, $parent = NULL, bool $mainTab = FALSE)
{
global $config;
parent::__construct($dn, $object, $parent, $mainTab);
$ldap = $config->get_ldap_link();
$ldap->cd($config->current['BASE']);
$ldap->search('(&(objectClass=radiusprofile)(cn=*))', ['cn']);
$groups = [];
while ($attrs = $ldap->fetch()) {
$groups[] = $attrs['cn'][0];
}
$this->attributesAccess['radiusGroupName']->attribute->setChoices($groups);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment