Merge pull request #3454 from owncloud/fix_hasInternetConnection

isinternetconnectionworking should return false if OC_Config::getValue("has_internet_connection") is false
This commit is contained in:
Thomas Müller 2013-05-31 17:05:45 -07:00
commit 1b3c9fe5ae
2 changed files with 12 additions and 6 deletions

View File

@ -644,11 +644,10 @@ class OC_Util {
/** /**
* Check if the ownCloud server can connect to the internet * Check if the ownCloud server can connect to the internet
*/ */
public static function isinternetconnectionworking() { public static function isInternetConnectionWorking() {
// in case there is no internet connection on purpose return false
// in case there is no internet connection on purpose there is no need to display a warning if (self::isInternetConnectionEnabled() === false) {
if (!\OC_Config::getValue("has_internet_connection", true)) { return false;
return true;
} }
// try to connect to owncloud.org to see if http connections to the internet are possible. // try to connect to owncloud.org to see if http connections to the internet are possible.
@ -670,6 +669,13 @@ class OC_Util {
} }
} }
/**
* Check if the connection to the internet is disabled on purpose
*/
public static function isInternetConnectionEnabled(){
return \OC_Config::getValue("has_internet_connection", true);
}
/** /**
* clear all levels of output buffering * clear all levels of output buffering

View File

@ -24,7 +24,7 @@ $tmpl->assign('loglevel', OC_Config::getValue( "loglevel", 2 ));
$tmpl->assign('entries', $entries); $tmpl->assign('entries', $entries);
$tmpl->assign('entriesremain', $entriesremain); $tmpl->assign('entriesremain', $entriesremain);
$tmpl->assign('htaccessworking', $htaccessworking); $tmpl->assign('htaccessworking', $htaccessworking);
$tmpl->assign('internetconnectionworking', OC_Util::isinternetconnectionworking()); $tmpl->assign('internetconnectionworking', OC_Util::isInternetConnectionEnabled() ? OC_Util::isInternetConnectionWorking() : false);
$tmpl->assign('islocaleworking', OC_Util::issetlocaleworking()); $tmpl->assign('islocaleworking', OC_Util::issetlocaleworking());
$tmpl->assign('isWebDavWorking', OC_Util::isWebDAVWorking()); $tmpl->assign('isWebDavWorking', OC_Util::isWebDAVWorking());
$tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded()); $tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded());