unauthorized.mustache 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <%
  2. # Copyright (C) 2011 - present Instructure, Inc.
  3. #
  4. # This file is part of Canvas.
  5. #
  6. # Canvas is free software: you can redistribute it and/or modify it under
  7. # the terms of the GNU Affero General Public License as published by the Free
  8. # Software Foundation, version 3 of the License.
  9. #
  10. # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
  11. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  13. # details.
  14. #
  15. # You should have received a copy of the GNU Affero General Public License along
  16. # with this program. If not, see <http://www.gnu.org/licenses/>.
  17. %>
  18. <% content_for :page_title do %>
  19. <% if !@files_domain && !@unauthorized_user %>
  20. {{#t}}Please Log In{{/t}}
  21. <% else %>
  22. {{#t}}Unauthorized{{/t}}
  23. <% end %>
  24. <% end %>
  25. <% @show_left_side = false %>
  26. <% @show_embedded_chat = false %>
  27. <div id="unauthorized_holder">
  28. <% css_bundle("unauthorized_message") %>
  29. <div id="unauthorized_message">
  30. <h2 class="ui-state-error">
  31. <% if @needs_cookies -%>
  32. {{#t}}Cookies Required{{/t}}
  33. <% elsif !@files_domain && @unauthorized_user %>
  34. {{#t}}Please Log In{{/t}}
  35. <% elsif @unauthorized_reason == :unpublished %>
  36. {{#t}}Not Yet Available{{/t}}
  37. <% else -%>
  38. {{#t}}Unauthorized{{/t}}
  39. <% end -%>
  40. </h2>
  41. <% if @unauthorized_user && @current_user != @unauthorized_user %>
  42. <p><%= mt 'unauthorized_user_is_other', "%{current_user}, you are not authorized to view this page. The link you followed to get here was for **%{unauthorized_user} (%{unauthorized_user_email})**. If that's you, you may want to log out and log back in with that email address to gain access to this page.", :current_user => @current_user.name, :unauthorized_user => @unauthorized_user.name, :unauthorized_user_email => @unauthorized_user.email %>
  43. </p>
  44. <% elsif @unauthorized_user %>
  45. <p>
  46. <%= t "%{user_name}, you'll need to *log in* before you can view that page.", user_name: @unauthorized_user.name, wrapper: link_to(login_url, '\1') %>
  47. </p>
  48. <% elsif @unauthorized_message %>
  49. <p><%= @unauthorized_message %></p>
  50. <% elsif @needs_cookies %>
  51. <p>{{#t}}Cookies are not enabled on your browser. Please adjust this in your security preferences before continuing.{{/t}}</p>
  52. <% elsif @files_domain %>
  53. <p>{{#t}}Access to this page is limited to authorized users. You do not currently have permission to view this page.{{/t}}</p>
  54. <% elsif @context %>
  55. <p>
  56. <% if @context.try_rescue(:is_public) %>
  57. <%= mt 'public_course', 'This page is part of the content for the course, **%{course}**.', :course => @context.name %>
  58. <% end %>
  59. {{#t}}It appears that you don't have permission to access this page. Please make sure you're authorized to view this content.{{/t}}
  60. <% if Setting.get("show_feedback_link", "false") == "true" %>
  61. {{#t}}If you think you should be able to view this page, please use the "Help" link to notify support of the problem.{{/t}}
  62. <% end %>
  63. </p>
  64. <% end %>
  65. </div>
  66. </div>