summaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/util.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/legacy/util.php')
-rw-r--r--lib/private/legacy/util.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php
index cb52949779f..b8f3a93ba50 100644
--- a/lib/private/legacy/util.php
+++ b/lib/private/legacy/util.php
@@ -311,10 +311,20 @@ class OC_Util {
*
* @param String $userId
* @param \OCP\Files\Folder $userDirectory
+ * @throws \RuntimeException
*/
public static function copySkeleton($userId, \OCP\Files\Folder $userDirectory) {
- $skeletonDirectory = \OCP\Config::getSystemValue('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton');
+ $skeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton');
+ $instanceId = \OC::$server->getConfig()->getSystemValue('instanceid', '');
+
+ if ($instanceId === null) {
+ throw new \RuntimeException('no instance id!');
+ }
+ $appdata = 'appdata_' . $instanceId;
+ if ($userId === $appdata) {
+ throw new \RuntimeException('username is reserved name: ' . $appdata);
+ }
if (!empty($skeletonDirectory)) {
\OCP\Util::writeLog(