<form ng-submit="ok()" novalidate name="userForm">
    <div class="modal-header">
        <h4 class="modal-title">
            <span>{{ header | translate }}</span>
        </h4>
    </div>
    <div class="modal-body">
        <div class="form-group required" ng-class="{ 'has-error' : usernameError}">
            <label for="username">{{"admin.security.organizationalHierarchy.createUserDialog.username" |translate}}</label>
            <input class="form-control" id="username" name="username" ng-change="clearUsernameError()"
                    placeholder="{{ 'admin.security.organizationalHierarchy.createUserDialog.addLdapMember.username' | translate}}"
                    ng-model="user.userId" ng-disabled="!enableUsernameEdit" required>
            <p class="help-block" ng-show="usernameError">
                {{ usernameError }} </p>
        </div>
        <div class="form-group required">
            <label for="firstName">{{"admin.security.organizationalHierarchy.createUserDialog.firstName" | translate}}</label>
            <input class="form-control" id="firstName"
                    placeholder="{{ 'admin.security.organizationalHierarchy.createUserDialog.addLdapMember.firstName' | translate}}"
                    ng-model="user.firstName" ng-disabled="editUserDisabled" required>
        </div>
        <div class="form-group required">
            <label for="lastName">{{"admin.security.organizationalHierarchy.createUserDialog.lastName" | translate}}</label>
            <input class="form-control" id="lastName" name="lastName"
                    placeholder="{{ 'admin.security.organizationalHierarchy.createUserDialog.addLdapMember.lastName' | translate}}"
                    ng-model="user.lastName" ng-disabled="editUserDisabled" required>
        </div>
        <div class="form-group required" ng-class="{ 'has-error' : emailError}">
            <label for="email">{{"admin.security.organizationalHierarchy.createUserDialog.email" | translate}}</label>
            <input type="email" class="form-control" id="email" pattern="[a-zA-Z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,63}$"
                    placeholder="{{ 'admin.security.organizationalHierarchy.createUserDialog.addLdapMember.email' | translate}}"
                    ng-model="user.mail" ng-disabled="editUserDisabled" required>
            <p class="help-block" ng-show="emailError">
                {{ emailError }}
            </p>
        </div>
    </div>
    <div class=" modal-footer">
        <button type="button" class="btn btn-secondary" ng-click="$dismiss()">
            {{ cancelBtn | translate }}
        </button>
        <button class="btn btn-primary" ng-disabled="userForm.$invalid || error || editUserDisabled">
            {{ okBtn | translate }}
        </button>
    </div>
</form>