<!-- Faraday Penetration Test IDE -->
<!-- Copyright (C) 2013  Infobyte LLC (http://www.infobytesec.com/) -->
<!-- See the file 'doc/LICENSE' for the license information -->
<form name="form" novalidate >
    <div class="modal-header">
        <div class="modal-button">
            <button class="btn btn-success" ng-click="ok()" ng-disabled="form.$invalid">Change</button>
            <button class="btn btn-danger" ng-click="cancel()">Cancel</button>
        </div>
        <h3 class="modal-title">Change password {{user.name}}</h3>
    </div>
    <div class="modal-body">
        <div class="form-horizontal">
            <div ng-if="error_message">
                <div class="alert alert-danger alert-dismissible" role="alert">
                    <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h5>{{error_message}}</h5>
                </div> <!-- .alert -->
            </div> <!-- ng-if -->
            <h5>Please type current password</h5>
             <div class="form-group">
                <div class="col-md-6">
                    <label class="sr-only" for="user-pass">Current Password</label>
                    <input type="password" class="form-control" id="user-currentpass" name="current" placeholder="Password" ng-model="data.current" ng-change="resetError()" />
                </div>

             </div>
            <div class="alert alert-danger target_not_selected" role="alert" ng-show="form.current.$invalid && form.current.$dirty">
                    <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
                    <span class="sr-only">Error:</span>
                    <button type="button" class="close" data-dismiss="alert"><span area-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        Invalid Password
                </div>
            <h5>New password (must be at least 8 characters long) </h5>
            <div class="form-group">
                <div class="col-md-6">
                    <label class="sr-only" for="user-pass">Password</label>
                    <input type="password" class="form-control" id="user-pass" name="password" placeholder="Password" ng-model="data.newPassword" ng-pattern="/^.*(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?=.*[\d\W]).*$/" />
                </div>
                <div class="col-md-6" ng-class="{'has-error': form.passRepeat.$invalid }">
                    <label class="sr-only" for="user-pass-repeat">Repeat password</label>
                    <input type="password" class="form-control" id="user-pass-repeat" name="passRepeat" placeholder="Repeat password" ng-model="data.newPasswordRepeat" ng-pattern="/^.*(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?=.*[\d\W]).*$/" ng-required="data.newPassword" compare-to="data.newPassword" />
                </div>
            </div>
            <div ng-if="form.password.$invalid">
                <div class="alert alert-danger target_not_selected" role="alert" ng-hide="">
                    <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
                    <span class="sr-only">Error:</span>
                    <button type="button" class="close" data-dismiss="alert"><span area-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    Password must be at least 8 characters long. It must contain at least one uppercase letter and one of the following: numbers (0-9) or special characters ( ~!@#$%^&*_-+=`|\(){}[]:;"'<>,.?/ )
                </div>
            </div>
            <div ng-if="!form.newPassword.$invalid && form.newPasswordRepeat.$invalid">
                <div class="alert alert-danger target_not_selected" role="alert" ng-hide="">
                    <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
                    <span class="sr-only">Error:</span>
                    <button type="button" class="close" data-dismiss="alert"><span area-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    Passwords don't match
                </div>
            </div>
        </div>
    </div><!-- .modal-body -->
    <div class="modal-footer">
        <div class="modal-button">
            <button class="btn btn-success" ng-disabled="form.$invalid" ng-click="ok()">Change</button>
            <button class="btn btn-danger" ng-click="cancel()">Cancel</button>
        </div>
    </div>
</form>