]> source.dussan.org Git - nextcloud-server.git/commitdiff
display stored user data
authorBjörn Schießle <schiessle@owncloud.com>
Mon, 25 Apr 2016 14:07:00 +0000 (16:07 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Mon, 21 Nov 2016 10:29:43 +0000 (11:29 +0100)
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
settings/personal.php

index a18a88a9b6382856c3c3656a1fb444d9f5a663ed..87e1af36c940d659dea00de5291c2723d92402be 100644 (file)
@@ -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());