Skip to content

Commit

Permalink
Override getName().
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Nov 4, 2014
1 parent 776abe9 commit 739469e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions framework/Core/lib/Horde/Core/Prefs/Identity.php
Expand Up @@ -170,6 +170,26 @@ public function prefsGc()
}
}

/**
* Returns the user's full name.
*
* @param integer $ident The identity to retrieve the name from.
*
* @return string The user's full name, or the user name if it doesn't
* exist.
*/
public function getName($ident = null)
{
global $registry;

if (!isset($this->_names[$ident]) &&
!strlen($this->getValue($this->_prefnames['fullname'], $ident))) {
$this->_names[$ident] = $registry->convertUsername($this->_user, false);
}

return parent::getName($ident);
}

/**
* Returns the from address based on the chosen identity. If no
* address can be found it is built from the current user name and
Expand Down
4 changes: 2 additions & 2 deletions framework/Core/package.xml
Expand Up @@ -39,7 +39,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [jan] Use correct user name as a fallback for identity full names with existing authusername hook.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -3688,7 +3688,7 @@
<date>2014-11-04</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [jan] Use correct user name as a fallback for identity full names with existing authusername hook.
</notes>
</release>
</changelog>
Expand Down

0 comments on commit 739469e

Please sign in to comment.