%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see .
%>
<%
ldap_tests = []
ldap_tests << OpenStruct.new(
test_type: :connection,
label: t(:test_ldap_connection_label, "Testing connection..."),
help_header: t(:test_ldap_connection_help_header,
"Canvas can't connect to your LDAP server"),
help_body: t(:test_ldap_connection_help_body,
"The connection either timed out or was refused. "\
"Things to consider:"),
help: [
t(:test_ldap_connection_help_fixes_1,
"Canvas is connecting to %{ips}",
ips: presenter.ldap_ips),
t(:test_ldap_connection_help_fixes_2, "This was only a connection test. "\
"SSL certificates were not validated."),
t(:test_ldap_connection_help_fixes_3, "Check your firewall settings. "\
"Are all Canvas IP address allowed to"\
" access your server?")
],
url: account_test_ldap_connections_url(account)
)
ldap_tests << OpenStruct.new(
test_type: :bind,
label: t(:test_ldap_bind_label, "Testing LDAP bind..."),
help_header: t(:test_ldap_bind_help_header,
"Canvas can't bind (login) to your LDAP server"),
help_body: t(:test_ldap_bind_help_body,
"Your LDAP server rejected the bind attempt. Things to consider:"),
help: [
t(:test_ldap_bind_help_fixes_1,
"Verify the provided filter string (i.e. '(sAMAccountName={{login}})')."),
t(:test_ldap_bind_help_fixes_2,
"Does the username require more scoping information? "\
"(i.e. 'cn=Canvas,ou=people,dc=example,dc=com').")
],
url: account_test_ldap_binds_url(account)
)
ldap_tests << OpenStruct.new(
test_type: :search,
label: t(:test_ldap_search_label, "Testing LDAP search..."),
help_header: t(:test_ldap_search_help_header,
"Canvas can't search your LDAP instance"),
help_body: t(:test_ldap_search_help_body,
"The search either failed or returned 0 results. "\
"Things to consider:"),
help: [
t(:test_ldap_search_help_fixes_1,
"Verify the provided filter string (i.e. '(sAMAccountName={{login}})')."),
t(:test_ldap_search_help_fixes_2,
"Verify the provided search base (i.e. 'ou=people,dc=example,dc=com')."),
t(:test_ldap_search_help_fixes_3,
"Verify that the user object in LDAP has search privileges for the"\
" provided search base.")
],
url: account_test_ldap_searches_url(account)
)
%>
<%= t(:test_ldap_dialog_page_title, "Testing Your LDAP Configuration") %>
<% ldap_tests.each do |test| %>
<%= test.label %>
<%= test.help_header %>
<%= test.help_body %>
<% test.help.each do |help| %>
<%= help %>
<% end %>
<% end %>
<%= t(:test_ldap_login_label, "Test user login...") %>
<%= t(:test_ldap_login_form_header,
"Supply a valid LDAP username/password to test login:") %>
<%= t(:test_ldap_login_help_header,
"The LDAP server denied your credentials") %>