diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-04-21 15:55:54 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-05-16 14:56:32 -0300 |
commit | 71ca2de7aabf3191c4f486ca15a78a5b7f6abd94 (patch) | |
tree | f6520c7169d91aecaa3f9c3960cff11c29f5088f /app/models | |
parent | 78a67fc48dab434b43a080e5b15491963656661a (diff) | |
download | gitlab-ce-71ca2de7aabf3191c4f486ca15a78a5b7f6abd94.tar.gz |
Toggle email signup confirmation in admin settings
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/user.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 489bff3fa4a..470734f5c2f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -112,6 +112,7 @@ class User < ActiveRecord::Base before_save :ensure_external_user_rights after_save :ensure_namespace_correct after_initialize :set_projects_limit + before_create :check_confirmation_email after_create :post_create_hook after_destroy :post_destroy_hook @@ -307,6 +308,10 @@ class User < ActiveRecord::Base @reset_token end + def check_confirmation_email + skip_confirmation! if current_application_settings.skip_user_confirmation_email + end + def recently_sent_password_reset? reset_password_sent_at.present? && reset_password_sent_at >= 1.minute.ago end |