<% # 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 . %> <% if can_do(@user, @current_user, :manage, :manage_user_details) %> <% css_bundle :user_logins %> <% js_bundle :user_logins %> <% js_env :PASSWORD_POLICY => (@domain_root_account.try(:password_policy) || {}) %>
class="responsive" <% end %> >

<%= t('titles.logins', 'Login Information') %>

<% pseudonyms = @user.all_active_pseudonyms + [nil] %> <% pseudonyms.each do |pseudonym| %> ' style="<%= hidden unless pseudonym %>"> <% if !pseudonym || can_do(pseudonym, @current_user, :update) %> <% else %> <% end %> <% end %> <% can_add_pseudonym = can_do(@user.pseudonyms.build(account: @domain_root_account), @current_user, :create) %> <% can_reset_mfa = @user.otp_secret_key && can_do(@user, @current_user, :reset_mfa) %> <% if can_add_pseudonym || can_reset_mfa %> <% end %>
<% if can_add_pseudonym %> <%= t('add_login', 'Add Login') %> <% end %> <% if can_add_pseudonym && can_reset_mfa %> | <% end %> <% if can_reset_mfa %> <%= t('reset_mfa', "Reset Multi-Factor Authentication") %> <% end %>
<%= form_for :pseudonym, :url => user_pseudonyms_url(@user.id), :html => {:id => 'edit_pseudonym_form', :class => 'form-dialog form-horizontal', :style => 'display: none;'} do |f| %> <% if can_do(Account.site_admin, @current_user, :manage_user_logins) %> <% js_env :PASSWORD_POLICIES => Hash[Account.root_accounts.active.non_shadow.map{ |a| [a.id, a.password_policy]}] %> <% else %> <% end %>
<%= f.blabel :unique_id, :en => "Login" %> <%= f.text_field :unique_id %>
<%= f.blabel :password, :en => "Password" %> <%= f.password_field :password %>
<%= f.blabel :password_confirmation, :en => "Confirm Password" %> <%= f.password_field :password_confirmation %>
<%= t do %> Note: This login's account uses delegated authentication, but allows fallback Canvas password authentication. The password fields in this form update the fallback Canvas password, not the delegated authentication. <% end %>
<% end %> <% end %>