summaryrefslogtreecommitdiffstats
path: root/lib/private/share/share.php
diff options
context:
space:
mode:
authorBjörn Schießle <bjoern@schiessle.org>2015-11-23 17:01:53 +0100
committerBjörn Schießle <bjoern@schiessle.org>2015-11-24 11:34:38 +0100
commit964fa1fce3bc7734b6f7435f730e3b7394fc1cbf (patch)
tree6874e081ee2758fb9320f25ad5de9572f29f99ad /lib/private/share/share.php
parent7062e6636d52cae1ef086ab1f6caa97b10df3c0b (diff)
downloadnextcloud-server-964fa1fce3bc7734b6f7435f730e3b7394fc1cbf.tar.gz
nextcloud-server-964fa1fce3bc7734b6f7435f730e3b7394fc1cbf.zip
use hooks to auto add server to the list of trusted servers once a federated share was created
Diffstat (limited to 'lib/private/share/share.php')
-rw-r--r--lib/private/share/share.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index 6aac0d6264d..1308c99f804 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -2566,7 +2566,10 @@ class Share extends Constants {
$result = self::tryHttpPost($url, $fields);
$status = json_decode($result['result'], true);
- return ($result['success'] && $status['ocs']['meta']['statuscode'] === 100);
+ if ($result['success'] && $status['ocs']['meta']['statuscode'] === 100) {
+ \OC_Hook::emit('OCP\Share', 'federated_share_added', ['server' => $remote]);
+ return true;
+ }
}