From 2b762271808598f69927a3d279ad24402a34f54e Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Sat, 6 Dec 2014 15:34:53 +0100 Subject: [PATCH] Check for working .htaccess via AJAX Fixes https://github.com/owncloud/core/issues/12650 --- core/js/setupchecks.js | 7 ++++++- settings/admin.php | 2 -- settings/ajax/checksetup.php | 5 +++-- settings/templates/admin.php | 16 +--------------- 4 files changed, 10 insertions(+), 20 deletions(-) diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index f351c1b451..db5365c124 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -49,11 +49,16 @@ var afterCall = function(data, statusText, xhr) { var messages = []; if (xhr.status === 200 && data) { - if (!data.serverhasinternetconnection) { + if (!data.serverHasInternetConnection) { messages.push( t('core', 'This server has no working internet connection. This means that some of the features like mounting of external storage, notifications about updates or installation of 3rd party apps donĀ“t work. Accessing files from remote and sending of notification emails might also not work. We suggest to enable internet connection for this server if you want to have all features.') ); } + if(!data.dataDirectoryProtected) { + messages.push( + t('core', 'Your data directory and your files are probably accessible from the internet. The .htaccess file is not working. We strongly suggest that you configure your webserver in a way that the data directory is no longer accessible or you move the data directory outside the webserver document root.') + ); + } } else { messages.push(t('core', 'Error occurred while checking server setup')); } diff --git a/settings/admin.php b/settings/admin.php index a5f0703791..4b70848bd5 100644 --- a/settings/admin.php +++ b/settings/admin.php @@ -9,7 +9,6 @@ OC_Util::checkAdminUser(); OC_App::setActiveNavigationEntry("admin"); $template = new OC_Template('settings', 'admin', 'user'); -$htAccessWorking = OC_Util::isHtaccessWorking(); $entries = OC_Log_Owncloud::getEntries(3); $entriesRemaining = count(OC_Log_Owncloud::getEntries(4)) > 3; @@ -32,7 +31,6 @@ $template->assign('mail_smtpname', $config->getSystemValue("mail_smtpname", '')) $template->assign('mail_smtppassword', $config->getSystemValue("mail_smtppassword", '')); $template->assign('entries', $entries); $template->assign('entriesremain', $entriesRemaining); -$template->assign('htaccessworking', $htAccessWorking); $template->assign('readOnlyConfigEnabled', OC_Helper::isReadOnlyConfigEnabled()); $template->assign('isLocaleWorking', OC_Util::isSetLocaleWorking()); $template->assign('isPhpCharSetUtf8', OC_Util::isPhpCharSetUtf8()); diff --git a/settings/ajax/checksetup.php b/settings/ajax/checksetup.php index 6bf5bc5642..6471893331 100644 --- a/settings/ajax/checksetup.php +++ b/settings/ajax/checksetup.php @@ -17,7 +17,8 @@ if (OC_Util::isInternetConnectionEnabled()) { } OCP\JSON::success( - array( - 'serverhasinternetconnection' => $hasInternet + array ( + 'serverHasInternetConnection' => $hasInternet, + 'dataDirectoryProtected' => OC_Util::isHtaccessWorking() ) ); diff --git a/settings/templates/admin.php b/settings/templates/admin.php index 83dc92a060..a2380a9265 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -83,20 +83,6 @@ if (!$_['isConnectedViaHTTPS']) { -
-

t('Security Warning')); ?>

- - - t('Your data directory and your files are probably accessible from the internet. The .htaccess file is not working. We strongly suggest that you configure your webserver in a way that the data directory is no longer accessible or you move the data directory outside the webserver document root.')); ?> - - -
- @@ -206,7 +192,7 @@ if ($_['suggestedOverwriteWebroot']) { } ?>
-

t('Connectivity Checks'));?>

+

t('Configuration Checks'));?>