forked from southbridgeio/redmine_2fa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<script type="text/javascript"> | ||
$(document).ready(function($) { | ||
if($(".controller-users.action-edit").length > 0) { | ||
$($("#content .contextual")[0]).append('<%= j render 'second_authentications/reset', user: @user %>'); | ||
} | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<% if user.two_factor_authenticable? or user.ignore_2fa? %> | ||
<%= link_to l(:link_2fa_reset), second_authentication_reset_path, method: :delete, class: 'icon icon-not-ok' %> | ||
<%= link_to l(:link_2fa_reset), second_authentication_reset_path(user), method: :delete, class: 'icon icon-not-ok' %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
module Redmine2FA | ||
module Hooks | ||
class ViewMyAccountContextualHook < Redmine::Hook::ViewListener | ||
render_on :view_my_account_contextual, partial: 'second_authentications/reset' | ||
render_on :view_my_account_contextual, partial: 'second_authentications/reset', user: @user | ||
render_on :view_users_form, partial: 'second_authentications/link_to_reset' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
require File.expand_path('../../../test_helper', __FILE__) | ||
class SecondAuthenticationsTest < Redmine::RoutingTest | ||
def test_second_authentications | ||
should_route 'DELETE redmine_2fa/reset' => 'second_authentications#destroy' | ||
assert_routing({ method: 'delete', path: '/redmine_2fa/reset/id' }, | ||
controller: 'second_authentications', action: 'destroy', id: 'id') | ||
end | ||
end |