{"action":"created","comment":{"url":"https://api.github.com/repos/nextcloud/activity/pulls/comments/75679103","id":75679103,"diff_hunk":"@@ -176,7 +179,24 @@ public function __construct (array $urlParams = array()) {\n \t\t\t$server = $c->query('ServerContainer');\n \n \t\t\t$user = $server->getUserSession()->getUser();\n-\t\t\treturn ($user) ? $user->getUID() : '';\n+\t\t\tif ($user instanceof IUser) {\n+\t\t\t\treturn (string) $user->getUID();\n+\t\t\t}\n+\n+\t\t\t$request = $server->getRequest();\n+\t\t\tif (!empty($request->server['PHP_AUTH_USER'])) {\n+\t\t\t\t$token = $request->server['PHP_AUTH_USER'];\n+\t\t\t\ttry {\n+\t\t\t\t\t$share = $server->getShareManager()->getShareByToken($token);\n+\t\t\t\t\tif ($share->getShareType() === Share::SHARE_TYPE_REMOTE) {","path":"lib/AppInfo/Application.php","position":24,"original_position":24,"commit_id":"cb3e275e359b2759dd593843dbc82174d596f44b","original_commit_id":"cb3e275e359b2759dd593843dbc82174d596f44b","user":{"login":"rullzer","id":45821,"avatar_url":"https://avatars.githubusercontent.com/u/45821?v=3","gravatar_id":"","url":"https://api.github.com/users/rullzer","html_url":"https://github.com/rullzer","followers_url":"https://api.github.com/users/rullzer/followers","following_url":"https://api.github.com/users/rullzer/following{/other_user}","gists_url":"https://api.github.com/users/rullzer/gists{/gist_id}","starred_url":"https://api.github.com/users/rullzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rullzer/subscriptions","organizations_url":"https://api.github.com/users/rullzer/orgs","repos_url":"https://api.github.com/users/rullzer/repos","events_url":"https://api.github.com/users/rullzer/events{/privacy}","received_events_url":"https://api.github.com/users/rullzer/received_events","type":"User","site_admin":false},"body":"Yep that is good. We use those constants all over the place. I might move them to the share manager at some point. But we need a deprecation period anyways.","created_at":"2016-08-22T13:43:14Z","updated_at":"2016-08-22T13:43:14Z","html_url":"https://github.com/nextcloud/activity/pull/25#discussion_r75679103","pull_request_url":"https://api.github.com/repos/nextcloud/activity/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/nextcloud/activity/pulls/comments/75679103"},"html":{"href":"https://github.com/nextcloud/activity/pull/25#discussion_r75679103"},"pull_request":{"href":"https://api.github.com/repos/nextcloud/activity/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/nextcloud/activity/pulls/25","id":81615172,"html_url":"https://github.com/nextcloud/activity/pull/25","diff_url":"https://github.com/nextcloud/activity/pull/25.diff","patch_url":"https://github.com/nextcloud/activity/pull/25.patch","issue_url":"https://api.github.com/repos/nextcloud/activity/issues/25","number":25,"state":"open","locked":false,"title":"Try to identify remote users by their token","user":{"login":"nickvergessen","id":213943,"avatar_url":"https://avatars.githubusercontent.com/u/213943?v=3","gravatar_id":"","url":"https://api.github.com/users/nickvergessen","html_url":"https://github.com/nickvergessen","followers_url":"https://api.github.com/users/nickvergessen/followers","following_url":"https://api.github.com/users/nickvergessen/following{/other_user}","gists_url":"https://api.github.com/users/nickvergessen/gists{/gist_id}","starred_url":"https://api.github.com/users/nickvergessen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickvergessen/subscriptions","organizations_url":"https://api.github.com/users/nickvergessen/orgs","repos_url":"https://api.github.com/users/nickvergessen/repos","events_url":"https://api.github.com/users/nickvergessen/events{/privacy}","received_events_url":"https://api.github.com/users/nickvergessen/received_events","type":"User","site_admin":false},"body":"- [ ] Tests","created_at":"2016-08-17T10:00:34Z","updated_at":"2016-08-22T13:43:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a6057b73078d860ddae3ea140a92fc624275923e","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/nextcloud/activity/milestones/3","html_url":"https://github.com/nextcloud/activity/milestones/Nextcloud%2011.0","labels_url":"https://api.github.com/repos/nextcloud/activity/milestones/3/labels","id":1896998,"number":3,"title":"Nextcloud 11.0","description":null,"creator":{"login":"MorrisJobke","id":245432,"avatar_url":"https://avatars.githubusercontent.com/u/245432?v=3","gravatar_id":"","url":"https://api.github.com/users/MorrisJobke","html_url":"https://github.com/MorrisJobke","followers_url":"https://api.github.com/users/MorrisJobke/followers","following_url":"https://api.github.com/users/MorrisJobke/following{/other_user}","gists_url":"https://api.github.com/users/MorrisJobke/gists{/gist_id}","starred_url":"https://api.github.com/users/MorrisJobke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorrisJobke/subscriptions","organizations_url":"https://api.github.com/users/MorrisJobke/orgs","repos_url":"https://api.github.com/users/MorrisJobke/repos","events_url":"https://api.github.com/users/MorrisJobke/events{/privacy}","received_events_url":"https://api.github.com/users/MorrisJobke/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":8,"state":"open","created_at":"2016-07-21T15:58:16Z","updated_at":"2016-08-22T11:22:07Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/nextcloud/activity/pulls/25/commits","review_comments_url":"https://api.github.com/repos/nextcloud/activity/pulls/25/comments","review_comment_url":"https://api.github.com/repos/nextcloud/activity/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nextcloud/activity/issues/25/comments","statuses_url":"https://api.github.com/repos/nextcloud/activity/statuses/cb3e275e359b2759dd593843dbc82174d596f44b","head":{"label":"nextcloud:identify-remote-users-by-token","ref":"identify-remote-users-by-token","sha":"cb3e275e359b2759dd593843dbc82174d596f44b","user":{"login":"nextcloud","id":19211038,"avatar_url":"https://avatars.githubusercontent.com/u/19211038?v=3","gravatar_id":"","url":"https://api.github.com/users/nextcloud","html_url":"https://github.com/nextcloud","followers_url":"https://api.github.com/users/nextcloud/followers","following_url":"https://api.github.com/users/nextcloud/following{/other_user}","gists_url":"https://api.github.com/users/nextcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/nextcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextcloud/subscriptions","organizations_url":"https://api.github.com/users/nextcloud/orgs","repos_url":"https://api.github.com/users/nextcloud/repos","events_url":"https://api.github.com/users/nextcloud/events{/privacy}","received_events_url":"https://api.github.com/users/nextcloud/received_events","type":"Organization","site_admin":false},"repo":{"id":62379768,"name":"activity","full_name":"nextcloud/activity","owner":{"login":"nextcloud","id":19211038,"avatar_url":"https://avatars.githubusercontent.com/u/19211038?v=3","gravatar_id":"","url":"https://api.github.com/users/nextcloud","html_url":"https://github.com/nextcloud","followers_url":"https://api.github.com/users/nextcloud/followers","following_url":"https://api.github.com/users/nextcloud/following{/other_user}","gists_url":"https://api.github.com/users/nextcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/nextcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextcloud/subscriptions","organizations_url":"https://api.github.com/users/nextcloud/orgs","repos_url":"https://api.github.com/users/nextcloud/repos","events_url":"https://api.github.com/users/nextcloud/events{/privacy}","received_events_url":"https://api.github.com/users/nextcloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nextcloud/activity","description":"⚡ Activity app for Nextcloud","fork":false,"url":"https://api.github.com/repos/nextcloud/activity","forks_url":"https://api.github.com/repos/nextcloud/activity/forks","keys_url":"https://api.github.com/repos/nextcloud/activity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nextcloud/activity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nextcloud/activity/teams","hooks_url":"https://api.github.com/repos/nextcloud/activity/hooks","issue_events_url":"https://api.github.com/repos/nextcloud/activity/issues/events{/number}","events_url":"https://api.github.com/repos/nextcloud/activity/events","assignees_url":"https://api.github.com/repos/nextcloud/activity/assignees{/user}","branches_url":"https://api.github.com/repos/nextcloud/activity/branches{/branch}","tags_url":"https://api.github.com/repos/nextcloud/activity/tags","blobs_url":"https://api.github.com/repos/nextcloud/activity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nextcloud/activity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nextcloud/activity/git/refs{/sha}","trees_url":"https://api.github.com/repos/nextcloud/activity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nextcloud/activity/statuses/{sha}","languages_url":"https://api.github.com/repos/nextcloud/activity/languages","stargazers_url":"https://api.github.com/repos/nextcloud/activity/stargazers","contributors_url":"https://api.github.com/repos/nextcloud/activity/contributors","subscribers_url":"https://api.github.com/repos/nextcloud/activity/subscribers","subscription_url":"https://api.github.com/repos/nextcloud/activity/subscription","commits_url":"https://api.github.com/repos/nextcloud/activity/commits{/sha}","git_commits_url":"https://api.github.com/repos/nextcloud/activity/git/commits{/sha}","comments_url":"https://api.github.com/repos/nextcloud/activity/comments{/number}","issue_comment_url":"https://api.github.com/repos/nextcloud/activity/issues/comments{/number}","contents_url":"https://api.github.com/repos/nextcloud/activity/contents/{+path}","compare_url":"https://api.github.com/repos/nextcloud/activity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nextcloud/activity/merges","archive_url":"https://api.github.com/repos/nextcloud/activity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nextcloud/activity/downloads","issues_url":"https://api.github.com/repos/nextcloud/activity/issues{/number}","pulls_url":"https://api.github.com/repos/nextcloud/activity/pulls{/number}","milestones_url":"https://api.github.com/repos/nextcloud/activity/milestones{/number}","notifications_url":"https://api.github.com/repos/nextcloud/activity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nextcloud/activity/labels{/name}","releases_url":"https://api.github.com/repos/nextcloud/activity/releases{/id}","deployments_url":"https://api.github.com/repos/nextcloud/activity/deployments","created_at":"2016-07-01T09:01:52Z","updated_at":"2016-08-08T16:36:54Z","pushed_at":"2016-08-19T12:26:26Z","git_url":"git://github.com/nextcloud/activity.git","ssh_url":"git@github.com:nextcloud/activity.git","clone_url":"https://github.com/nextcloud/activity.git","svn_url":"https://github.com/nextcloud/activity","homepage":null,"size":2857,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"nextcloud:master","ref":"master","sha":"c39b71b42630559a28b82a6ee9977fb3fc1cd09f","user":{"login":"nextcloud","id":19211038,"avatar_url":"https://avatars.githubusercontent.com/u/19211038?v=3","gravatar_id":"","url":"https://api.github.com/users/nextcloud","html_url":"https://github.com/nextcloud","followers_url":"https://api.github.com/users/nextcloud/followers","following_url":"https://api.github.com/users/nextcloud/following{/other_user}","gists_url":"https://api.github.com/users/nextcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/nextcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextcloud/subscriptions","organizations_url":"https://api.github.com/users/nextcloud/orgs","repos_url":"https://api.github.com/users/nextcloud/repos","events_url":"https://api.github.com/users/nextcloud/events{/privacy}","received_events_url":"https://api.github.com/users/nextcloud/received_events","type":"Organization","site_admin":false},"repo":{"id":62379768,"name":"activity","full_name":"nextcloud/activity","owner":{"login":"nextcloud","id":19211038,"avatar_url":"https://avatars.githubusercontent.com/u/19211038?v=3","gravatar_id":"","url":"https://api.github.com/users/nextcloud","html_url":"https://github.com/nextcloud","followers_url":"https://api.github.com/users/nextcloud/followers","following_url":"https://api.github.com/users/nextcloud/following{/other_user}","gists_url":"https://api.github.com/users/nextcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/nextcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextcloud/subscriptions","organizations_url":"https://api.github.com/users/nextcloud/orgs","repos_url":"https://api.github.com/users/nextcloud/repos","events_url":"https://api.github.com/users/nextcloud/events{/privacy}","received_events_url":"https://api.github.com/users/nextcloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nextcloud/activity","description":"⚡ Activity app for Nextcloud","fork":false,"url":"https://api.github.com/repos/nextcloud/activity","forks_url":"https://api.github.com/repos/nextcloud/activity/forks","keys_url":"https://api.github.com/repos/nextcloud/activity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nextcloud/activity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nextcloud/activity/teams","hooks_url":"https://api.github.com/repos/nextcloud/activity/hooks","issue_events_url":"https://api.github.com/repos/nextcloud/activity/issues/events{/number}","events_url":"https://api.github.com/repos/nextcloud/activity/events","assignees_url":"https://api.github.com/repos/nextcloud/activity/assignees{/user}","branches_url":"https://api.github.com/repos/nextcloud/activity/branches{/branch}","tags_url":"https://api.github.com/repos/nextcloud/activity/tags","blobs_url":"https://api.github.com/repos/nextcloud/activity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nextcloud/activity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nextcloud/activity/git/refs{/sha}","trees_url":"https://api.github.com/repos/nextcloud/activity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nextcloud/activity/statuses/{sha}","languages_url":"https://api.github.com/repos/nextcloud/activity/languages","stargazers_url":"https://api.github.com/repos/nextcloud/activity/stargazers","contributors_url":"https://api.github.com/repos/nextcloud/activity/contributors","subscribers_url":"https://api.github.com/repos/nextcloud/activity/subscribers","subscription_url":"https://api.github.com/repos/nextcloud/activity/subscription","commits_url":"https://api.github.com/repos/nextcloud/activity/commits{/sha}","git_commits_url":"https://api.github.com/repos/nextcloud/activity/git/commits{/sha}","comments_url":"https://api.github.com/repos/nextcloud/activity/comments{/number}","issue_comment_url":"https://api.github.com/repos/nextcloud/activity/issues/comments{/number}","contents_url":"https://api.github.com/repos/nextcloud/activity/contents/{+path}","compare_url":"https://api.github.com/repos/nextcloud/activity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nextcloud/activity/merges","archive_url":"https://api.github.com/repos/nextcloud/activity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nextcloud/activity/downloads","issues_url":"https://api.github.com/repos/nextcloud/activity/issues{/number}","pulls_url":"https://api.github.com/repos/nextcloud/activity/pulls{/number}","milestones_url":"https://api.github.com/repos/nextcloud/activity/milestones{/number}","notifications_url":"https://api.github.com/repos/nextcloud/activity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nextcloud/activity/labels{/name}","releases_url":"https://api.github.com/repos/nextcloud/activity/releases{/id}","deployments_url":"https://api.github.com/repos/nextcloud/activity/deployments","created_at":"2016-07-01T09:01:52Z","updated_at":"2016-08-08T16:36:54Z","pushed_at":"2016-08-19T12:26:26Z","git_url":"git://github.com/nextcloud/activity.git","ssh_url":"git@github.com:nextcloud/activity.git","clone_url":"https://github.com/nextcloud/activity.git","svn_url":"https://github.com/nextcloud/activity","homepage":null,"size":2857,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nextcloud/activity/pulls/25"},"html":{"href":"https://github.com/nextcloud/activity/pull/25"},"issue":{"href":"https://api.github.com/repos/nextcloud/activity/issues/25"},"comments":{"href":"https://api.github.com/repos/nextcloud/activity/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/nextcloud/activity/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/nextcloud/activity/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nextcloud/activity/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/nextcloud/activity/statuses/cb3e275e359b2759dd593843dbc82174d596f44b"}}}}
{"actor":{"display_login":"rullzer"}}