try translating default group descriptions on read, in case they are not translated

This commit is contained in:
Ralf Becker 2016-06-26 12:03:46 +02:00
parent 381b9fa1a4
commit 6deedce782

View File

@ -277,7 +277,7 @@ class Accounts
foreach($account_search[$serial]['data'] as &$account)
{
// add default description for Admins and Default group
if ($account['account_type'] === 'g' && empty($account['account_description']))
if ($account['account_type'] === 'g')
{
self::add_default_group_description($account);
}
@ -379,7 +379,7 @@ class Accounts
$data = self::cache_read($id);
// add default description for Admins and Default group
if ($data['account_type'] === 'g' && empty($data['account_description']))
if ($data['account_type'] === 'g')
{
self::add_default_group_description($data);
}
@ -552,6 +552,8 @@ class Accounts
* @param array &$data
*/
protected static function add_default_group_description(array &$data)
{
if (empty($data['account_description']))
{
switch($data['account_lid'])
{
@ -566,6 +568,11 @@ class Accounts
break;
}
}
else
{
$data['account_description'] = lang($data['account_description']);
}
}
/**
* Saves / adds the data of one account