|
@@ -1456,6 +1456,27 @@ class SiteController extends ActionController
|
|
|
->set('subgroup', $mainEditorGroupUid)
|
|
->set('subgroup', $mainEditorGroupUid)
|
|
|
->execute();
|
|
->execute();
|
|
|
|
|
|
|
|
|
|
+ // setup default owner for the website
|
|
|
|
|
+ $queryBuilder = $this->connectionPool->getQueryBuilderForTable('pages');
|
|
|
|
|
+ $tsConfig = $queryBuilder->select('TSconfig')
|
|
|
|
|
+ ->from('pages')
|
|
|
|
|
+ ->where($queryBuilder->expr()->eq('uid', $rootUid))
|
|
|
|
|
+ ->execute()
|
|
|
|
|
+ ->fetchColumn(0);
|
|
|
|
|
+
|
|
|
|
|
+ $tsConfig = trim(preg_replace('/TCEMAIN {[^{]*}/', '', $tsConfig));
|
|
|
|
|
+
|
|
|
|
|
+ $tsConfig .= "\nTCEMAIN {\n" .
|
|
|
|
|
+ " permissions.userid = " . $adminUid ."\n" .
|
|
|
|
|
+ " permissions.groupid = " . $editorsGroupUid . "\n" .
|
|
|
|
|
+ "}";
|
|
|
|
|
+
|
|
|
|
|
+ $queryBuilder
|
|
|
|
|
+ ->update('pages')
|
|
|
|
|
+ ->where($queryBuilder->expr()->eq('uid', $rootUid))
|
|
|
|
|
+ ->set('TSconfig', $tsConfig)
|
|
|
|
|
+ ->execute();
|
|
|
|
|
+
|
|
|
// fetch pages and root page
|
|
// fetch pages and root page
|
|
|
$pages = $this->otPageRepository->getAllSitePages($rootUid);
|
|
$pages = $this->otPageRepository->getAllSitePages($rootUid);
|
|
|
|
|
|
|
@@ -2302,7 +2323,7 @@ class SiteController extends ActionController
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Try to find if there is the be_user is still in the v8.7 architecture
|
|
|
|
|
|
|
+ // Try to find if there is a be_user who still is in the v8.7 architecture
|
|
|
if ($adminUid == null) {
|
|
if ($adminUid == null) {
|
|
|
$organizationId = $this->findOrganizationIdUidFor($rootUid);
|
|
$organizationId = $this->findOrganizationIdUidFor($rootUid);
|
|
|
|
|
|
|
@@ -2310,12 +2331,11 @@ class SiteController extends ActionController
|
|
|
$expectedUsername = $extraData['admin']['username'];
|
|
$expectedUsername = $extraData['admin']['username'];
|
|
|
|
|
|
|
|
$queryBuilder = $this->connectionPool->getQueryBuilderForTable('be_users');
|
|
$queryBuilder = $this->connectionPool->getQueryBuilderForTable('be_users');
|
|
|
- $queryBuilder->getRestrictions()->removeAll();
|
|
|
|
|
$adminUid = $queryBuilder
|
|
$adminUid = $queryBuilder
|
|
|
->select('uid')
|
|
->select('uid')
|
|
|
->from('be_users')
|
|
->from('be_users')
|
|
|
->where($queryBuilder->expr()->eq('username', $queryBuilder->expr()->literal($expectedUsername)))
|
|
->where($queryBuilder->expr()->eq('username', $queryBuilder->expr()->literal($expectedUsername)))
|
|
|
- ->andWhere($queryBuilder->expr()->eq('db_mountpoints', $queryBuilder->expr()->literal($rootUid)))
|
|
|
|
|
|
|
+ ->andWhere($queryBuilder->expr()->eq('db_mountpoints', $rootUid))
|
|
|
->andWhere($queryBuilder->expr()->eq('deleted', 0))
|
|
->andWhere($queryBuilder->expr()->eq('deleted', 0))
|
|
|
->execute()
|
|
->execute()
|
|
|
->fetchColumn(0);
|
|
->fetchColumn(0);
|