Skip to content

Commit

Permalink
Merge pull request #66 from Worteks/issue-60
Browse files Browse the repository at this point in the history
Sort values when displaying entry (#60)
  • Loading branch information
coudot authored Jul 12, 2019
2 parents 57538db + bf6ae97 commit 3b1f099
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 11 additions & 0 deletions htdocs/display.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@
$entry = ldap_get_entries($ldap, $search);
}

# Sort attributes values
foreach ($entry[0] as $attr => $values) {
if ( $values['count'] > 1 ) {
asort($values);
}
if ( isset($values['count']) ) {
unset($values['count']);
}
$entry[0][$attr] = $values;
}

if ($use_vcard and $_GET["vcard"]) {
require_once("../lib/vcard.inc.php");
$vcard_file = $entry[0][$attributes_map[$vcard_file_identifier]['attribute']][0].".".$vcard_file_extension;
Expand Down
2 changes: 0 additions & 2 deletions templates/display.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
<td>
{if ({$entry.$attribute.0})}
{foreach $entry.{$attribute} as $value}
{if $value@index ne 0}
{include 'value_displayer.tpl' value=$value type=$type truncate_value_after=10000}
{/if}
{/foreach}
{else}
<i>{$msg_notdefined}</i><br />
Expand Down

0 comments on commit 3b1f099

Please # to comment.