Fix #4571: Show banner when email verification is required.

* Show a banner if the user is restricted because they signed up from a
  proxy or VPN.

* Add an option to resend the confirmation email if your account has an
  unverified email address.
This commit is contained in:
evazion
2020-08-02 16:32:49 -05:00
parent a8577b2b94
commit baf0cf87af
11 changed files with 173 additions and 22 deletions

View File

@@ -0,0 +1,10 @@
<% if CurrentUser.user.is_restricted? && (params[:controller] == "users" || cookies[:hide_verify_account_notice].blank?) %>
<div class="notice notice-info notice-large" id="verify-account-notice">
<h2>Your account is restricted.</h2>
<div>
You must verify your account because you signed up from a proxy or a VPN.
<%= link_to "Verify your account now", verify_user_email_path(CurrentUser.user) %>.
</div>
<div><%= link_to "Close this", "#", id: "hide-verify-account-notice" %></div>
</div>
<% end %>

View File

@@ -27,14 +27,14 @@
<p>
<% if @user.email_address.present? %>
<%= @user.email_address.address %>
<% if !@user.email_address.is_verified %>
<em>(unverified)</em>
<% end %>
<% else %>
<em>blank</em>
<% end %>
- <%= link_to "Change your email", edit_user_email_path(@user) %>
(<%= link_to "Change email", edit_user_email_path(@user) %>
<% if !@user.email_address.is_verified %>
| <%= link_to "Verify email", verify_user_email_path(@user) %>
<% end %>)
<% else %>
<%= link_to "Add email", edit_user_email_path(@user) %>
<% end %>
</p>
</div>