Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export(get_dp_flags)
export(get_elevation)
export(get_park_polygon)
export(get_taxon_rank)
export(get_user_orcid)
export(get_utm_zone)
export(long2UTM)
export(order_cols)
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# QCkit v1.1.0
## 2025-07-25
* add function `get_user_orcid`, which will look up a users orcid using active directory.

## 2025-05-16
* create_datastore_script now invisibly returns the DataStore reference URL

Expand Down
31 changes: 31 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,34 @@ get_user_email <- function() {

return(email_address)
}

#' Returns the user's ORCID ID from active directory
#'
#' @description
#' This is a function to grab a users ORCID from Active Directory. Requires VPN to access AD. If the user does not have an ORCID, returns "NA".
#'
#'
#' @returns Sting. The user's ORCID ID
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo :)

#' @export
#'
#' @examples
#' \dontrun{
#' orcid <- get_user_orcid()
#' }
get_user_orcid <- function() {
powershell_command <- '([adsisearcher]\\"(samaccountname=$env:USERNAME)\\").FindAll().Properties'

AD_output <- system2("powershell",
args = c("-Command",
powershell_command),
stdout = TRUE)
#get extensionAttribute2 (holds orcid)
orcid <- AD_output[which(AD_output %>%
stringr::str_detect("extensionattribute2"))]
# extract orcid
orcid <- stringr::str_extract(orcid, "\\{.*?\\}")
# remove curly braces:
orcid <- stringr::str_remove_all(orcid, "[{}]")

return(orcid)
}
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/DRR_Purpose_and_Scope.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/Starting-a-DRR.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/Using-the-DRR-Template.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ articles:
articles/DRR_Purpose_and_Scope: DRR_Purpose_and_Scope.html
articles/Starting-a-DRR: Starting-a-DRR.html
articles/Using-the-DRR-Template: Using-the-DRR-Template.html
last_built: 2025-05-19T15:23Z
last_built: 2025-07-25T21:03Z
urls:
reference: https://nationalparkservice.github.io/QCkit/reference
article: https://nationalparkservice.github.io/QCkit/articles
2 changes: 1 addition & 1 deletion docs/reference/DC_col_check.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/QCkit-package.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/check_dc_cols.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/check_te.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/convert_datetime_format.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/convert_long_to_utm.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/convert_utm_to_ll.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/reference/create_datastore_script.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/reference/document_missing_values.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/fix_utc_offset.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/fuzz_location.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/generate_ll_from_utm.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading