{"action":"created","comment":{"url":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/comments/76533729","id":76533729,"diff_hunk":"@@ -0,0 +1,395 @@\n+<?php\n+\n+/**\n+ * @file\n+ * Invite new members to a group or project.\n+ */\n+\n+/**\n+ * Implements hook_menu().\n+ */\n+function c4m_og_invite_visitors_menu() {\n+  $items = array();\n+  $items['group/%/%/admin/members/invite'] = array(\n+    'page callback' => 'drupal_get_form',\n+    'title' => 'Invite members',\n+    'page arguments' => array('_c4m_og_invite_visitors_new_users_form', 1, 2),\n+    'type' => MENU_LOCAL_TASK,\n+    'weight' => 4,\n+    'access callback' => 'c4m_og_invite_visitors_user_access',\n+    'access arguments' => array('invite members', 1, 2),\n+  );\n+\n+  return $items;\n+}\n+\n+/**\n+ * Implements hook_og_ui_get_group_admin().\n+ */\n+function c4m_og_invite_visitors_og_ui_get_group_admin($group_type, $gid) {\n+  $items = array();\n+  if (og_user_access($group_type, $gid, 'invite members')) {\n+    $items['c4m_og_invite_visitors'] = array(\n+      'title' => t('Invite members'),\n+      'description' => t('Create new users and add them as group members.'),\n+      'href' => 'admin/members/invite',\n+    );\n+  }\n+\n+  return $items;\n+}\n+\n+/**\n+ * Check if entity is a group, and user has permission - Access.\n+ */\n+function c4m_og_invite_visitors_user_access($perm, $group_type, $gid) {\n+  global $user;\n+\n+  $group = entity_load_single($group_type, $gid);\n+  if (!$group || !og_is_group($group_type, $group)) {\n+    return FALSE;\n+  }\n+\n+  // SAs, GOs and GAs can invite new members.\n+  if (_c4m_features_og_members_is_power_user($group)) {\n+    return TRUE;\n+  }\n+\n+  // Get request type (open/moderated).\n+  $membership_request_value = c4m_og_get_group_membership_request($group);\n+  // Get access type (public/private).\n+  $access_type = c4m_og_get_access_type($group);\n+\n+  // For private or moderated groups, return false. Else check for member.\n+  if ($access_type['type'] == 'private' || $membership_request_value == 'moderated') {\n+    return FALSE;\n+  }\n+  else {\n+    return og_is_member($group->type, $group->nid, 'user', $user);\n+  }\n+}\n+\n+/**\n+ * Implements hook_og_permission().\n+ */\n+function c4m_og_invite_visitors_og_permission() {\n+  $items = array();\n+  $items['invite members'] = array(\n+    'title' => t('Invite members'),\n+    'description' => t('Users may invite other users to the group without approval.'),\n+    'default role' => array(OG_ADMINISTRATOR_ROLE),\n+  );\n+\n+  return $items;\n+}\n+\n+/**\n+ * Main OG Invite members form.\n+ */\n+function _c4m_og_invite_visitors_new_users_form($form, &$form_state, $group_type, $gid) {\n+  og_set_breadcrumb($group_type, $gid, array(l(t('Group'), \"$group_type/$gid/group\")));\n+  $group = entity_load_single($group_type, $gid);\n+  $label = entity_label($group_type, $group);\n+  list(, , $bundle) = entity_extract_ids($group_type, $group);\n+  $og_roles = array('') + og_roles($group_type, $bundle, $gid, FALSE, FALSE);\n+\n+  $form['group_type'] = array('#type' => 'value', '#value' => $group_type);","path":"project/profiles/capacity4more/modules/c4m/og/c4m_og_invite_visitors/c4m_og_invite_visitors.module","position":96,"original_position":96,"commit_id":"90c581b74ea8d9d6a5b8274c3848e519f3c68baa","original_commit_id":"90c581b74ea8d9d6a5b8274c3848e519f3c68baa","user":{"login":"ordavidil","id":5985683,"avatar_url":"https://avatars.githubusercontent.com/u/5985683?v=3","gravatar_id":"","url":"https://api.github.com/users/ordavidil","html_url":"https://github.com/ordavidil","followers_url":"https://api.github.com/users/ordavidil/followers","following_url":"https://api.github.com/users/ordavidil/following{/other_user}","gists_url":"https://api.github.com/users/ordavidil/gists{/gist_id}","starred_url":"https://api.github.com/users/ordavidil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ordavidil/subscriptions","organizations_url":"https://api.github.com/users/ordavidil/orgs","repos_url":"https://api.github.com/users/ordavidil/repos","events_url":"https://api.github.com/users/ordavidil/events{/privacy}","received_events_url":"https://api.github.com/users/ordavidil/received_events","type":"User","site_admin":false},"body":"break the array.","created_at":"2016-08-28T15:14:19Z","updated_at":"2016-08-28T15:14:19Z","html_url":"https://github.com/capacity4dev/capacity4more/pull/1142#discussion_r76533729","pull_request_url":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/1142","_links":{"self":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/comments/76533729"},"html":{"href":"https://github.com/capacity4dev/capacity4more/pull/1142#discussion_r76533729"},"pull_request":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/1142"}}},"pull_request":{"url":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/1142","id":80468820,"html_url":"https://github.com/capacity4dev/capacity4more/pull/1142","diff_url":"https://github.com/capacity4dev/capacity4more/pull/1142.diff","patch_url":"https://github.com/capacity4dev/capacity4more/pull/1142.patch","issue_url":"https://api.github.com/repos/capacity4dev/capacity4more/issues/1142","number":1142,"state":"open","locked":false,"title":"[CFM-1034] -Group invitation email templates.","user":{"login":"ybaras","id":4599242,"avatar_url":"https://avatars.githubusercontent.com/u/4599242?v=3","gravatar_id":"","url":"https://api.github.com/users/ybaras","html_url":"https://github.com/ybaras","followers_url":"https://api.github.com/users/ybaras/followers","following_url":"https://api.github.com/users/ybaras/following{/other_user}","gists_url":"https://api.github.com/users/ybaras/gists{/gist_id}","starred_url":"https://api.github.com/users/ybaras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ybaras/subscriptions","organizations_url":"https://api.github.com/users/ybaras/orgs","repos_url":"https://api.github.com/users/ybaras/repos","events_url":"https://api.github.com/users/ybaras/events{/privacy}","received_events_url":"https://api.github.com/users/ybaras/received_events","type":"User","site_admin":false},"body":"+ https://issuetracker.amplexor.com/jira/browse/CFM-1034\r\n+ https://issuetracker.amplexor.com/jira/browse/CFM-1033\r\n+ https://issuetracker.amplexor.com/jira/browse/CFM-1032","created_at":"2016-08-08T15:16:11Z","updated_at":"2016-08-28T15:14:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3b0de4ceacbd9ee70e728a9f3aec2eb7f9dcb4fa","assignee":{"login":"ordavidil","id":5985683,"avatar_url":"https://avatars.githubusercontent.com/u/5985683?v=3","gravatar_id":"","url":"https://api.github.com/users/ordavidil","html_url":"https://github.com/ordavidil","followers_url":"https://api.github.com/users/ordavidil/followers","following_url":"https://api.github.com/users/ordavidil/following{/other_user}","gists_url":"https://api.github.com/users/ordavidil/gists{/gist_id}","starred_url":"https://api.github.com/users/ordavidil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ordavidil/subscriptions","organizations_url":"https://api.github.com/users/ordavidil/orgs","repos_url":"https://api.github.com/users/ordavidil/repos","events_url":"https://api.github.com/users/ordavidil/events{/privacy}","received_events_url":"https://api.github.com/users/ordavidil/received_events","type":"User","site_admin":false},"assignees":[{"login":"ordavidil","id":5985683,"avatar_url":"https://avatars.githubusercontent.com/u/5985683?v=3","gravatar_id":"","url":"https://api.github.com/users/ordavidil","html_url":"https://github.com/ordavidil","followers_url":"https://api.github.com/users/ordavidil/followers","following_url":"https://api.github.com/users/ordavidil/following{/other_user}","gists_url":"https://api.github.com/users/ordavidil/gists{/gist_id}","starred_url":"https://api.github.com/users/ordavidil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ordavidil/subscriptions","organizations_url":"https://api.github.com/users/ordavidil/orgs","repos_url":"https://api.github.com/users/ordavidil/repos","events_url":"https://api.github.com/users/ordavidil/events{/privacy}","received_events_url":"https://api.github.com/users/ordavidil/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/1142/commits","review_comments_url":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/1142/comments","review_comment_url":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/comments{/number}","comments_url":"https://api.github.com/repos/capacity4dev/capacity4more/issues/1142/comments","statuses_url":"https://api.github.com/repos/capacity4dev/capacity4more/statuses/90c581b74ea8d9d6a5b8274c3848e519f3c68baa","head":{"label":"capacity4dev:feature/CFM-1034","ref":"feature/CFM-1034","sha":"90c581b74ea8d9d6a5b8274c3848e519f3c68baa","user":{"login":"capacity4dev","id":6919578,"avatar_url":"https://avatars.githubusercontent.com/u/6919578?v=3","gravatar_id":"","url":"https://api.github.com/users/capacity4dev","html_url":"https://github.com/capacity4dev","followers_url":"https://api.github.com/users/capacity4dev/followers","following_url":"https://api.github.com/users/capacity4dev/following{/other_user}","gists_url":"https://api.github.com/users/capacity4dev/gists{/gist_id}","starred_url":"https://api.github.com/users/capacity4dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capacity4dev/subscriptions","organizations_url":"https://api.github.com/users/capacity4dev/orgs","repos_url":"https://api.github.com/users/capacity4dev/repos","events_url":"https://api.github.com/users/capacity4dev/events{/privacy}","received_events_url":"https://api.github.com/users/capacity4dev/received_events","type":"Organization","site_admin":false},"repo":{"id":18283391,"name":"capacity4more","full_name":"capacity4dev/capacity4more","owner":{"login":"capacity4dev","id":6919578,"avatar_url":"https://avatars.githubusercontent.com/u/6919578?v=3","gravatar_id":"","url":"https://api.github.com/users/capacity4dev","html_url":"https://github.com/capacity4dev","followers_url":"https://api.github.com/users/capacity4dev/followers","following_url":"https://api.github.com/users/capacity4dev/following{/other_user}","gists_url":"https://api.github.com/users/capacity4dev/gists{/gist_id}","starred_url":"https://api.github.com/users/capacity4dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capacity4dev/subscriptions","organizations_url":"https://api.github.com/users/capacity4dev/orgs","repos_url":"https://api.github.com/users/capacity4dev/repos","events_url":"https://api.github.com/users/capacity4dev/events{/privacy}","received_events_url":"https://api.github.com/users/capacity4dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/capacity4dev/capacity4more","description":"A Drupal 7 powered distribution providing a community platform to share knowledge.","fork":false,"url":"https://api.github.com/repos/capacity4dev/capacity4more","forks_url":"https://api.github.com/repos/capacity4dev/capacity4more/forks","keys_url":"https://api.github.com/repos/capacity4dev/capacity4more/keys{/key_id}","collaborators_url":"https://api.github.com/repos/capacity4dev/capacity4more/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/capacity4dev/capacity4more/teams","hooks_url":"https://api.github.com/repos/capacity4dev/capacity4more/hooks","issue_events_url":"https://api.github.com/repos/capacity4dev/capacity4more/issues/events{/number}","events_url":"https://api.github.com/repos/capacity4dev/capacity4more/events","assignees_url":"https://api.github.com/repos/capacity4dev/capacity4more/assignees{/user}","branches_url":"https://api.github.com/repos/capacity4dev/capacity4more/branches{/branch}","tags_url":"https://api.github.com/repos/capacity4dev/capacity4more/tags","blobs_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/refs{/sha}","trees_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/trees{/sha}","statuses_url":"https://api.github.com/repos/capacity4dev/capacity4more/statuses/{sha}","languages_url":"https://api.github.com/repos/capacity4dev/capacity4more/languages","stargazers_url":"https://api.github.com/repos/capacity4dev/capacity4more/stargazers","contributors_url":"https://api.github.com/repos/capacity4dev/capacity4more/contributors","subscribers_url":"https://api.github.com/repos/capacity4dev/capacity4more/subscribers","subscription_url":"https://api.github.com/repos/capacity4dev/capacity4more/subscription","commits_url":"https://api.github.com/repos/capacity4dev/capacity4more/commits{/sha}","git_commits_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/commits{/sha}","comments_url":"https://api.github.com/repos/capacity4dev/capacity4more/comments{/number}","issue_comment_url":"https://api.github.com/repos/capacity4dev/capacity4more/issues/comments{/number}","contents_url":"https://api.github.com/repos/capacity4dev/capacity4more/contents/{+path}","compare_url":"https://api.github.com/repos/capacity4dev/capacity4more/compare/{base}...{head}","merges_url":"https://api.github.com/repos/capacity4dev/capacity4more/merges","archive_url":"https://api.github.com/repos/capacity4dev/capacity4more/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/capacity4dev/capacity4more/downloads","issues_url":"https://api.github.com/repos/capacity4dev/capacity4more/issues{/number}","pulls_url":"https://api.github.com/repos/capacity4dev/capacity4more/pulls{/number}","milestones_url":"https://api.github.com/repos/capacity4dev/capacity4more/milestones{/number}","notifications_url":"https://api.github.com/repos/capacity4dev/capacity4more/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/capacity4dev/capacity4more/labels{/name}","releases_url":"https://api.github.com/repos/capacity4dev/capacity4more/releases{/id}","deployments_url":"https://api.github.com/repos/capacity4dev/capacity4more/deployments","created_at":"2014-03-31T06:03:43Z","updated_at":"2016-03-22T10:14:07Z","pushed_at":"2016-08-28T14:04:33Z","git_url":"git://github.com/capacity4dev/capacity4more.git","ssh_url":"git@github.com:capacity4dev/capacity4more.git","clone_url":"https://github.com/capacity4dev/capacity4more.git","svn_url":"https://github.com/capacity4dev/capacity4more","homepage":null,"size":98512,"stargazers_count":9,"watchers_count":9,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":113,"forks":5,"open_issues":113,"watchers":9,"default_branch":"develop"}},"base":{"label":"capacity4dev:develop","ref":"develop","sha":"10a4cf402d2ec68bafcf8e931d27b937f145b0c7","user":{"login":"capacity4dev","id":6919578,"avatar_url":"https://avatars.githubusercontent.com/u/6919578?v=3","gravatar_id":"","url":"https://api.github.com/users/capacity4dev","html_url":"https://github.com/capacity4dev","followers_url":"https://api.github.com/users/capacity4dev/followers","following_url":"https://api.github.com/users/capacity4dev/following{/other_user}","gists_url":"https://api.github.com/users/capacity4dev/gists{/gist_id}","starred_url":"https://api.github.com/users/capacity4dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capacity4dev/subscriptions","organizations_url":"https://api.github.com/users/capacity4dev/orgs","repos_url":"https://api.github.com/users/capacity4dev/repos","events_url":"https://api.github.com/users/capacity4dev/events{/privacy}","received_events_url":"https://api.github.com/users/capacity4dev/received_events","type":"Organization","site_admin":false},"repo":{"id":18283391,"name":"capacity4more","full_name":"capacity4dev/capacity4more","owner":{"login":"capacity4dev","id":6919578,"avatar_url":"https://avatars.githubusercontent.com/u/6919578?v=3","gravatar_id":"","url":"https://api.github.com/users/capacity4dev","html_url":"https://github.com/capacity4dev","followers_url":"https://api.github.com/users/capacity4dev/followers","following_url":"https://api.github.com/users/capacity4dev/following{/other_user}","gists_url":"https://api.github.com/users/capacity4dev/gists{/gist_id}","starred_url":"https://api.github.com/users/capacity4dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capacity4dev/subscriptions","organizations_url":"https://api.github.com/users/capacity4dev/orgs","repos_url":"https://api.github.com/users/capacity4dev/repos","events_url":"https://api.github.com/users/capacity4dev/events{/privacy}","received_events_url":"https://api.github.com/users/capacity4dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/capacity4dev/capacity4more","description":"A Drupal 7 powered distribution providing a community platform to share knowledge.","fork":false,"url":"https://api.github.com/repos/capacity4dev/capacity4more","forks_url":"https://api.github.com/repos/capacity4dev/capacity4more/forks","keys_url":"https://api.github.com/repos/capacity4dev/capacity4more/keys{/key_id}","collaborators_url":"https://api.github.com/repos/capacity4dev/capacity4more/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/capacity4dev/capacity4more/teams","hooks_url":"https://api.github.com/repos/capacity4dev/capacity4more/hooks","issue_events_url":"https://api.github.com/repos/capacity4dev/capacity4more/issues/events{/number}","events_url":"https://api.github.com/repos/capacity4dev/capacity4more/events","assignees_url":"https://api.github.com/repos/capacity4dev/capacity4more/assignees{/user}","branches_url":"https://api.github.com/repos/capacity4dev/capacity4more/branches{/branch}","tags_url":"https://api.github.com/repos/capacity4dev/capacity4more/tags","blobs_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/refs{/sha}","trees_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/trees{/sha}","statuses_url":"https://api.github.com/repos/capacity4dev/capacity4more/statuses/{sha}","languages_url":"https://api.github.com/repos/capacity4dev/capacity4more/languages","stargazers_url":"https://api.github.com/repos/capacity4dev/capacity4more/stargazers","contributors_url":"https://api.github.com/repos/capacity4dev/capacity4more/contributors","subscribers_url":"https://api.github.com/repos/capacity4dev/capacity4more/subscribers","subscription_url":"https://api.github.com/repos/capacity4dev/capacity4more/subscription","commits_url":"https://api.github.com/repos/capacity4dev/capacity4more/commits{/sha}","git_commits_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/commits{/sha}","comments_url":"https://api.github.com/repos/capacity4dev/capacity4more/comments{/number}","issue_comment_url":"https://api.github.com/repos/capacity4dev/capacity4more/issues/comments{/number}","contents_url":"https://api.github.com/repos/capacity4dev/capacity4more/contents/{+path}","compare_url":"https://api.github.com/repos/capacity4dev/capacity4more/compare/{base}...{head}","merges_url":"https://api.github.com/repos/capacity4dev/capacity4more/merges","archive_url":"https://api.github.com/repos/capacity4dev/capacity4more/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/capacity4dev/capacity4more/downloads","issues_url":"https://api.github.com/repos/capacity4dev/capacity4more/issues{/number}","pulls_url":"https://api.github.com/repos/capacity4dev/capacity4more/pulls{/number}","milestones_url":"https://api.github.com/repos/capacity4dev/capacity4more/milestones{/number}","notifications_url":"https://api.github.com/repos/capacity4dev/capacity4more/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/capacity4dev/capacity4more/labels{/name}","releases_url":"https://api.github.com/repos/capacity4dev/capacity4more/releases{/id}","deployments_url":"https://api.github.com/repos/capacity4dev/capacity4more/deployments","created_at":"2014-03-31T06:03:43Z","updated_at":"2016-03-22T10:14:07Z","pushed_at":"2016-08-28T14:04:33Z","git_url":"git://github.com/capacity4dev/capacity4more.git","ssh_url":"git@github.com:capacity4dev/capacity4more.git","clone_url":"https://github.com/capacity4dev/capacity4more.git","svn_url":"https://github.com/capacity4dev/capacity4more","homepage":null,"size":98512,"stargazers_count":9,"watchers_count":9,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":113,"forks":5,"open_issues":113,"watchers":9,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/1142"},"html":{"href":"https://github.com/capacity4dev/capacity4more/pull/1142"},"issue":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/issues/1142"},"comments":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/issues/1142/comments"},"review_comments":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/1142/comments"},"review_comment":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/1142/commits"},"statuses":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/statuses/90c581b74ea8d9d6a5b8274c3848e519f3c68baa"}}}}
{"actor":{"display_login":"ordavidil"}}