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
Léo-Paul Géneau
gitlab-ce
Commits
de582ab3
Commit
de582ab3
authored
Jul 16, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix user params when edit from admin area
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
aa25c0ff
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
app/controllers/admin/users_controller.rb
app/controllers/admin/users_controller.rb
+4
-2
No files found.
app/controllers/admin/users_controller.rb
View file @
de582ab3
...
@@ -59,15 +59,17 @@ class Admin::UsersController < Admin::ApplicationController
...
@@ -59,15 +59,17 @@ class Admin::UsersController < Admin::ApplicationController
end
end
def
update
def
update
user_params_with_pass
=
user_params
.
dup
if
params
[
:user
][
:password
].
present?
if
params
[
:user
][
:password
].
present?
user_params
.
merge
(
user_params
_with_pass
.
merge!
(
password:
params
[
:user
][
:password
],
password:
params
[
:user
][
:password
],
password_confirmation:
params
[
:user
][
:password_confirmation
],
password_confirmation:
params
[
:user
][
:password_confirmation
],
)
)
end
end
respond_to
do
|
format
|
respond_to
do
|
format
|
if
user
.
update_attributes
(
user_params
)
if
user
.
update_attributes
(
user_params
_with_pass
)
user
.
confirm!
user
.
confirm!
format
.
html
{
redirect_to
[
:admin
,
user
],
notice:
'User was successfully updated.'
}
format
.
html
{
redirect_to
[
:admin
,
user
],
notice:
'User was successfully updated.'
}
format
.
json
{
head
:ok
}
format
.
json
{
head
:ok
}
...
...
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