/shareinfo is not required

This commit is contained in:
Lukas Reschke 2016-03-01 06:12:38 +01:00
parent 8f95d69954
commit e965dcaebf
2 changed files with 8 additions and 0 deletions

View file

@ -90,6 +90,7 @@ class Scanner extends \OC\Files\Cache\Scanner {
}
if ($data['status'] === 'success') {
$this->addResult($data['data'], '');
} elseif ($data['status'] === 'unsupported') {
} else {
throw new \Exception(
'Error while scanning remote share: "' .

View file

@ -27,6 +27,7 @@ namespace OCA\Files_Sharing\External;
use OC\Files\Storage\DAV;
use OC\ForbiddenException;
use OCA\FederatedFileSharing\DiscoveryManager;
use OCA\Files_Sharing\ISharedStorage;
use OCP\Files\NotFoundException;
use OCP\Files\StorageInvalidException;
@ -248,6 +249,12 @@ class Storage extends DAV implements ISharedStorage {
$remote = $this->getRemote();
$token = $this->getToken();
$password = $this->getPassword();
// If remote is not an ownCloud do not try to get any share info
if(!$this->testRemoteUrl($remote . '/status.php')) {
return ['status' => 'unsupported'];
}
$url = rtrim($remote, '/') . '/index.php/apps/files_sharing/shareinfo?t=' . $token;
// TODO: DI