nextcloud/apps/files_sharing/ajax/testremote.php

22 lines
504 B
PHP
Raw Normal View History

<?php
/**
* Copyright (c) 2014 Robin Appelman <icewind@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
2014-06-16 14:42:28 +04:00
OCP\JSON::checkAppEnabled('files_sharing');
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
$remote = $_GET['remote'];
if (file_get_contents('https://' . $remote . '/status.php')) {
echo 'https';
} elseif (file_get_contents('http://' . $remote . '/status.php')) {
echo 'http';
2014-06-16 14:42:28 +04:00
} else {
echo 'false';
}