summaryrefslogtreecommitdiff
path: root/app/helpers/projects_helper.rb
diff options
context:
space:
mode:
authorRobin Bobbitt <ryehle@us.ibm.com>2017-06-12 12:13:22 -0400
committerRobin Bobbitt <ryehle@us.ibm.com>2017-06-26 14:41:27 -0400
commit7eb26c7ff7a78df9cb8fe5b30d48c80ce4eb8a99 (patch)
treee2add1651b79dd3a24a524f165a0b14fee8e8804 /app/helpers/projects_helper.rb
parent4988c3a8740324fbc7e66e67a8373d783f9c1ae4 (diff)
downloadgitlab-ce-7eb26c7ff7a78df9cb8fe5b30d48c80ce4eb8a99.tar.gz
Provide hint to create a personal access token for Git over HTTP
If internal auth is disabled and user is not an LDAP user, present the user with an alert to create a personal access token if he does not have one already.
Diffstat (limited to 'app/helpers/projects_helper.rb')
-rw-r--r--app/helpers/projects_helper.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index d10e0bd45b0..c04b1419a19 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -198,6 +198,23 @@ module ProjectsHelper
.load_in_batch_for_projects(projects)
end
+ def show_no_ssh_key_message?
+ cookies[:hide_no_ssh_message].blank? && !current_user.hide_no_ssh_key && current_user.require_ssh_key?
+ end
+
+ def show_no_password_message?
+ cookies[:hide_no_password_message].blank? && !current_user.hide_no_password &&
+ ( current_user.require_password? || current_user.require_personal_access_token? )
+ end
+
+ def link_to_set_password
+ if current_user.require_password?
+ link_to s_('SetPasswordToCloneLink|set a password'), edit_profile_password_path
+ else
+ link_to s_('CreateTokenToCloneLink|create a personal access token'), profile_personal_access_tokens_path
+ end
+ end
+
private
def repo_children_classes(field)