summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-13 19:53:04 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-13 19:53:04 +0300
commit5b40780290e7d7c9e129e58c4f3f435073598ae6 (patch)
tree4208b073ab460e8f1bfab4fe98cf62d63a937be6 /app/controllers/application_controller.rb
parent81a9e81fae349e3e2b1cc336bf6cef767d65dbfc (diff)
downloadgitlab-ce-5b40780290e7d7c9e129e58c4f3f435073598ae6.tar.gz
Password expire: implement password resource inside profile. add before_fiter check
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 09af5b94164..63ad8d0e56d 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -1,6 +1,7 @@
class ApplicationController < ActionController::Base
before_filter :authenticate_user!
before_filter :reject_blocked!
+ before_filter :check_password_expiration!
before_filter :set_current_user_for_thread
before_filter :add_abilities
before_filter :dev_tools if Rails.env == 'development'
@@ -156,4 +157,10 @@ class ApplicationController < ActionController::Base
gon.gravatar_url = request.ssl? || Gitlab.config.gitlab.https ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url
gon.relative_url_root = Gitlab.config.gitlab.relative_url_root
end
+
+ def check_password_expiration
+ if current_user.password_expires_at < Time.now
+ redirect_to new_profile_password_path and return
+ end
+ end
end