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
e4a7dae3
Commit
e4a7dae3
authored
Mar 18, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ldap_password' into 'master'
Prevent LDAP users from using reset password function
parents
8fa53ce4
a740e2d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
app/controllers/passwords_controller.rb
app/controllers/passwords_controller.rb
+18
-0
config/routes.rb
config/routes.rb
+1
-1
No files found.
app/controllers/passwords_controller.rb
0 → 100644
View file @
e4a7dae3
class
PasswordsController
<
Devise
::
PasswordsController
def
create
email
=
resource_params
[
:email
]
resource_found
=
resource_class
.
find_by_email
(
email
)
if
resource_found
&&
resource_found
.
ldap_user?
flash
[
:alert
]
=
"Cannot reset password for LDAP user."
respond_with
({},
:location
=>
after_sending_reset_password_instructions_path_for
(
resource_name
))
and
return
end
self
.
resource
=
resource_class
.
send_reset_password_instructions
(
resource_params
)
if
successfully_sent?
(
resource
)
respond_with
({},
:location
=>
after_sending_reset_password_instructions_path_for
(
resource_name
))
else
respond_with
(
resource
)
end
end
end
config/routes.rb
View file @
e4a7dae3
...
...
@@ -167,7 +167,7 @@ Gitlab::Application.routes.draw do
resources
:projects
,
constraints:
{
id:
/[^\/]+/
},
only:
[
:new
,
:create
]
devise_for
:users
,
controllers:
{
omniauth_callbacks: :omniauth_callbacks
,
registrations: :registrations
}
devise_for
:users
,
controllers:
{
omniauth_callbacks: :omniauth_callbacks
,
registrations: :registrations
,
passwords: :passwords
}
#
# Project Area
...
...
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