summaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-02-23 22:21:49 +0100
committerMarin Jankovski <maxlazio@gmail.com>2015-02-23 20:04:18 -0800
commitc9829146f88ff87460add83a3719db3e2593f278 (patch)
tree4407c91c3eb7115b34e362695b38ebce5d281088 /app/models/user.rb
parenta4118ca445871c04625edee6463cffd838772b13 (diff)
downloadgitlab-ce-c9829146f88ff87460add83a3719db3e2593f278.tar.gz
LDAP users don't need to set a password to Git over HTTP.
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 21ccc76978e..08ad619a90c 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -45,6 +45,7 @@
# last_credential_check_at :datetime
# github_access_token :string(255)
# notification_email :string(255)
+# password_automatically_set :boolean default(FALSE)
#
require 'carrierwave/orm/activerecord'
@@ -350,6 +351,10 @@ class User < ActiveRecord::Base
keys.count == 0
end
+ def require_password?
+ password_automatically_set? && !ldap_user?
+ end
+
def can_change_username?
gitlab_config.username_changing_enabled
end