owncloud/core — pull request #1360 by schiesbn (2013-01-29 20:12:57+00:00)
Title: introduction of display names

This pull request introduce display names. If the user back-end supports display names you can define random names, different to the login names, as display names. Currently the LDAP-Back-End and our database back-end supports display names. Both implementations are part of this pull request.

If you are the author of a user back-end which also knows the concept of display names feel free to add it to your ownCloud implementation.

The display name will be used in various places as your primary name, e.g automatically generated mail, sharing dialog, etc. It is only used to represent the user in the various interfaces. For internal reference we continue to use the login name.

This means that if you use the name of the user only for internal purpose, e.g in the database, to access the data folder, etc nothing has to be changed. If your App also displays the name in the UI, in mails, etc than you should change your App to retrieve the display name instead of the login name. Therefore we introduced some new functions:

OCP\User:: getDisplayName($user=null)
-> returns either the display name of the current user or of the user
(login name) given as parameter

OCP\User::getDisplayNames($search = '', $limit = null, $offset = null)
-> lets you search for a specific display name and returns an array with
the login name as key and the display name as value

Both function behave the same as OCP\User:: getUsers() and OCP\User::getUserNames();

In most cases it should be enough to just replace the function names in your code when you want to get the display name instead of the login name.

I already made the necessary changes to ownCloud core which are also part of this pull request. Feel free to double check you Core-App to make sure that I didn't miss something.