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

Fixes #4195 Avoiding problems with incomplete object groups nodes

parent 78570cde
......@@ -50,8 +50,12 @@ class groupManagement extends simpleManagement
static function filterProperties($row, $dn, $gosaGroupObjects = NULL)
{
if (!empty($gosaGroupObjects)) {
return self::filterGroupObjects($row, $gosaGroupObjects);
if (objects::isOfType($attrs, 'ogroup')) {
if (empty($gosaGroupObjects)) {
return ' ';
} else {
return self::filterGroupObjects($row, $gosaGroupObjects);
}
}
global $config;
static $grouptabs = array();
......@@ -71,9 +75,9 @@ class groupManagement extends simpleManagement
// Load information if needed
$ldap = $config->get_ldap_link();
$ldap->cat($dn);
$result = "<input class='center' type='image' src='geticon.php?context=types&amp;icon=user-group&amp;size=16' ".
"alt='"._('Posix')."' title='"._('Edit posix properties')."' ".
"name='listing_edit_tab_group_$row' style='padding:1px'/>";
$result = '<input class="center" type="image" src="geticon.php?context=types&amp;icon=user-group&amp;size=16" '.
'alt="'._('Posix').'" title="'._('Edit posix properties').'" '.
'name="listing_edit_tab_group_'.$row.'" style="padding:1px"/>';
if ($attrs = $ldap->fetch()) {
if (objects::isOfType($attrs, 'role')) {
return '<input class="center" type="image" src="geticon.php?context=types&amp;icon=role&amp;size=16" '.
......@@ -84,9 +88,9 @@ class groupManagement extends simpleManagement
if ($grouptab->is_this_account($attrs)) {
$infos = pluglist::pluginInfos($class);
if (isset($infos['plSmallIcon'])) {
$result .= "<input class='center' type='image' src='".htmlentities($infos['plSmallIcon'], ENT_COMPAT, 'UTF-8')."' ".
"alt='".$infos['plShortName']."' title='".$infos['plShortName']."' ".
"name='listing_edit_tab_".$class."_$row' style='padding:1px'/>";
$result .= '<input class="center" type="image" src="'.htmlentities($infos['plSmallIcon'], ENT_COMPAT, 'UTF-8').'" '.
'alt="'.$infos['plShortName'].'" title="'.$infos['plShortName'].'" '.
'name="listing_edit_tab_'.$class.'_'.$row.'" style="padding:1px"/>';
} else {
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $infos['plShortName']." ($class)", 'No icon for');
}
......@@ -101,8 +105,8 @@ class groupManagement extends simpleManagement
static function filterGroupObjects($row, $gosaGroupObjects)
{
$types = preg_replace("/[^a-z]/i", "", $gosaGroupObjects[0]);
$result = "";
$types = preg_replace('/[^a-z]/i', '', $gosaGroupObjects[0]);
$result = '';
for ($i = 0; $i < strlen($types); $i++) {
if ($types[$i] == 'I') {
continue;
......@@ -111,7 +115,7 @@ class groupManagement extends simpleManagement
$result .= '<img class="center" src="'.htmlentities($info['icon'], ENT_COMPAT, 'UTF-8').'" '.
'alt="'.$info['name'].'" title="'.$info['name'].'" style="padding:1px"/>';
}
if ($result == "") {
if ($result == '') {
return '&nbsp;';
}
return $result;
......
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