From 6c797eed82e0b03b497103c9dd5bc747b1d951be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Schie=C3=9Fle?= Date: Tue, 3 May 2016 14:16:17 +0200 Subject: [PATCH] first call the post_login hooks, before we call getUserFolder. The login process needs to be completed before we can safely create the users home folder. For example we need to give encryption a chance to initialize the users encryption keys in order to copy the skeleton files correctly --- lib/private/user.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/private/user.php b/lib/private/user.php index 58405ed644..604fd8674b 100644 --- a/lib/private/user.php +++ b/lib/private/user.php @@ -205,10 +205,14 @@ class OC_User { self::getUserSession()->setLoginName($uid); // setup the filesystem OC_Util::setupFS($uid); + // first call the post_login hooks, the login-process needs to be + // completed before we can safely create the users folder. + // For example encryption needs to initialize the users keys first + // before we can create the user folder with the skeleton files + OC_Hook::emit("OC_User", "post_login", array("uid" => $uid, 'password' => '')); //trigger creation of user home and /files folder \OC::$server->getUserFolder($uid); - OC_Hook::emit("OC_User", "post_login", array("uid" => $uid, 'password' => '')); } return true; }