Skip to content

Commit cc8bf27

Browse files
committed
Merge branch 'master' of github.com:pglombardo/PasswordPusher
2 parents be33b0e + 69398f4 commit cc8bf27

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

app/controllers/madmin/users_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ def create
88
@record.password = password
99
@record.password_confirmation = password
1010

11-
# Handle auto-confirmation if checkbox is checked
12-
if params[:user][:auto_confirm] == "1"
11+
# Handle auto-confirmation if checkbox is checked (only when confirmable is enabled)
12+
if params[:user][:auto_confirm] == "1" && Settings.enable_user_account_emails
1313
@record.skip_confirmation_notification!
1414
@record.skip_confirmation!
1515
@record.confirm

app/views/madmin/users/_form.html.erb

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,19 @@
4343
</div>
4444
</div>
4545
</div>
46-
<div class="col-md-12">
47-
<div class="mb-3">
48-
<div class="form-check">
49-
<%= form.check_box :auto_confirm, { class: "form-check-input" }, "1", "0" %>
50-
<%= form.label :auto_confirm, _("Auto-confirm account"), class: "form-check-label fw-semibold" %>
51-
</div>
52-
<div class="form-text text-muted small mt-1">
53-
<%= _("If checked, the user account will be automatically confirmed and ready to use. Otherwise, the user will need to confirm their email address.") %>
46+
<% if Settings.enable_user_account_emails %>
47+
<div class="col-md-12">
48+
<div class="mb-3">
49+
<div class="form-check">
50+
<%= form.check_box :auto_confirm, { class: "form-check-input" }, "1", "0" %>
51+
<%= form.label :auto_confirm, _("Auto-confirm account"), class: "form-check-label fw-semibold" %>
52+
</div>
53+
<div class="form-text text-muted small mt-1">
54+
<%= _("If checked, the user account will be automatically confirmed and ready to use. Otherwise, the user will need to confirm their email address.") %>
55+
</div>
5456
</div>
5557
</div>
56-
</div>
58+
<% end %>
5759
</div>
5860
</div>
5961
</div>

0 commit comments

Comments
 (0)