diff options
author | Julius Härtl <jus@bitgrid.net> | 2021-01-19 11:20:50 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2021-01-28 12:00:20 +0100 |
commit | 7e6d69d166cbc92fb457fc72efc9abe850a0bbe4 (patch) | |
tree | 54328a78dbbd8b4570d7e6913ce4c8291a451a36 /lib/private/legacy | |
parent | 66fa3fca8323fe763e4177cc31d3f535802e976a (diff) | |
download | nextcloud-server-7e6d69d166cbc92fb457fc72efc9abe850a0bbe4.tar.gz nextcloud-server-7e6d69d166cbc92fb457fc72efc9abe850a0bbe4.zip |
Add templatedirectory config value to let admins have their custom templates by default
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/legacy')
-rw-r--r-- | lib/private/legacy/OC_Util.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index 16e68b07cf1..05d54cf84e6 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -72,6 +72,7 @@ use OCP\IGroupManager; use OCP\ILogger; use OCP\IUser; use OCP\IUserSession; +use Psr\Log\LoggerInterface; class OC_Util { public static $scripts = []; @@ -412,6 +413,9 @@ class OC_Util { * @suppress PhanDeprecatedFunction */ public static function copySkeleton($userId, \OCP\Files\Folder $userDirectory) { + /** @var LoggerInterface $logger */ + $logger = \OC::$server->get(LoggerInterface::class); + $plainSkeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton'); $userLang = \OC::$server->getL10NFactory()->findLanguage(); $skeletonDirectory = str_replace('{lang}', $userLang, $plainSkeletonDirectory); @@ -440,14 +444,12 @@ class OC_Util { } if (!empty($skeletonDirectory)) { - \OCP\Util::writeLog( - 'files_skeleton', - 'copying skeleton for '.$userId.' from '.$skeletonDirectory.' to '.$userDirectory->getFullPath('/'), - ILogger::DEBUG - ); + $logger->debug('copying skeleton for '.$userId.' from '.$skeletonDirectory.' to '.$userDirectory->getFullPath('/'), ['app' => 'files_skeleton']); self::copyr($skeletonDirectory, $userDirectory); // update the file cache $userDirectory->getStorage()->getScanner()->scan('', \OC\Files\Cache\Scanner::SCAN_RECURSIVE); + + /** @var ITemplateManager $templateManaer */ $templateManaer = \OC::$server->get(ITemplateManager::class); $templateManaer->initializeTemplateDirectory(null, $userId); } |