]> source.dussan.org Git - nextcloud-server.git/commitdiff
Check for working .htaccess via AJAX
authorLukas Reschke <lukas@owncloud.com>
Sat, 6 Dec 2014 14:34:53 +0000 (15:34 +0100)
committerLukas Reschke <lukas@owncloud.com>
Sat, 6 Dec 2014 14:34:53 +0000 (15:34 +0100)
Fixes https://github.com/owncloud/core/issues/12650

core/js/setupchecks.js
settings/admin.php
settings/ajax/checksetup.php
settings/templates/admin.php

index f351c1b451abda343908ada284bcd31d46a70c42..db5365c124d2af1dc2188adac6af82680a1b9b93 100644 (file)
                        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'));
                                }
index a5f07037911b0afb3179a0cd455df16b0a6abefe..4b70848bd5bb9ff35decf0753b92ffe0697b70a5 100644 (file)
@@ -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());
index 6bf5bc5642e9beff814647116f56af9a6dd45421..64718933317ce777ba93ff0d9bcbda4b9c313aef 100644 (file)
@@ -17,7 +17,8 @@ if (OC_Util::isInternetConnectionEnabled()) {
 }
 
 OCP\JSON::success(
-       array(
-               'serverhasinternetconnection' => $hasInternet
+       array (
+               'serverHasInternetConnection' => $hasInternet,
+               'dataDirectoryProtected' => OC_Util::isHtaccessWorking()
        )
 );
index 83dc92a060a71e70a796dd11a5b786c07ed9d9dd..a2380a926507d0d7f12da8ea54b53fad25494894 100644 (file)
@@ -83,20 +83,6 @@ if (!$_['isConnectedViaHTTPS']) {
 <?php
 }
 
-// is htaccess working ?
-if (!$_['htaccessworking']) {
-       ?>
-       <div class="section">
-               <h2><?php p($l->t('Security Warning')); ?></h2>
-
-       <span class="securitywarning">
-               <?php p($l->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.')); ?>
-       </span>
-
-       </div>
-<?php
-}
-
 // is read only config enabled
 if ($_['readOnlyConfigEnabled']) {
 ?>
@@ -206,7 +192,7 @@ if ($_['suggestedOverwriteWebroot']) {
 }
 ?>
 <div id="postsetupchecks" class="section">
-       <h2><?php p($l->t('Connectivity Checks'));?></h2>
+       <h2><?php p($l->t('Configuration Checks'));?></h2>
        <div class="loading"></div>
        <div class="success hidden"><?php p($l->t('No problems found'));?></div>
        <div class="errors hidden"></div>