GitHub PullRequestReviewCommentEvent at 2014-12-10 12:09:24
Repository: core
Actor: LukasReschke
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/owncloud/core/pulls/comments/21599297","id":21599297,"diff_hunk":"@@ -2150,6 +2196,104 @@ private static function formatResult($items, $column, $backend, $format = self::\n \t}\n \n \t/**\n+\t * send server-to-server share to remote server\n+\t *\n+\t * @param string $token\n+\t * @param string $shareWith\n+\t * @param string $token\n+\t * @param string $name\n+\t * @param int $remote_id\n+\t * @param string $owner\n+\t * @return bool\n+\t */\n+\tprivate static function sendRemoteShare($token, $shareWith, $token, $name, $remote_id, $owner) {\n+\n+\t\tlist($user, $remote) = explode('@', $shareWith, 2);\n+\n+\t\tif ($user && $remote) {\n+\t\t\t$url = $remote . '/ocs/v1.php/cloud/shares';\n+\n+\t\t\t$local = \\OC::$server->getURLGenerator()->getAbsoluteURL();\n+\n+\t\t\t$fields = array(\n+\t\t\t\t'shareWith' => urlencode($user),\n+\t\t\t\t'token' => urlencode($token),\n+\t\t\t\t'name' => urlencode($name),\n+\t\t\t\t'remoteId' => urlencode($remote_id),\n+\t\t\t\t'owner' => urlencode($owner),\n+\t\t\t\t'remote' => urlencode($local),\n+\t\t\t);\n+\n+\t\t\treturn self::postToRemote($url, $fields);\n+\t\t}\n+\n+\t\treturn false;\n+\t}\n+\n+\t/**\n+\t * check if server supports https\n+\t *\n+\t * @return bool\n+\t */\n+\tprivate static function isHttpsSupported() {\n+\t\treturn (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')\n+\t\t|| $_SERVER['SERVER_PORT'] == 443;\n+\t}\n+\n+\t/**\n+\t * send server-to-server unshare to remote server\n+\t *\n+\t * @param string remote url\n+\t * @param int $id share id\n+\t * @param string $token\n+\t * @return bool\n+\t */\n+\tprivate static function sendRemoteUnshare($remote, $id, $token) {\n+\n+\t\t$url = $remote . '/ocs/v1.php/cloud/shares/' . $id . '/unshare';","path":"lib/private/share/share.php","position":208,"original_position":208,"commit_id":"0a25711d7597f74a5a0abfddef7e0a275854e585","original_commit_id":"0a25711d7597f74a5a0abfddef7e0a275854e585","user":{"login":"LukasReschke","id":878997,"avatar_url":"https://avatars.githubusercontent.com/u/878997?v=3","gravatar_id":"","url":"https://api.github.com/users/LukasReschke","html_url":"https://github.com/LukasReschke","followers_url":"https://api.github.com/users/LukasReschke/followers","following_url":"https://api.github.com/users/LukasReschke/following{/other_user}","gists_url":"https://api.github.com/users/LukasReschke/gists{/gist_id}","starred_url":"https://api.github.com/users/LukasReschke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukasReschke/subscriptions","organizations_url":"https://api.github.com/users/LukasReschke/orgs","repos_url":"https://api.github.com/users/LukasReschke/repos","events_url":"https://api.github.com/users/LukasReschke/events{/privacy}","received_events_url":"https://api.github.com/users/LukasReschke/received_events","type":"User","site_admin":false},"body":"Repeated multiple times in the code - add function to generate URL?","created_at":"2014-12-10T12:09:24Z","updated_at":"2014-12-10T12:09:24Z","html_url":"https://github.com/owncloud/core/pull/12749#discussion_r21599297","pull_request_url":"https://api.github.com/repos/owncloud/core/pulls/12749","_links":{"self":{"href":"https://api.github.com/repos/owncloud/core/pulls/comments/21599297"},"html":{"href":"https://github.com/owncloud/core/pull/12749#discussion_r21599297"},"pull_request":{"href":"https://api.github.com/repos/owncloud/core/pulls/12749"}}},"pull_request":{"url":"https://api.github.com/repos/owncloud/core/pulls/12749","id":25816737,"html_url":"https://github.com/owncloud/core/pull/12749","diff_url":"https://github.com/owncloud/core/pull/12749.diff","patch_url":"https://github.com/owncloud/core/pull/12749.patch","issue_url":"https://api.github.com/repos/owncloud/core/issues/12749","number":12749,"state":"open","locked":false,"title":"server to server sharing next generation","user":{"login":"schiesbn","id":1589737,"avatar_url":"https://avatars.githubusercontent.com/u/1589737?v=3","gravatar_id":"","url":"https://api.github.com/users/schiesbn","html_url":"https://github.com/schiesbn","followers_url":"https://api.github.com/users/schiesbn/followers","following_url":"https://api.github.com/users/schiesbn/following{/other_user}","gists_url":"https://api.github.com/users/schiesbn/gists{/gist_id}","starred_url":"https://api.github.com/users/schiesbn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schiesbn/subscriptions","organizations_url":"https://api.github.com/users/schiesbn/orgs","repos_url":"https://api.github.com/users/schiesbn/repos","events_url":"https://api.github.com/users/schiesbn/events{/privacy}","received_events_url":"https://api.github.com/users/schiesbn/received_events","type":"User","site_admin":false},"body":"Next step in server-to-server sharing next generation, see https://github.com/owncloud/core/issues/12285\r\n\r\nBeside some small improvements and bug fixes this will probably the final state for OC8.\r\n\r\nTo test this you need to set up two ownCloud instances. Let's say:\r\n- URL: myPC/firstOwnCloud user: user1\r\n- URL: myPC/secondOwnCloud user: user2\r\n\r\nNow user1 can share a file with user2 by entering the username and the URL to the second ownCloud to the share-drop-down, in this case \"user2@myPC/secondOwnCloud\".\r\n\r\nThe next time user2 login he will get a notification that he received a server-to-server share with the option to accept/decline it. If he accept it the share will be mounted. In both cases a event will be send back to user1 and add a notification to the activity stream that the share was accepted/declined.\r\n\r\nIf user1 decides to unshare the file again from user2 the share will automatically be removed from the second ownCloud server and user2 will see a notification in his activity stream that user1@myPC/firstOwnCloud has unshared the file/folder from him.\r\n\r\nToDo (I will provide PRs for it):\r\n\r\n- [ ] add implementation  isShareTypeAllowed() in share_backend for calendar\r\n- [ ] add implementation  isShareTypeAllowed() in share_backend for contacts\r\n\r\nThis is ready for testing and reviewing cc @LukasReschke @icewind1991 @MorrisJobke @PVince81 ","created_at":"2014-12-10T11:56:30Z","updated_at":"2014-12-10T12:09:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/owncloud/core/pulls/12749/commits","review_comments_url":"https://api.github.com/repos/owncloud/core/pulls/12749/comments","review_comment_url":"https://api.github.com/repos/owncloud/core/pulls/comments/{number}","comments_url":"https://api.github.com/repos/owncloud/core/issues/12749/comments","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/0a25711d7597f74a5a0abfddef7e0a275854e585","head":{"label":"owncloud:server2server-sharing-ng","ref":"server2server-sharing-ng","sha":"0a25711d7597f74a5a0abfddef7e0a275854e585","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":5550552,"name":"core","full_name":"owncloud/core","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/core","description":"The ownCloud core","fork":false,"url":"https://api.github.com/repos/owncloud/core","forks_url":"https://api.github.com/repos/owncloud/core/forks","keys_url":"https://api.github.com/repos/owncloud/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/core/teams","hooks_url":"https://api.github.com/repos/owncloud/core/hooks","issue_events_url":"https://api.github.com/repos/owncloud/core/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/core/events","assignees_url":"https://api.github.com/repos/owncloud/core/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/core/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/core/tags","blobs_url":"https://api.github.com/repos/owncloud/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/core/languages","stargazers_url":"https://api.github.com/repos/owncloud/core/stargazers","contributors_url":"https://api.github.com/repos/owncloud/core/contributors","subscribers_url":"https://api.github.com/repos/owncloud/core/subscribers","subscription_url":"https://api.github.com/repos/owncloud/core/subscription","commits_url":"https://api.github.com/repos/owncloud/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/core/issues/comments/{number}","contents_url":"https://api.github.com/repos/owncloud/core/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/core/merges","archive_url":"https://api.github.com/repos/owncloud/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/core/downloads","issues_url":"https://api.github.com/repos/owncloud/core/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/core/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/core/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/core/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/core/releases{/id}","created_at":"2012-08-25T10:32:48Z","updated_at":"2014-12-10T11:26:22Z","pushed_at":"2014-12-10T12:05:48Z","git_url":"git://github.com/owncloud/core.git","ssh_url":"git@github.com:owncloud/core.git","clone_url":"https://github.com/owncloud/core.git","svn_url":"https://github.com/owncloud/core","homepage":null,"size":811780,"stargazers_count":2818,"watchers_count":2818,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":914,"mirror_url":null,"open_issues_count":1464,"forks":914,"open_issues":1464,"watchers":2818,"default_branch":"master"}},"base":{"label":"owncloud:master","ref":"master","sha":"269ae49c1c5723031386ce5d706282acc7fef6da","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":5550552,"name":"core","full_name":"owncloud/core","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/core","description":"The ownCloud core","fork":false,"url":"https://api.github.com/repos/owncloud/core","forks_url":"https://api.github.com/repos/owncloud/core/forks","keys_url":"https://api.github.com/repos/owncloud/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/core/teams","hooks_url":"https://api.github.com/repos/owncloud/core/hooks","issue_events_url":"https://api.github.com/repos/owncloud/core/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/core/events","assignees_url":"https://api.github.com/repos/owncloud/core/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/core/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/core/tags","blobs_url":"https://api.github.com/repos/owncloud/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/core/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/core/languages","stargazers_url":"https://api.github.com/repos/owncloud/core/stargazers","contributors_url":"https://api.github.com/repos/owncloud/core/contributors","subscribers_url":"https://api.github.com/repos/owncloud/core/subscribers","subscription_url":"https://api.github.com/repos/owncloud/core/subscription","commits_url":"https://api.github.com/repos/owncloud/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/core/issues/comments/{number}","contents_url":"https://api.github.com/repos/owncloud/core/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/core/merges","archive_url":"https://api.github.com/repos/owncloud/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/core/downloads","issues_url":"https://api.github.com/repos/owncloud/core/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/core/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/core/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/core/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/core/releases{/id}","created_at":"2012-08-25T10:32:48Z","updated_at":"2014-12-10T11:26:22Z","pushed_at":"2014-12-10T12:05:48Z","git_url":"git://github.com/owncloud/core.git","ssh_url":"git@github.com:owncloud/core.git","clone_url":"https://github.com/owncloud/core.git","svn_url":"https://github.com/owncloud/core","homepage":null,"size":811780,"stargazers_count":2818,"watchers_count":2818,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":914,"mirror_url":null,"open_issues_count":1464,"forks":914,"open_issues":1464,"watchers":2818,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/owncloud/core/pulls/12749"},"html":{"href":"https://github.com/owncloud/core/pull/12749"},"issue":{"href":"https://api.github.com/repos/owncloud/core/issues/12749"},"comments":{"href":"https://api.github.com/repos/owncloud/core/issues/12749/comments"},"review_comments":{"href":"https://api.github.com/repos/owncloud/core/pulls/12749/comments"},"review_comment":{"href":"https://api.github.com/repos/owncloud/core/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/owncloud/core/pulls/12749/commits"},"statuses":{"href":"https://api.github.com/repos/owncloud/core/statuses/0a25711d7597f74a5a0abfddef7e0a275854e585"}}}}