handle permissions errors when copying the skeleton for a read only user
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
15f43b2635
commit
2b0da0f218
|
@ -46,6 +46,7 @@ use OC_User;
|
||||||
use OC_Util;
|
use OC_Util;
|
||||||
use OCA\DAV\Connector\Sabre\Auth;
|
use OCA\DAV\Connector\Sabre\Auth;
|
||||||
use OCP\AppFramework\Utility\ITimeFactory;
|
use OCP\AppFramework\Utility\ITimeFactory;
|
||||||
|
use OCP\Files\NotPermittedException;
|
||||||
use OCP\IConfig;
|
use OCP\IConfig;
|
||||||
use OCP\IRequest;
|
use OCP\IRequest;
|
||||||
use OCP\ISession;
|
use OCP\ISession;
|
||||||
|
@ -480,8 +481,12 @@ class Session implements IUserSession, Emitter {
|
||||||
//trigger creation of user home and /files folder
|
//trigger creation of user home and /files folder
|
||||||
$userFolder = \OC::$server->getUserFolder($user);
|
$userFolder = \OC::$server->getUserFolder($user);
|
||||||
|
|
||||||
// copy skeleton
|
try {
|
||||||
\OC_Util::copySkeleton($user, $userFolder);
|
// copy skeleton
|
||||||
|
\OC_Util::copySkeleton($user, $userFolder);
|
||||||
|
} catch (NotPermittedException $ex) {
|
||||||
|
// read only uses
|
||||||
|
}
|
||||||
|
|
||||||
// trigger any other initialization
|
// trigger any other initialization
|
||||||
\OC::$server->getEventDispatcher()->dispatch(IUser::class . '::firstLogin', new GenericEvent($this->getUser()));
|
\OC::$server->getEventDispatcher()->dispatch(IUser::class . '::firstLogin', new GenericEvent($this->getUser()));
|
||||||
|
|
Loading…
Reference in New Issue