Merge pull request #10697 from owncloud/fs-no-autosetup

Don't automatically setup the filesystem the moment we load OC\Files\Filesystem
This commit is contained in:
Robin Appelman 2014-09-02 20:01:34 +02:00
commit e5fec4df0c
4 changed files with 7 additions and 19 deletions

View File

@ -35,22 +35,6 @@ if (!OC_Config::getValue('maintenance', false)) {
if(!in_array('crypt', stream_get_wrappers())) {
stream_wrapper_register('crypt', 'OCA\Encryption\Stream');
}
// check if we are logged in
if (OCP\User::isLoggedIn()) {
// ensure filesystem is loaded
if (!\OC\Files\Filesystem::$loaded) {
\OC_Util::setupFS();
}
$view = new OC\Files\View('/');
$sessionReady = OCA\Encryption\Helper::checkRequirements();
if($sessionReady) {
$session = new \OCA\Encryption\Session($view);
}
}
} else {
// logout user if we are in maintenance to force re-login
OCP\User::logout();

View File

@ -721,6 +721,7 @@ class OC {
OC_App::loadApps();
}
self::checkSingleUserMode();
OC_Util::setupFS();
OC::$server->getRouter()->match(OC_Request::getRawPathInfo());
return;
} catch (Symfony\Component\Routing\Exception\ResourceNotFoundException $e) {
@ -776,6 +777,7 @@ class OC {
if (OC_User::isLoggedIn()) {
OC_App::loadApps();
OC_User::setupBackends();
OC_Util::setupFS();
if (isset($_GET["logout"]) and ($_GET["logout"])) {
OC_JSON::callCheck();
if (isset($_COOKIE['oc_token'])) {

View File

@ -794,5 +794,3 @@ class Filesystem {
return self::$defaultInstance->getETag($path);
}
}
\OC_Util::setupFS();

View File

@ -232,7 +232,11 @@ class OC_User {
*/
public static function login($uid, $password) {
session_regenerate_id(true);
return self::getUserSession()->login($uid, $password);
$result = self::getUserSession()->login($uid, $password);
if ($result) {
OC_Util::setupFS($uid);
}
return $result;
}
/**