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

Fixes #4208 Truncating description at 50 chars if needed

Showing with 15 additions and 1 deletion
+15 -1
......@@ -79,6 +79,9 @@ class userRoles extends simplePlugin
foreach($groupsattrs as $dn => $groupattr) {
$groupDisplay = $groupattr['cn'];
if(isset($groupattr['description'])) {
if (strlen($groupattr['description']) > 50) {
$groupattr['description'] = substr($groupattr['description'], 0, 50).'…';
}
$groupDisplay .= ' ['.$groupattr['description'].']';
}
$groups[$dn] = $groupDisplay;
......@@ -100,7 +103,18 @@ class userRoles extends simplePlugin
}
/* Roles handling */
$roles = objects::ls('role');
$roles = array();
$rolesattrs = objects::ls('role', array('cn' => 1, 'description' => 1));
foreach($rolesattrs as $dn => $roleattr) {
$roleDisplay = $roleattr['cn'];
if(isset($roleattr['description'])) {
if (strlen($roleattr['description']) > 50) {
$roleattr['description'] = substr($roleattr['description'], 0, 50).'…';
}
$roleDisplay .= ' ['.$roleattr['description'].']';
}
$roles[$dn] = $roleDisplay;
}
$this->attributesAccess['rolesMembership']->setInLdap(FALSE);
$this->attributesAccess['rolesMembership']->attribute->setChoices(array_keys($roles), array_values($roles));
if ($this->is_template) {
......
  • bmortier @bmortier

    mentioned in issue #1385

    By kiorky on 2017-09-02T15:24:50 (imported from GitLab)

    ·

    mentioned in issue #1385

    By kiorky on 2017-09-02T15:24:50 (imported from GitLab)

    Toggle commit list
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