Skip to content

Commit

Permalink
Made need to confirm (by chekcing email) more obvious. Closes #149
Browse files Browse the repository at this point in the history
  • Loading branch information
cofiem committed Mar 13, 2015
1 parent 3e47784 commit ab5c65d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
7 changes: 0 additions & 7 deletions app/views/devise/registrations/edit.html.haml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
- unless current_user.blank?
- if !current_user.confirmed?
.alert.fade.in.alert-warning
%button.close{ 'data-dismiss' => 'alert'} ×
=t 'devise.failure.unconfirmed'
= link_to 'Resend confirmation email', new_user_confirmation_path

%h2
Edit #{resource_name.to_s.humanize}
= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { class: 'form-horizontal', :multipart => true, :method => :put }) do |f|
Expand Down
8 changes: 8 additions & 0 deletions app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
.span8
= render_breadcrumbs
= bootstrap_flash

- unless current_user.blank?
- if !current_user.confirmed?
.alert.fade.in.alert-warning
%button.close{ 'data-dismiss' => 'alert'} ×
= t 'devise.failure.unconfirmed'
= link_to 'Resend confirmation email', new_user_confirmation_path

.row-fluid
= yield
.span2
Expand Down
7 changes: 0 additions & 7 deletions app/views/public/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
- unless current_user.blank?
- if !current_user.confirmed?
.alert.fade.in.alert-warning
%button.close{ 'data-dismiss' => 'alert'} ×
=t 'devise.failure.unconfirmed'
= link_to 'Resend confirmation email', new_user_confirmation_path

%h1= Settings.organisation_names.site_long_name

%p
Expand Down
2 changes: 1 addition & 1 deletion config/locales/devise.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ en:
not_found_in_database: "Invalid login or password."
timeout: "Your session expired, please sign in again to continue."
unauthenticated: "You need to sign in or sign up before continuing."
unconfirmed: "You have to confirm your account before continuing."
unconfirmed: "You have to confirm your account before continuing. Please check your email (including junk mail folder)."
unauthorized: "You do not have sufficient permissions to access this page."
mailer:
confirmation_instructions:
Expand Down
5 changes: 4 additions & 1 deletion lib/modules/access/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@ def query_project_access(user, levels, query)
end
else
is_guest = Access::Check.is_guest?(user)
fail ArgumentError, "User #{user.id} who is #{is_guest ? '' : 'not'} a guest with roles #{user.role_symbols.join(', ')} has no access."
Rails.logger.warn "User '#{user.user_name}' (#{user.id}) who is#{is_guest ? '' : ' not'} a guest with roles '#{user.role_symbols.join(', ')}' has no access."

# any other role has no access (using .none to be chainable)
query.none
end

end
Expand Down

0 comments on commit ab5c65d

Please sign in to comment.