diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-03 09:21:53 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-03 09:21:53 +0100 |
commit | 7fefd4f4d900de85201dafd9848f1212d4f6176d (patch) | |
tree | 20d275d6ebe8d4cc52ce50d3b339bb4f4ffa5c5a /settings | |
parent | 6b4f48e0f3ffc7e2f243b232289f7d54a4f8fad5 (diff) | |
parent | dcc7ff09ba4cfba6fe200f4f686cca7a1853390c (diff) | |
download | nextcloud-server-7fefd4f4d900de85201dafd9848f1212d4f6176d.tar.gz nextcloud-server-7fefd4f4d900de85201dafd9848f1212d4f6176d.zip |
Merge pull request #20860 from owncloud/use-user-getEMailAddress-all-over-the-place
User IUser::getEMailAddress() all over the place
Diffstat (limited to 'settings')
-rw-r--r-- | settings/controller/userscontroller.php | 6 | ||||
-rw-r--r-- | settings/personal.php | 19 |
2 files changed, 15 insertions, 10 deletions
diff --git a/settings/controller/userscontroller.php b/settings/controller/userscontroller.php index 942319901f3..827f74c4c83 100644 --- a/settings/controller/userscontroller.php +++ b/settings/controller/userscontroller.php @@ -164,6 +164,10 @@ class UsersController extends Controller { $subAdminGroups[$key] = $subAdminGroup->getGID(); } + $displayName = $user->getEMailAddress(); + if (is_null($displayName)) { + $displayName = ''; + } return [ 'name' => $user->getUID(), 'displayname' => $user->getDisplayName(), @@ -173,7 +177,7 @@ class UsersController extends Controller { 'storageLocation' => $user->getHome(), 'lastLogin' => $user->getLastLogin() * 1000, 'backend' => $user->getBackendClassName(), - 'email' => $this->config->getUserValue($user->getUID(), 'settings', 'email', ''), + 'email' => $displayName, 'isRestoreDisabled' => !$restorePossible, ]; } diff --git a/settings/personal.php b/settings/personal.php index bf1e1ad8793..6c2ac351456 100644 --- a/settings/personal.php +++ b/settings/personal.php @@ -54,23 +54,24 @@ if ($config->getSystemValue('enable_avatars', true) === true) { } // Highlight navigation entry -OC_App::setActiveNavigationEntry( 'personal' ); +OC::$server->getNavigationManager()->setActiveEntry('personal'); $storageInfo=OC_Helper::getStorageInfo('/'); -$email=$config->getUserValue(OC_User::getUser(), 'settings', 'email', ''); +$user = OC::$server->getUserManager()->get(OC_User::getUser()); +$email = $user->getEMailAddress(); $userLang=$config->getUserValue( OC_User::getUser(), 'core', 'lang', OC_L10N::findLanguage() ); $languageCodes=OC_L10N::findAvailableLanguages(); // array of common languages -$commonlangcodes = array( +$commonLangCodes = array( 'en', 'es', 'fr', 'de', 'de_DE', 'ja', 'ar', 'ru', 'nl', 'it', 'pt_BR', 'pt_PT', 'da', 'fi_FI', 'nb_NO', 'sv', 'tr', 'zh_CN', 'ko' ); $languageNames=include 'languageCodes.php'; $languages=array(); -$commonlanguages = array(); +$commonLanguages = array(); foreach($languageCodes as $lang) { $l = \OC::$server->getL10N('settings', $lang); // TRANSLATORS this is the language name for the language switcher in the personal settings and should be the localized version @@ -82,12 +83,12 @@ foreach($languageCodes as $lang) { $ln=array('code'=>$lang, 'name'=>$lang); } - // put apropriate languages into apropriate arrays, to print them sorted + // put appropriate languages into appropriate arrays, to print them sorted // used language -> common languages -> divider -> other languages if ($lang === $userLang) { $userLang = $ln; - } elseif (in_array($lang, $commonlangcodes)) { - $commonlanguages[array_search($lang, $commonlangcodes)]=$ln; + } elseif (in_array($lang, $commonLangCodes)) { + $commonLanguages[array_search($lang, $commonLangCodes)]=$ln; } else { $languages[]=$ln; } @@ -101,7 +102,7 @@ if (!is_array($userLang)) { ]; } -ksort($commonlanguages); +ksort($commonLanguages); // sort now by displayed language not the iso-code usort( $languages, function ($a, $b) { @@ -142,7 +143,7 @@ $tmpl->assign('usage_relative', $storageInfo['relative']); $tmpl->assign('clients', $clients); $tmpl->assign('email', $email); $tmpl->assign('languages', $languages); -$tmpl->assign('commonlanguages', $commonlanguages); +$tmpl->assign('commonlanguages', $commonLanguages); $tmpl->assign('activelanguage', $userLang); $tmpl->assign('passwordChangeSupported', OC_User::canUserChangePassword(OC_User::getUser())); $tmpl->assign('displayNameChangeSupported', OC_User::canUserChangeDisplayName(OC_User::getUser())); |