将autologin默认过期时间改为两个月

This commit is contained in:
guange 2015-05-10 18:06:45 +08:00
parent 5c4ad1ce7d
commit 461d9cc183
3 changed files with 1492 additions and 1469 deletions

View File

@ -32,6 +32,8 @@ class Token < ActiveRecord::Base
token = Token.get_token_from_user(user, 'autologin')
unless token
token = Token.create(:user => user, :action => 'autologin')
else
token..update_attribute(:created_on, Time.now)
end
token
end

View File

@ -0,0 +1,9 @@
class ChangeAutologinFromSettings < ActiveRecord::Migration
def up
Setting.where(name: 'autologin').update_all(value: 60)
end
def down
Setting.where(name: 'autologin').update_all(value: 7)
end
end

File diff suppressed because it is too large Load Diff