summaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/user.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-16 13:27:45 +0100
committerMorris Jobke <hey@morrisjobke.de>2018-01-16 18:39:11 +0100
commit55532f19d90b40f7f46354b92a5322676729ba7e (patch)
treec29ee88dbb789c7c0aa9c9f1c08fccef27272d7f /lib/private/legacy/user.php
parenta159d7c28c483a2b77e2f533795f6d6d1ec720fd (diff)
downloadnextcloud-server-55532f19d90b40f7f46354b92a5322676729ba7e.tar.gz
nextcloud-server-55532f19d90b40f7f46354b92a5322676729ba7e.zip
Cleanup OC_User and OCP\User
* mainly removes deprecated methods and old static code Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/legacy/user.php')
-rw-r--r--lib/private/legacy/user.php76
1 files changed, 3 insertions, 73 deletions
diff --git a/lib/private/legacy/user.php b/lib/private/legacy/user.php
index 52ed1369c47..8f342281adb 100644
--- a/lib/private/legacy/user.php
+++ b/lib/private/legacy/user.php
@@ -58,13 +58,6 @@
*/
class OC_User {
- /**
- * @return \OC\User\Session
- */
- public static function getUserSession() {
- return OC::$server->getUserSession();
- }
-
private static $_usedBackends = array();
private static $_setupedBackends = array();
@@ -176,7 +169,7 @@ class OC_User {
if ($uid) {
if (self::getUser() !== $uid) {
self::setUserId($uid);
- $userSession = self::getUserSession();
+ $userSession = \OC::$server->getUserSession();
$userSession->setLoginName($uid);
$request = OC::$server->getRequest();
$userSession->createSessionToken($request, $uid, $uid);
@@ -210,7 +203,7 @@ class OC_User {
//setup extra user backends
self::setupBackends();
- self::getUserSession()->unsetMagicInCookie();
+ \OC::$server->getUserSession()->unsetMagicInCookie();
return self::loginWithApache($backend);
}
@@ -235,25 +228,6 @@ class OC_User {
}
/**
- * Sets user display name for session
- *
- * @param string $uid
- * @param string $displayName
- * @return bool Whether the display name could get set
- */
- public static function setDisplayName($uid, $displayName = null) {
- if (is_null($displayName)) {
- $displayName = $uid;
- }
- $user = \OC::$server->getUserManager()->get($uid);
- if ($user) {
- return $user->setDisplayName($displayName);
- } else {
- return false;
- }
- }
-
- /**
* Check if the user is logged in, considers also the HTTP basic credentials
*
* @deprecated use \OC::$server->getUserSession()->isLoggedIn()
@@ -348,7 +322,7 @@ class OC_User {
return $uid;
}
} else {
- $user = self::getUserSession()->getUser();
+ $user = \OC::$server->getUserSession()->getUser();
if ($user) {
return $user->getDisplayName();
} else {
@@ -377,25 +351,6 @@ class OC_User {
}
/**
- * Check if the password is correct
- *
- * @param string $uid The username
- * @param string $password The password
- * @return string|false user id a string on success, false otherwise
- *
- * Check if the password is correct without logging in the user
- * returns the user id or false
- */
- public static function checkPassword($uid, $password) {
- $manager = \OC::$server->getUserManager();
- $username = $manager->checkPassword($uid, $password);
- if ($username !== false) {
- return $username->getUID();
- }
- return false;
- }
-
- /**
* @param string $uid The username
* @return string
*
@@ -451,31 +406,6 @@ class OC_User {
}
/**
- * check if a user exists
- *
- * @param string $uid the username
- * @return boolean
- */
- public static function userExists($uid) {
- return \OC::$server->getUserManager()->userExists($uid);
- }
-
- /**
- * checks if a user is enabled
- *
- * @param string $uid
- * @return bool
- */
- public static function isEnabled($uid) {
- $user = \OC::$server->getUserManager()->get($uid);
- if ($user) {
- return $user->isEnabled();
- } else {
- return false;
- }
- }
-
- /**
* Returns the first active backend from self::$_usedBackends.
*
* @return OCP\Authentication\IApacheBackend|null if no backend active, otherwise OCP\Authentication\IApacheBackend