X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/64b24877bdb4b35938e8b691463b78073a4fd31d..83d08d7ccbc622ec97948929c83fb91f96743ca2:/services/api/script/setup-new-user.rb diff --git a/services/api/script/setup-new-user.rb b/services/api/script/setup-new-user.rb index ebff19263e..9f0219ec84 100755 --- a/services/api/script/setup-new-user.rb +++ b/services/api/script/setup-new-user.rb @@ -1,4 +1,7 @@ #!/usr/bin/env ruby +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 abort 'Error: Ruby >= 1.9.3 required.' if RUBY_VERSION < '1.9.3' @@ -21,6 +24,9 @@ If creating a new user record, require authentication from an OpenID \ with this OpenID prefix *and* a matching email address in order to \ claim the account. eos + opt :send_notification_email, <<-eos, default: 'true' +Send notification email after successfully setting up the user. + eos end log.level = (ENV['DEBUG'] || opts.debug) ? Logger::DEBUG : Logger::WARN @@ -55,10 +61,12 @@ end # Invoke user setup method if (found_user) user = arv.user.setup uuid: found_user[:uuid], repo_name: user_repo_name, - vm_uuid: vm_uuid, openid_prefix: opts.openid_prefix + vm_uuid: vm_uuid, openid_prefix: opts.openid_prefix, + send_notification_email: opts.send_notification_email else user = arv.user.setup user: {email: user_arg}, repo_name: user_repo_name, - vm_uuid: vm_uuid, openid_prefix: opts.openid_prefix + vm_uuid: vm_uuid, openid_prefix: opts.openid_prefix, + send_notification_email: opts.send_notification_email end log.info {"user uuid: " + user[:uuid]}