<div class="bs-sidebar col-md-3 clearfix" data-ng-include data-src="'partials/realm-menu.html'"></div>
<div id="content-area" class="col-md-9" role="main">

    <ul class="nav nav-tabs nav-tabs-pf"  data-ng-show="!create">
        <li><a href="#/realms/{{realm.realm}}/users/{{user.username}}">Attributes</a></li>
        <li class="active"><a href="#/realms/{{realm.realm}}/users/{{user.username}}/user-credentials">Credentials</a></li>
        <li><a href="#/realms/{{realm.realm}}/users/{{user.username}}/role-mappings">Role Mappings</a></li>
        <li><a href="#/realms/{{realm.realm}}/users/{{user.username}}/sessions">Sessions</a></li>
        <li data-ng-show="realm.social"><a href="#/realms/{{realm.realm}}/users/{{user.username}}/social-links">Social Links</a></li>
    </ul>
    <div id="content">
        <ol class="breadcrumb">
            <li><a href="#/realms/{{realm.realm}}/users">Users</a></li>
            <li><a href="#/realms/{{realm.realm}}/users/{{user.username}}">{{user.username}}</a></li>
            <li class="active">Credentials</li>
        </ol>
        <h2>User <span>{{user.username}}'s</span> Credentials <span tooltip-placement="right" tooltip="This page allows you to reset the user's password with a temporary one that they have to change the first time they log in or it allows you to change the password permanently." class="fa fa-info-circle"></span></h2>

        <form class="form-horizontal" name="userForm" novalidate>
            <fieldset class="border-top">
                <legend><span class="text">Reset Password</span></legend>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="password">New password <span class="required" data-ng-show="create">*</span></label>
                    <div class="col-sm-4">
                        <input class="form-control" type="password" id="password" name="password" data-ng-model="password" required>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="confirmPassword">Password confirmation <span class="required" data-ng-show="create">*</span></label>
                    <div class="col-sm-4">
                        <input class="form-control" type="password" id="confirmPassword" name="confirmPassword" data-ng-model="confirmPassword" required>
                    </div>
                </div>

                <div class="form-group clearfix block">
                    <label class="col-sm-2 control-label" for="temporaryPassword">Temporary</label>
                    <div class="col-sm-6">
                        <input ng-model="temporaryPassword" name="temporaryPassword" id="temporaryPassword" onoffswitch />
                    </div>
                    <span tooltip-placement="right" tooltip="If enabled user is required to change password on next login" class="fa fa-info-circle"></span>
                </div>

                <div class="pull-right form-actions" data-ng-show="password && confirmPassword">
                    <button class="btn btn-danger" type="submit" data-ng-click="resetPassword(true)">Reset Password</button>
                </div>
            </fieldset>

            <fieldset class="border-top" data-ng-show="user.email || user.totp">
                <div class="form-group" data-ng-show="user.email">
                    <label class="col-sm-2 control-label" for="password">Reset password email</label>
                    <div class="col-sm-5">
                        <button class="btn btn-danger" type="submit" data-ng-click="resetPasswordEmail()" tooltip="Send an email to user with a link to reset their password" tooltip-placement="right">Send Email</button>
                    </div>
                </div>

                <div class="form-group" data-ng-show="user.totp">
                    <label class="col-sm-2 control-label">Remove totp</label>
                    <div class="col-sm-5" data-ng-show="user.totp">
                        <button class="btn btn-danger"  type="submit" data-ng-click="removeTotp()" tooltip="Remove one time password generator for user." tooltip-placement="right">Remove TOTP</button>
                    </div>
                </div>
            </fieldset>
        </form>

    </div>
</div>