From 445a254c1e84444134b90b4c874cbf32119e2df1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Schie=C3=9Fle?= Date: Mon, 25 Apr 2016 16:07:00 +0200 Subject: [PATCH] display stored user data Signed-off-by: Roeland Jago Douma --- settings/personal.php | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/settings/personal.php b/settings/personal.php index a18a88a9b63..87e1af36c94 100644 --- a/settings/personal.php +++ b/settings/personal.php @@ -40,6 +40,7 @@ OC_Util::checkLoggedIn(); $defaults = \OC::$server->getThemingDefaults(); $certificateManager = \OC::$server->getCertificateManager(); +$accountManager = new \OC\Accounts\AccountManager(\OC::$server->getDatabaseConnection()); $config = \OC::$server->getConfig(); $urlGenerator = \OC::$server->getURLGenerator(); @@ -155,6 +156,8 @@ if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) { } else { $totalSpace = OC_Helper::humanFileSize($storageInfo['total']); } +$userData = $accountManager->getUser($user->getUID()); + $tmpl->assign('total_space', $totalSpace); $tmpl->assign('usage_relative', $storageInfo['relative']); $tmpl->assign('clients', $clients); @@ -165,18 +168,18 @@ $tmpl->assign('activelanguage', $userLang); $tmpl->assign('passwordChangeSupported', OC_User::canUserChangePassword(OC_User::getUser())); $tmpl->assign('displayNameChangeSupported', OC_User::canUserChangeDisplayName(OC_User::getUser())); $tmpl->assign('displayName', OC_User::getDisplayName()); -// TODO: insert real data -$tmpl->assign('phone', '+43 660 56565 5446'); -$tmpl->assign('website', 'owncloud.org'); -$tmpl->assign('address', 'Stuttgart'); - -$tmpl->assign('avatarScope', 'contacts'); -$tmpl->assign('displayNameScope', 'public'); -$tmpl->assign('phoneScope', 'contacts'); -$tmpl->assign('emailScope', 'contacts'); -$tmpl->assign('websiteScope', 'public'); -$tmpl->assign('addressScope', 'private'); -// END TODO + +$tmpl->assign('phone', isset($userData['phone']['value']) ? $userData['phone']['value'] : null); +$tmpl->assign('website', isset($userData['website']['value']) ? $userData['website']['value'] : null); +$tmpl->assign('address', isset($userData['address']['value']) ? $userData['address']['value'] : null); + +$tmpl->assign('avatarScope', isset($userData['avatar']['scope']) ? $userData['avatar']['scope'] : 'contacts'); +$tmpl->assign('displayNameScope', isset($userData['displayName']['scope']) ? $userData['displayName']['scope'] : 'contacts'); +$tmpl->assign('phoneScope', isset($userData['phone']['scope']) ? $userData['phone']['scope'] : 'private'); +$tmpl->assign('emailScope', isset($userData['email']['scope']) ? $userData['email']['scope'] : 'private'); +$tmpl->assign('websiteScope', isset($userData['website']['scope']) ? $userData['website']['scope'] : 'private'); +$tmpl->assign('addressScope', isset($userData['address']['scope']) ? $userData['address']['scope'] : 'private'); + $tmpl->assign('enableAvatars', $config->getSystemValue('enable_avatars', true) === true); $tmpl->assign('avatarChangeSupported', OC_User::canUserChangeAvatar(OC_User::getUser())); $tmpl->assign('certs', $certificateManager->listCertificates()); -- 2.39.5