Commit 85798c41 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:sparkles: feat(opsi) Add an option to inherit profile and server from group

It stores special value "inherited" in the LDAP for profile and server,
 argonaut will need to be adapted.

issue #5787
parent b68b9fbc
No related merge requests found
Showing with 19 additions and 0 deletions
+19 -0
......@@ -123,6 +123,14 @@ class opsiClient extends simplePlugin
}
}
function prepare_save()
{
if ($this->fdOpsiProfileDn == 'inherited') {
$this->fdOpsiServerDn = 'inherited';
}
return parent::prepare_save();
}
function save()
{
global $config;
......@@ -284,6 +292,17 @@ class opsiClient extends simplePlugin
$profilesdn[] = $attrs['dn'];
$profileslabel[] = $attrs['cn'][0];
}
if ($this->member_of_group && isset($this->group_attrs['fdOpsiProfileDn'][0])) {
$profilesdn[] = 'inherited';
$profileslabel[] = sprintf(_('Inherited (%s)'), ldap_explode_dn($this->group_attrs['fdOpsiProfileDn'][0], 1)[0]);
$this->attributesAccess['fdOpsiProfileDn']->setManagedAttributes(
array(
'disable' => array(
'inherited' => array('fdOpsiServerDn')
)
)
);
}
$this->attributesAccess['fdOpsiProfileDn']->setChoices($profilesdn, $profileslabel);
$s_daemon = new supportDaemon();
......
Supports Markdown
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