Commit ca1162e8 authored by Neil Drumm's avatar Neil Drumm 👋
Browse files

Issue #3281980: Remove user/{uid}/git-attribution API

parent 7e26656c
Loading
Loading
Loading
Loading
+0 −25
Original line number Diff line number Diff line
@@ -52,14 +52,6 @@ function drupalorg_git_gateway_menu() {
    'type' => MENU_LOCAL_TASK,
  ];

  $items['user/%user/git-attribution'] = array(
    'title' => 'git information for account',
    'page callback' => 'drupalorg_git_gateway_user_git_json_output',
    'page arguments' => array(1),
    'access callback' => 'drupalorg_git_gateway_user_git_access',
    'type' => MENU_CALLBACK,
  );

  return $items;
}

@@ -125,14 +117,6 @@ function drupalorg_git_gateway_user_update(&$edit, $account, $category) {
  }
}

/**
 * Return whether currently logged in user is allowed to see git author attribution.
 */
function drupalorg_git_gateway_user_git_access() {
  global $user;
  return (user_is_logged_in() && !empty($user->git_consent) && empty($user->git_disabled));
}

/**
 * Formats a git commit --author parameter value for the passed user account.
 */
@@ -145,15 +129,6 @@ function drupalorg_git_gateway_user_git_format_author($account) {
  ));
}

/**
 * Menu callback; Returns git information for $account as JSON.
 */
function drupalorg_git_gateway_user_git_json_output($account) {
  $data = array('author' => drupalorg_git_gateway_user_git_format_author($account));
  drupal_json_output($data);
  // No return value, index.php renders no page but calls drupal_page_footer().
}

/**
 * Implements hook_form_alter().
 *