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

🚑 fix(management) Fix PHP errors in class UsersGroupsRolesAttribute

issue #5135
parent 44565e55
......@@ -36,9 +36,10 @@ class selectManagement extends management
array('LinkColumn', array('attributes' => 'description', 'label' => 'Description')),
);
function __construct($objectTypes = FALSE, $multiSelect = TRUE)
function __construct($objectTypes = FALSE, $multiSelect = TRUE, $neededAttrs = array())
{
$this->multiSelect = $multiSelect;
$this->neededAttrs = $neededAttrs;
$this->multiSelect = $multiSelect;
parent::__construct($objectTypes);
}
......
......@@ -509,7 +509,15 @@ class ObjectsAttribute extends GenericDialogAttribute
function __construct ($label, $description, $ldapName, $required, array $objectTypes, $defaultValue = array(), $store_attr = 'dn', $display_attr = 'cn', $acl = '')
{
parent::__construct($label, $description, $ldapName, $required, $defaultValue, $store_attr, $display_attr, $acl);
$this->selectManagementParameters = array($objectTypes, TRUE);
$this->selectManagementParameters = array(
$objectTypes,
TRUE,
array(
'objectClass' => '*',
$store_attr => (($store_attr == 'dn') ? 'raw' : 1),
$display_attr => (($display_attr == 'dn') ? 'raw' : 1),
)
);
}
}
......@@ -537,11 +545,14 @@ class UsersGroupsRolesAttribute extends ObjectsAttribute
function __construct ($label, $description, $ldapName, $required = FALSE, $defaultValue = array(), $store_attr = 'dn', $display_attr = 'cn', $acl = '')
{
parent::__construct($label, $description, $ldapName, $required, array('user', 'group', 'role', 'ogroup'), $defaultValue, $store_attr, $display_attr, $acl);
$this->selectManagementParameters[2]['cn'] = 1;
$this->selectManagementParameters[2]['uid'] = 1;
$this->selectManagementParameters[2]['objectClass'] = '*';
}
protected function ldapAttributesToGet ()
{
return array('cn', 'uid', 'objectClass');
return array_unique(array($store_attr, $display_attr, 'cn', 'uid', 'objectClass'));
  • Review the data-flow - use of uninitialized value. 📘 Review the data-flow - use of uninitialized value. 📘

Please register or sign in to reply
}
protected function fillDisplayValueFrom ($i, $attrs)
......
  • SonarQube analysis reported 2 issues

    • 2 major

    Watch the comments in this conversation to review them.

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