diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-12-04 16:48:07 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-12-08 22:42:37 +0100 |
commit | 0d4f0ab87182cf2cb588bd3285fe41b46f26ee4d (patch) | |
tree | 68ee815c2f06e4f6ef049d56f65fdbf2cf8c4d18 /lib/private | |
parent | 2d5fc9c1a6beec15f04277ccf1408b17f04631e9 (diff) | |
download | nextcloud-server-0d4f0ab87182cf2cb588bd3285fe41b46f26ee4d.tar.gz nextcloud-server-0d4f0ab87182cf2cb588bd3285fe41b46f26ee4d.zip |
reduce OC_Preferences, OC_Config and \OCP\Config usage
* files_encryption
* files_versions
* files_trashbin
* tests
* status.php
* core
* server container
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/allconfig.php | 8 | ||||
-rw-r--r-- | lib/private/ocs/cloud.php | 2 | ||||
-rw-r--r-- | lib/private/share/mailnotifications.php | 2 | ||||
-rw-r--r-- | lib/private/user/session.php | 6 | ||||
-rw-r--r-- | lib/private/user/user.php | 7 |
5 files changed, 13 insertions, 12 deletions
diff --git a/lib/private/allconfig.php b/lib/private/allconfig.php index ea919006f96..e20f3698258 100644 --- a/lib/private/allconfig.php +++ b/lib/private/allconfig.php @@ -117,7 +117,7 @@ class AllConfig implements \OCP\IConfig { * @param string $value the value that should be stored */ public function setAppValue($appName, $key, $value) { - \OCP\Config::setAppValue($appName, $key, $value); + \OC::$server->getAppConfig()->setValue($appName, $key, $value); } /** @@ -129,7 +129,7 @@ class AllConfig implements \OCP\IConfig { * @return string the saved value */ public function getAppValue($appName, $key, $default = '') { - return \OCP\Config::getAppValue($appName, $key, $default); + return \OC::$server->getAppConfig()->getValue($appName, $key, $default); } /** @@ -139,7 +139,7 @@ class AllConfig implements \OCP\IConfig { * @param string $key the key of the value, under which it was saved */ public function deleteAppValue($appName, $key) { - \OC_Appconfig::deleteKey($appName, $key); + \OC::$server->getAppConfig()->deleteKey($appName, $key); } /** @@ -148,7 +148,7 @@ class AllConfig implements \OCP\IConfig { * @param string $appName the appName the configs are stored under */ public function deleteAppValues($appName) { - \OC_Appconfig::deleteApp($appName); + \OC::$server->getAppConfig()->deleteApp($appName); } diff --git a/lib/private/ocs/cloud.php b/lib/private/ocs/cloud.php index 3ced0af8ee1..552aa96a26b 100644 --- a/lib/private/ocs/cloud.php +++ b/lib/private/ocs/cloud.php @@ -91,7 +91,7 @@ class OC_OCS_Cloud { } public static function getCurrentUser() { - $email=OC_Preferences::getValue(OC_User::getUser(), 'settings', 'email', ''); + $email=\OC::$server->getConfig()->getUserValue(OC_User::getUser(), 'settings', 'email', ''); $data = array( 'id' => OC_User::getUser(), 'display-name' => OC_User::getDisplayName(), diff --git a/lib/private/share/mailnotifications.php b/lib/private/share/mailnotifications.php index 2f704fb2b3c..342d3d5057a 100644 --- a/lib/private/share/mailnotifications.php +++ b/lib/private/share/mailnotifications.php @@ -79,7 +79,7 @@ class MailNotifications { foreach ($recipientList as $recipient) { $recipientDisplayName = \OCP\User::getDisplayName($recipient); - $to = \OC_Preferences::getValue($recipient, 'settings', 'email', ''); + $to = \OC::$server->getConfig()->getUserValue($recipient, 'settings', 'email', ''); if ($to === '') { $noMail[] = $recipientDisplayName; diff --git a/lib/private/user/session.php b/lib/private/user/session.php index 94abaca3e76..277aa1a047e 100644 --- a/lib/private/user/session.php +++ b/lib/private/user/session.php @@ -211,15 +211,15 @@ class Session implements IUserSession, Emitter { } // get stored tokens - $tokens = \OC_Preferences::getKeys($uid, 'login_token'); + $tokens = \OC::$server->getConfig()->getUserKeys($uid, 'login_token'); // test cookies token against stored tokens if (!in_array($currentToken, $tokens, true)) { return false; } // replace successfully used token with a new one - \OC_Preferences::deleteKey($uid, 'login_token', $currentToken); + \OC::$server->getConfig()->deleteUserValue($uid, 'login_token', $currentToken); $newToken = \OC::$server->getSecureRandom()->getMediumStrengthGenerator()->generate(32); - \OC_Preferences::setValue($uid, 'login_token', $newToken, time()); + \OC::$server->getConfig()->setUserValue($uid, 'login_token', $newToken, time()); $this->setMagicInCookie($user->getUID(), $newToken); //login diff --git a/lib/private/user/user.php b/lib/private/user/user.php index fb66f893c61..00ded84f955 100644 --- a/lib/private/user/user.php +++ b/lib/private/user/user.php @@ -68,10 +68,11 @@ class User implements IUser { if ($this->config) { $enabled = $this->config->getUserValue($uid, 'core', 'enabled', 'true'); $this->enabled = ($enabled === 'true'); + $this->lastLogin = $this->config->getUserValue($uid, 'login', 'lastLogin', 0); } else { $this->enabled = true; + $this->lastLogin = \OC::$server->getConfig()->getUserValue($uid, 'login', 'lastLogin', 0); } - $this->lastLogin = \OC_Preferences::getValue($uid, 'login', 'lastLogin', 0); } /** @@ -140,7 +141,7 @@ class User implements IUser { */ public function updateLastLoginTimestamp() { $this->lastLogin = time(); - \OC_Preferences::setValue( + \OC::$server->getConfig()->setUserValue( $this->uid, 'login', 'lastLogin', $this->lastLogin); } @@ -163,7 +164,7 @@ class User implements IUser { \OC_Group::removeFromGroup($this->uid, $i); } // Delete the user's keys in preferences - \OC_Preferences::deleteUser($this->uid); + \OC::$server->getConfig()->deleteAllUserValues($this->uid); // Delete user files in /data/ \OC_Helper::rmdirr(\OC_User::getHome($this->uid)); |