|
|
@@ -443,16 +443,19 @@ class SiteController extends ActionController
|
|
|
throw new \RuntimeException("A directory or file " . $uploadDir . " already exists. Abort.");
|
|
|
}
|
|
|
|
|
|
+ $defaultUploadDir = $uploadDir . '/images';
|
|
|
+ $formsDir = $uploadDir . '/Forms';
|
|
|
+
|
|
|
$this->mkDir($uploadDir);
|
|
|
- $this->mkDir($uploadDir . '/images');
|
|
|
- $this->mkDir($uploadDir . '/Forms');
|
|
|
+ $this->mkDir($defaultUploadDir);
|
|
|
+ $this->mkDir($formsDir);
|
|
|
|
|
|
// Insert the filemounts points (sys_filemounts)
|
|
|
$queryBuilder = $this->cnnPool->getQueryBuilderForTable('sys_filemounts');
|
|
|
$queryBuilder->insert('sys_filemounts')
|
|
|
->values([
|
|
|
'title' => 'Documents',
|
|
|
- 'path' => $uploadRelPath . '/images',
|
|
|
+ 'path' => $defaultUploadDir,
|
|
|
'base' => 1
|
|
|
])
|
|
|
->execute();
|
|
|
@@ -461,7 +464,7 @@ class SiteController extends ActionController
|
|
|
$queryBuilder->insert('sys_filemounts')
|
|
|
->values([
|
|
|
'title' => 'Forms_' . $organizationId,
|
|
|
- 'path' => $uploadRelPath . '/Forms',
|
|
|
+ 'path' => $formsDir,
|
|
|
'base' => 1
|
|
|
])
|
|
|
->execute();
|
|
|
@@ -475,6 +478,16 @@ class SiteController extends ActionController
|
|
|
$organizationExtraData['admin']
|
|
|
);
|
|
|
|
|
|
+ // Update the user TsConfig
|
|
|
+ $tsconfig = "options.uploadFieldsInTopOfEB = 1\n" .
|
|
|
+ "options.defaultUploadFolder=1:" . $defaultUploadDir . "\n";
|
|
|
+ $queryBuilder = $this->cnnPool->getQueryBuilderForTable('be_users');
|
|
|
+ $queryBuilder
|
|
|
+ ->update('be_users')
|
|
|
+ ->where($queryBuilder->expr()->eq('uid', $beUserUid))
|
|
|
+ ->set('TSconfig', $tsconfig)
|
|
|
+ ->execute();
|
|
|
+
|
|
|
// Give the keys of the website to this user (makes him the owner)
|
|
|
$queryBuilder = $this->cnnPool->getQueryBuilderForTable('pages');
|
|
|
foreach($this->createdPagesIndex as $slug => $uid) {
|