aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-07-24 14:38:05 +0200
committerGitHub <noreply@github.com>2017-07-24 14:38:05 +0200
commit184f25c0d6202ccbca1c828e1f0cb287a864a790 (patch)
treed84c714bc5d8d008f221087f7a9455c9d138c77b /lib
parent5bc0edbd297285f4ceded0bb9a8dcb59ba61ada4 (diff)
parent7790017a1460f3acd18b3b1d8adae66790f97646 (diff)
downloadnextcloud-server-184f25c0d6202ccbca1c828e1f0cb287a864a790.tar.gz
nextcloud-server-184f25c0d6202ccbca1c828e1f0cb287a864a790.zip
Merge pull request #5854 from nextcloud/improve-personal-page-code
Cleanup code of personal page to use public interfaces
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Settings/Personal/PersonalInfo.php6
-rw-r--r--lib/private/legacy/user.php51
2 files changed, 3 insertions, 54 deletions
diff --git a/lib/private/Settings/Personal/PersonalInfo.php b/lib/private/Settings/Personal/PersonalInfo.php
index fb1f388c599..e92541c0010 100644
--- a/lib/private/Settings/Personal/PersonalInfo.php
+++ b/lib/private/Settings/Personal/PersonalInfo.php
@@ -118,10 +118,10 @@ class PersonalInfo implements ISettings {
'usage' => \OC_Helper::humanFileSize($storageInfo['used']),
'usage_relative' => $storageInfo['relative'],
'quota' => $storageInfo['quota'],
- 'avatarChangeSupported' => \OC_User::canUserChangeAvatar($uid),
+ 'avatarChangeSupported' => $user->canChangeAvatar(),
'lookupServerUploadEnabled' => $lookupServerUploadEnabled,
'avatarScope' => $userData[AccountManager::PROPERTY_AVATAR]['scope'],
- 'displayNameChangeSupported' => \OC_User::canUserChangeDisplayName($uid),
+ 'displayNameChangeSupported' => $user->canChangeDisplayName(),
'displayName' => $userData[AccountManager::PROPERTY_DISPLAYNAME]['value'],
'displayNameScope' => $userData[AccountManager::PROPERTY_DISPLAYNAME]['scope'],
'email' => $userData[AccountManager::PROPERTY_EMAIL]['value'],
@@ -138,7 +138,7 @@ class PersonalInfo implements ISettings {
'twitterScope' => $userData[AccountManager::PROPERTY_TWITTER]['scope'],
'twitterVerification' => $userData[AccountManager::PROPERTY_TWITTER]['verified'],
'groups' => $this->getGroups($user),
- 'passwordChangeSupported' => \OC_User::canUserChangePassword($uid),
+ 'passwordChangeSupported' => $user->canChangePassword(),
] + $messageParameters + $languageParameters;
diff --git a/lib/private/legacy/user.php b/lib/private/legacy/user.php
index 7e7cbab3bce..161942c995c 100644
--- a/lib/private/legacy/user.php
+++ b/lib/private/legacy/user.php
@@ -412,57 +412,6 @@ class OC_User {
}
/**
- * Check whether user can change his avatar
- *
- * @param string $uid The username
- * @return bool
- *
- * Check whether a specified user can change his avatar
- */
- public static function canUserChangeAvatar($uid) {
- $user = \OC::$server->getUserManager()->get($uid);
- if ($user) {
- return $user->canChangeAvatar();
- } else {
- return false;
- }
- }
-
- /**
- * Check whether user can change his password
- *
- * @param string $uid The username
- * @return bool
- *
- * Check whether a specified user can change his password
- */
- public static function canUserChangePassword($uid) {
- $user = \OC::$server->getUserManager()->get($uid);
- if ($user) {
- return $user->canChangePassword();
- } else {
- return false;
- }
- }
-
- /**
- * Check whether user can change his display name
- *
- * @param string $uid The username
- * @return bool
- *
- * Check whether a specified user can change his display name
- */
- public static function canUserChangeDisplayName($uid) {
- $user = \OC::$server->getUserManager()->get($uid);
- if ($user) {
- return $user->canChangeDisplayName();
- } else {
- return false;
- }
- }
-
- /**
* Check if the password is correct
*
* @param string $uid The username