diff --git a/phpmyfaq/.htaccess b/phpmyfaq/.htaccess index 1d0d7cd5d9..69908b7098 100644 --- a/phpmyfaq/.htaccess +++ b/phpmyfaq/.htaccess @@ -96,6 +96,9 @@ Header set Access-Control-Allow-Headers "Content-Type, Authorization" # User pages RewriteRule ^user/(ucp|bookmarks|request-removal|logout|register) index.php?action=$1 [L,QSA] + # Setup and update pages + RewriteRule ^setup/(.*) setup/index.php [L,QSA] + # Administration API RewriteRule ^admin/api/(.*) admin/api/index.php [L,QSA] diff --git a/phpmyfaq/assets/src/configuration/update.js b/phpmyfaq/assets/src/configuration/update.js index 9d330af518..eb88e525c0 100644 --- a/phpmyfaq/assets/src/configuration/update.js +++ b/phpmyfaq/assets/src/configuration/update.js @@ -20,13 +20,13 @@ export const handleUpdateNextStepButton = () => { if (nextStepButton && nextStep) { nextStepButton.addEventListener('click', (event) => { event.preventDefault(); - window.location.replace(`./update.php?step=${nextStep.value}`); + window.location.replace(`./update?step=${nextStep.value}`); }); } }; export const handleUpdateInformation = async () => { - if (window.location.href.endsWith('update.php')) { + if (window.location.href.endsWith('/update')) { const installedVersion = document.getElementById('phpmyfaq-update-installed-version'); try { @@ -67,7 +67,7 @@ export const handleUpdateInformation = async () => { }; export const handleConfigBackup = async () => { - if (window.location.href.endsWith('update.php?step=2')) { + if (window.location.href.endsWith('/update?step=2')) { const installedVersion = document.getElementById('phpmyfaq-update-installed-version'); try { @@ -96,7 +96,7 @@ export const handleConfigBackup = async () => { }; export const handleDatabaseUpdate = async () => { - if (window.location.href.endsWith('update.php?step=3')) { + if (window.location.href.endsWith('/update?step=3')) { const installedVersion = document.getElementById('phpmyfaq-update-installed-version'); try { diff --git a/phpmyfaq/assets/templates/admin/configuration/upgrade.twig b/phpmyfaq/assets/templates/admin/configuration/upgrade.twig index 7345bef430..63933d3b8d 100644 --- a/phpmyfaq/assets/templates/admin/configuration/upgrade.twig +++ b/phpmyfaq/assets/templates/admin/configuration/upgrade.twig @@ -1,145 +1,151 @@
- {{ msgHealthCheck }} -
- -+ {{ msgHealthCheck }} +
+ +- {{ msgUpdateCheck }} -
- -+ {{ msgUpdateCheck }} +
+ +- {{ msgDownloadPackage }} -
- - {% if isOnNightlies %} -- {{ alertNightlyBuild }} -
-+ {{ msgDownloadPackage }} +
+ + {% if isOnNightlies %} ++ {{ alertNightlyBuild }} +
+- {{ msgExtractPackage }} -
- -+ {{ msgExtractPackage }} +
+ +- This extracts the downloaded package into your filesystem. -
- -+ This extracts the downloaded package into your filesystem. +
+ ++ You can still use the manual update process if you prefer. +
+ Did you already read our + documentation + carefully before starting the phpMyFAQ setup? +
++ Wow, looks like the installation worked like a charm. This is pretty cool, isn't it? :-) +
+ ++ You can visit your version of phpMyFAQ or login into your + admin section. +
+- Wow, looks like the installation worked like a charm. This is pretty cool, isn't it? :-) -
- -- You can visit your version of phpMyFAQ or login into your - admin section. -
-+ Wow, looks like the installation worked like a charm. This is pretty cool, isn't it? :-) +
+ ++ You can visit your version of phpMyFAQ or login into your + admin section. +
+phpMyFAQ could not find HTTPS support. For security reasons we ' . - 'recommend activating HTTPS.
'; + $hints[] = 'phpMyFAQ could not find HTTPS support. For security reasons ' . + 'we recommend activating HTTPS.
'; } if (!extension_loaded('gd')) { - echo 'You don\'t have GD support enabled in your PHP installation. Please ' . - "enable GD support in your php.ini file otherwise you can't use Captchas for spam protection.
"; + $hints[] = 'You don\'t have GD support enabled in your PHP installation. ' . + "Please enable GD support in your php.ini file otherwise you can't use Captchas for spam protection." . + "
"; } if (!function_exists('imagettftext')) { - echo 'You don\'t have Freetype support enabled in the GD extension of ' . - 'your PHP installation. Please enable Freetype support in GD extension otherwise the Captchas ' . + $hints[] = '
You don\'t have Freetype support enabled in the GD extension ' . + ' ofyour PHP installation. Please enable Freetype support in GD extension otherwise the Captchas ' . 'for spam protection will be quite easy to break.
'; } if (!extension_loaded('curl') || !extension_loaded('openssl')) { - echo 'You don\'t have cURL and/or OpenSSL support enabled in your PHP ' . - "installation. Please enable cURL and/or OpenSSL support in your php.ini file otherwise you can't " . - 'use Elasticsearch.
'; + $hints[] = 'You don\'t have cURL and/or OpenSSL support enabled in your ' . + "PHP installation. Please enable cURL and/or OpenSSL support in your php.ini file otherwise you " . + " can't use Elasticsearch.
"; } if (!extension_loaded('fileinfo')) { - echo 'You don\'t have Fileinfo support enabled in your PHP installation. ' . - "Please enable Fileinfo support in your php.ini file otherwise you can't use our backup/restore " . - 'functionality.
'; + $hints[] = 'You don\'t have Fileinfo support enabled in your PHP ' . + "installation. Please enable Fileinfo support in your php.ini file otherwise you can't use our " . + 'backup/restore functionality.
'; } if (!extension_loaded('sodium')) { - echo 'You don\'t have Sodium support enabled in your PHP installation. ' . - "Please enable Sodium support in your php.ini file otherwise you can't use our backup/restore " . - 'functionality.
'; + $hints[] = 'You don\'t have Sodium support enabled in your PHP ' . + "installation. Please enable Sodium support in your php.ini file otherwise you can't use our " . + 'backup/restore functionality.
'; } + + return $hints; } /** @@ -753,6 +757,7 @@ public function checkNoncriticalSettings(): void */ public function startInstall(array|null $setup = null): void { + $feedbacks = []; $ldapSetup = []; $query = []; $uninstall = []; @@ -1233,4 +1238,14 @@ public function adjustRewriteBaseHtaccess(string $path): bool return file_put_contents($htaccessPath, implode('', $newLines)) !== false; } + + public function hasLdapSupport(): bool + { + return extension_loaded('ldap'); + } + + public function hasElasticsearchSupport(): bool + { + return extension_loaded('curl') && extension_loaded('openssl'); + } } diff --git a/phpmyfaq/src/phpMyFAQ/System.php b/phpmyfaq/src/phpMyFAQ/System.php index 5bebde18a0..bb34f04d24 100644 --- a/phpmyfaq/src/phpMyFAQ/System.php +++ b/phpmyfaq/src/phpMyFAQ/System.php @@ -244,9 +244,9 @@ public function getAvailableTemplates(): array * * @return array