diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-02-03 12:48:17 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-09-23 11:16:14 +0200 |
commit | e65ceb08fc4a56d0fb9e4be5d51ba04168cbb59a (patch) | |
tree | 72f9a407f9f0a653ad534a1aec4df76837d15ef8 /lib/private/util.php | |
parent | fc42a64e6c848adc21bb069da01398f7d39fcc4a (diff) | |
download | nextcloud-server-e65ceb08fc4a56d0fb9e4be5d51ba04168cbb59a.tar.gz nextcloud-server-e65ceb08fc4a56d0fb9e4be5d51ba04168cbb59a.zip |
Moved WebDAV and internet checks to client side JS
- Added setup checks in JavaScript
- Moved isWebDAVWorking to JS using SetupChecks
- Moved internet connection checks to an ajax call that goes through the
server
Diffstat (limited to 'lib/private/util.php')
-rwxr-xr-x | lib/private/util.php | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/lib/private/util.php b/lib/private/util.php index c5483c1654b..f65269a0fdc 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -1028,53 +1028,6 @@ class OC_Util { } /** - * test if webDAV is working properly - * - * @return bool - * @description - * The basic assumption is that if the server returns 401/Not Authenticated for an unauthenticated PROPFIND - * the web server it self is setup properly. - * - * Why not an authenticated PROPFIND and other verbs? - * - We don't have the password available - * - We have no idea about other auth methods implemented (e.g. OAuth with Bearer header) - * - */ - public static function isWebDAVWorking() { - if (!function_exists('curl_init')) { - return true; - } - if (!\OC_Config::getValue("check_for_working_webdav", true)) { - return true; - } - $settings = array( - 'baseUri' => OC_Helper::linkToRemote('webdav'), - ); - - $client = new \OC_DAVClient($settings); - - $client->setRequestTimeout(10); - - // for this self test we don't care if the ssl certificate is self signed and the peer cannot be verified. - $client->setVerifyPeer(false); - // also don't care if the host can't be verified - $client->setVerifyHost(0); - - $return = true; - try { - // test PROPFIND - $client->propfind('', array('{DAV:}resourcetype')); - } catch (\Sabre\DAV\Exception\NotAuthenticated $e) { - $return = true; - } catch (\Exception $e) { - OC_Log::write('core', 'isWebDAVWorking: NO - Reason: ' . $e->getMessage() . ' (' . get_class($e) . ')', OC_Log::WARN); - $return = false; - } - - return $return; - } - - /** * Check if the setlocal call does not work. This can happen if the right * local packages are not available on the server. * |