diff --git a/.htaccess b/.htaccess index bd9f5af3f707..befebe6c0b20 100644 --- a/.htaccess +++ b/.htaccess @@ -72,3 +72,7 @@ Options -Indexes ModPagespeed Off +#### DO NOT CHANGE ANYTHING ABOVE THIS LINE #### + +ErrorDocument 403 //core/templates/403.php +ErrorDocument 404 //core/templates/404.php diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 0350fba61397..f19a359579a4 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -197,6 +197,9 @@ public function delete() { if ($this->emitter) { $this->emitter->emit('\OC\User', 'preDelete', [$this]); } + // homeDir needs to be retrieved before the user is deleted - otherwise it isn't correct and the fallback is used + $homeDir = $this->getHome(); + $result = $this->backend->deleteUser($this->uid); if ($result) { @@ -210,7 +213,7 @@ public function delete() { \OC::$server->getConfig()->deleteAllUserValues($this->uid); // Delete user files in /data/ - \OC_Helper::rmdirr($this->getHome()); + \OC_Helper::rmdirr($homeDir); // Delete the users entry in the storage table Storage::remove('home::' . $this->uid);