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
fbf69899
Commit
fbf69899
authored
Jun 13, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Force admin to change password after first sign-in
parent
94be7320
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+1
-1
app/models/user.rb
app/models/user.rb
+5
-2
db/fixtures/production/001_admin.rb
db/fixtures/production/001_admin.rb
+2
-1
No files found.
app/controllers/application_controller.rb
View file @
fbf69899
...
...
@@ -159,7 +159,7 @@ class ApplicationController < ActionController::Base
end
def
check_password_expiration
if
current_user
.
password_expires_at
&&
current_user
.
password_expires_at
<
Time
.
now
if
current_user
&&
current_user
.
password_expires_at
&&
current_user
.
password_expires_at
<
Time
.
now
redirect_to
new_profile_password_path
and
return
end
end
...
...
app/models/user.rb
View file @
fbf69899
...
...
@@ -42,8 +42,11 @@ class User < ActiveRecord::Base
attr_accessible
:email
,
:password
,
:password_confirmation
,
:remember_me
,
:bio
,
:name
,
:username
,
:skype
,
:linkedin
,
:twitter
,
:color_scheme_id
,
:theme_id
,
:force_random_password
,
:extern_uid
,
:provider
,
as:
[
:default
,
:admin
]
attr_accessible
:projects_limit
,
:can_create_team
,
:can_create_group
,
as: :admin
:extern_uid
,
:provider
,
:password_expires_at
,
as:
[
:default
,
:admin
]
attr_accessible
:projects_limit
,
:can_create_team
,
:can_create_group
,
as: :admin
attr_accessor
:force_random_password
...
...
db/fixtures/production/001_admin.rb
View file @
fbf69899
...
...
@@ -3,7 +3,8 @@ admin = User.create(
name:
"Administrator"
,
username:
'root'
,
password:
"5iveL!fe"
,
password_confirmation:
"5iveL!fe"
password_confirmation:
"5iveL!fe"
,
password_expires_at:
Time
.
now
)
admin
.
projects_limit
=
10000
...
...
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