Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allowed to create a trigger for all server at the same time. Removed …
…data replication.
- Loading branch information
1 parent
6ceca3a
commit f3f09d4
Showing
10 changed files
with
76 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
class PasswordResetController < ApplicationController | ||
before_action :security_public | ||
|
||
def show | ||
end | ||
|
||
def create | ||
user = User.where(username: params[:username]).first rescue nil | ||
if !user.nil? && user.servers.where(token: params[:token]).present? | ||
if params[:new_password] == params[:confirm_password] | ||
user.update(password: params[:new_password]) | ||
start_session(user.id) and return | ||
else | ||
@alert = t(:passwords_do_not_match) | ||
end | ||
else | ||
@alert = t(:username_token_not_found) | ||
end | ||
render 'show' | ||
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
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
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,29 @@ | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-xl-4"></div> | ||
<div class="col-xl-4"> | ||
<h4><%= @server.hostname %> / <%= t(:new_trigger) %></h4> | ||
<%= form_for @trigger, url: server_trigger_path(@server, @trigger) do |f| %> | ||
<div class="form-group"> | ||
<label><%= t(:event) %></label> | ||
<%= f.select(:event, options_for_select(Trigger::EVENTS, selected: @trigger.event), {}, class: "form-control") %> | ||
</div> | ||
<div class="form-group"> | ||
<label><%= t(:criteria) %></label> | ||
<%= f.number_field(:criteria, class: "form-control") %> | ||
</div> | ||
<div class="form-group"> | ||
<label><%= t(:action) %></label> | ||
<%= f.select(:action, options_for_select(Trigger::ACTIONS, selected: @trigger.action), {}, class: "form-control") %> | ||
</div> | ||
<div class="form-group"> | ||
<label><%= t(:url) %></label> | ||
<%= f.text_field(:url, class: "form-control") %> | ||
</div> | ||
<div> | ||
<%= f.submit(t(:submit), class: "btn btn-sm btn-primary") %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> |
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
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,3 @@ | ||
db.sessions.updateMany({}, {$unset: {username: 1}}) | ||
db.servers.updateMany({}, {$unset: {username: 1}}) | ||
db.reports.updateMany({}, {$unset: {username: 1, token: 1}}) |