Commit 94be7320 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Add password_expires_at to users table

parent 5b407802
class ApplicationController < ActionController::Base
before_filter :authenticate_user!
before_filter :reject_blocked!
before_filter :check_password_expiration!
before_filter :check_password_expiration
before_filter :set_current_user_for_thread
before_filter :add_abilities
before_filter :dev_tools if Rails.env == 'development'
......@@ -159,7 +159,7 @@ class ApplicationController < ActionController::Base
end
def check_password_expiration
if current_user.password_expires_at < Time.now
if current_user.password_expires_at && current_user.password_expires_at < Time.now
redirect_to new_profile_password_path and return
end
end
......
class AddPasswordExpiresAtToUsers < ActiveRecord::Migration
def change
add_column :users, :password_expires_at, :datetime
end
end
......@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20130522141856) do
ActiveRecord::Schema.define(:version => 20130613165816) do
create_table "deploy_keys_projects", :force => true do |t|
t.integer "deploy_key_id", :null => false
......@@ -292,6 +292,7 @@ ActiveRecord::Schema.define(:version => 20130522141856) do
t.string "state"
t.integer "color_scheme_id", :default => 1, :null => false
t.integer "notification_level", :default => 1, :null => false
t.datetime "password_expires_at"
end
add_index "users", ["admin"], :name => "index_users_on_admin"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment