diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-09-23 16:55:16 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-09-23 16:55:16 +0200 |
commit | 89e02e89d4a0cf28a9318f4dacd070783cbb7531 (patch) | |
tree | 13d0e9000aad4f835c5b50484cd6101f4067db69 /lib | |
parent | 1e915cc14534d2fe68fdee05423fb82c035dd866 (diff) | |
parent | e65ceb08fc4a56d0fb9e4be5d51ba04168cbb59a (diff) | |
download | nextcloud-server-89e02e89d4a0cf28a9318f4dacd070783cbb7531.tar.gz nextcloud-server-89e02e89d4a0cf28a9318f4dacd070783cbb7531.zip |
Merge pull request #7051 from owncloud/postsetupajaxcheck
Moved WebDAV check to client side JS
Diffstat (limited to 'lib')
-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 5a310273258..e5137de0fad 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -1036,53 +1036,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. * |