Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
94be7320
Commit
94be7320
authored
Jun 13, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add password_expires_at to users table
parent
5b407802
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+2
-2
db/migrate/20130613165816_add_password_expires_at_to_users.rb
...igrate/20130613165816_add_password_expires_at_to_users.rb
+5
-0
db/schema.rb
db/schema.rb
+2
-1
No files found.
app/controllers/application_controller.rb
View file @
94be7320
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
...
...
db/migrate/20130613165816_add_password_expires_at_to_users.rb
0 → 100644
View file @
94be7320
class
AddPasswordExpiresAtToUsers
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:password_expires_at
,
:datetime
end
end
db/schema.rb
View file @
94be7320
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
:version
=>
20130
52214185
6
)
do
ActiveRecord
::
Schema
.
define
(
:version
=>
20130
61316581
6
)
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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment