beccabroek | 5e258e4 | 2018-11-07 12:22:31 -0600 | [diff] [blame^] | 1 | <loader loading="loading"></loader> |
| 2 | <div class="ldap" id="configuration-ldap"> |
| 3 | <div class="row column"> |
| 4 | <h1>LDAP role group settings</h1> |
| 5 | </div> |
| 6 | <div class="row column"> |
| 7 | <p>Configure LDAP settings and manage role groups.</p> |
| 8 | </div> |
| 9 | <div class="row column"> |
| 10 | <h2 class="subhead"> |
| 11 | Settings |
| 12 | </h2> |
| 13 | </div> |
| 14 | <div class="row column"> |
| 15 | <label class="control-check ldap__control-check"> |
| 16 | <input type="checkbox" id="enable-ldap-checkbox" |
| 17 | ng-change="updateServiceEnabled(); ldap__configuration.$setUntouched()" |
| 18 | ng-model="ldapProperties.ServiceEnabled" /> |
| 19 | <span class="control__indicator"></span> |
| 20 | <span class="control__label"> |
| 21 | <strong>Enable LDAP authentication</strong> <br> |
| 22 | LDAP authentication must be enabled to modify role groups. |
| 23 | </span> |
| 24 | </label> |
| 25 | </div> |
| 26 | <div class="row column"> |
| 27 | <form id="ldap__configuration" name="ldap__configuration" ng-class="{'submitted': submitted}" |
| 28 | class="ldap__configuration" novalidate> |
| 29 | <fieldset ng-disabled="!ldapProperties.ServiceEnabled"> |
| 30 | <div class="ldap__configure-settings row column"> |
| 31 | <div class="large-3 column ldap__ssl-column"> |
| 32 | <label class="control-check" ng-class="{'disabled' : certificates.length < 1}"> |
| 33 | <input id="secure-ldap-ssl" type="checkbox" ng-model="ldapProperties.useSSL" |
| 34 | ng-checked="ldapProperties.useSSL" ng-disabled="certificates.length < 1" /> |
| 35 | <span class="control__indicator"></span> |
| 36 | <span class="control__label">Secure LDAP using SSL</span> |
| 37 | </label> |
| 38 | <div> |
| 39 | <div class="ldap__certificate-info" ng-if="ldapProperties.ServiceEnabled"> |
| 40 | <p>Client certificate valid until:</p> |
| 41 | <small> |
| 42 | {{clientCertificateExpires ? (clientCertificateExpires | localeDate) : 'none available'}}</small> |
| 43 | </div> |
| 44 | </div> |
| 45 | <div class="ldap__certificate-info" ng-if="data.ValidNotAfter='' || !ldapProperties.ServiceEnabled"> |
| 46 | <span>SSL certificates must be uploaded to secure LDAP using SSL.</span> |
| 47 | </div> |
| 48 | <div class="ldap__certificate-info"> |
| 49 | <a href="#/configuration/certificate">Go to SSL certificates</a> |
| 50 | </div> |
| 51 | </div> |
| 52 | <div class="large-9 columns ldap__server-info"> |
| 53 | <div class="column service-type-column"> |
| 54 | <fieldset class="ldap__server-info-service-type"> |
| 55 | <legend class="content-label">Service Type</legend> |
| 56 | <label class="control-radio control__radio__label" for="open-ldap">Open LDAP |
| 57 | <input type="radio" name="service_enabled_type" id="open-ldap" value="ldap" |
| 58 | ng-checked="ldapProperties.LDAPServiceEnabled" |
| 59 | ng-change="ldapProperties.EnabledServiceUpdated = true" ng-model="ldapProperties.EnabledServiceType" |
| 60 | required /> |
| 61 | <span class="control__indicator control__indicator-on control__indicator-service-type"></span> |
| 62 | </label> |
| 63 | <label class="control-radio control__radio__label" for="active-directory">Active directory |
| 64 | <input type="radio" name="service_enabled_type" id="active-directory" |
| 65 | ng-change="ldapProperties.EnabledServiceUpdated = true" value="ad" |
| 66 | ng-checked="ldapProperties.ADServiceEnabled" ng-model="ldapProperties.EnabledServiceType" |
| 67 | required /> |
| 68 | <span class="control__indicator control__indicator-on control__indicator-service-type"></span> |
| 69 | </label> |
| 70 | </fieldset> |
| 71 | </div> |
| 72 | <div class="medium-6 large-4 columns"> |
| 73 | <label for="ldap__uri">Server uri</label> |
| 74 | <input id="ldap__uri" name="ldap__uri" type="text" |
| 75 | ng-change="ldapProperties.ServiceAddressesUpdated = true" ng-model="ldapProperties.ServiceAddresses[0]" |
| 76 | required /> |
| 77 | <div ng-messages="ldap__configuration.ldap__uri.$error" class="form-error" |
| 78 | ng-class="{'visible' : ldap__configuration.ldap__uri.$touched || submitted}"> |
| 79 | <p ng-message="required">Field is required</p> |
| 80 | </div> |
| 81 | </div> |
| 82 | <div class="medium-6 large-4 columns"> |
| 83 | <label for="ldap__bind__dn">Bind DN</label> |
| 84 | <input id="ldap__bind__dn" name="ldap__bind__dn" type="text" |
| 85 | ng-change="ldapProperties.UsernameUpdated = true" ng-model="ldapProperties.Username" required /> |
| 86 | <div ng-messages="ldap__configuration.ldap__bind__dn.$error" class="form-error" |
| 87 | ng-class="{'visible' : ldap__configuration.ldap__bind__dn.$touched || submitted}"> |
| 88 | <p ng-message="required">Field is required</p> |
| 89 | </div> |
| 90 | </div> |
| 91 | <div class="medium-6 large-4 columns"> |
| 92 | <label for="ldap__bind_pw">Bind password</label> |
| 93 | <input id="ldap__bind_pw" type="{{showpassword ? 'text' : 'password'}}" name="ldap__bind_pw" |
| 94 | ng-change="ldapProperties.PasswordUpdated = true" autocomplete="off" ng-model="ldapProperties.Password" |
| 95 | required /> |
| 96 | <button ng-model="showpassword" ng-class="{'disabled' : !ldap__configuration.$valid}" |
| 97 | ng-click="togglePassword = !togglePassword; showpassword = !showpassword;" class="password-toggle"> |
| 98 | <span ng-hide="togglePassword">Show</span> |
| 99 | <span ng-show="togglePassword">Hide</span> |
| 100 | </button> |
| 101 | <div ng-messages="ldap__configuration.ldap__bind_pw.$error" class="form-error" |
| 102 | ng-class="{'visible' : ldap__configuration.ldap__bind_pw.$touched || submitted}"> |
| 103 | <p ng-message="required">Field is required</p> |
| 104 | </div> |
| 105 | </div> |
| 106 | <div class="medium-6 large-4 columns"> |
| 107 | <label for="ldap__base__dn">Base DN</label> |
| 108 | <input id="ldap__base__dn" name="ldap__base__dn" type="text" |
| 109 | ng-change="ldapProperties.BaseDistinguishedNamesUpdated = true" |
| 110 | ng-model="ldapProperties.BaseDistinguishedNames[0]" required /> |
| 111 | <div ng-messages="ldap__configuration.ldap__base__dn.$error" class="form-error" |
| 112 | ng-class="{'visible' : ldap__configuration.ldap__base__dn.$touched || submitted}"> |
| 113 | <p ng-message="required">Field is required</p> |
| 114 | </div> |
| 115 | </div> |
| 116 | <div class="medium-6 large-4 columns"> |
| 117 | <label for="ldap__user_attribute">User id attribute (optional)</label> |
| 118 | <input id="ldap__user_attribute" name="ldap__user_attribute" type="text" |
| 119 | ng-change="ldapProperties.UsernameAttributeUpdated = true" ng-model="ldapProperties.UsernameAttribute" |
| 120 | class="ldap__optional-field" /> |
| 121 | </div> |
| 122 | <div class="medium-6 large-4 columns"> |
| 123 | <label for="ldap__group_attribute">Group id attribute (optional)</label> |
| 124 | <input id="ldap__group_attribute" name="ldap__group_attribute" type="text" |
| 125 | ng-change="ldapProperties.GroupsAttributeUpdated = true" ng-model="ldapProperties.GroupsAttribute" |
| 126 | class="ldap__optional-field" /> |
| 127 | </div> |
| 128 | <div class="column ldap__configuration-buttons"> |
| 129 | <button type="button" class="btn btn-primary" ng-disabled="!ldap__configuration.$valid" |
| 130 | ng-click="$parent.submitted=true; ldap__configuration.$valid && saveLdapSettings(); ldap__configuration.$setUntouched()">Save</button> |
| 131 | <button type="button" class="btn btn-secondary" |
| 132 | ng-click="loadLdap(); ldap__configuration.$setUntouched()">Reset</button> |
| 133 | </div> |
| 134 | </fieldset> |
| 135 | </form> |
| 136 | </div> |
| 137 | </div> |
| 138 | <div class="ldap-groups row column"> |
| 139 | <h2 class="small-12 subhead"> |
| 140 | Role groups |
| 141 | </h2> |
| 142 | <div class="row column"> |
| 143 | <div class="small-12"> |
| 144 | <ldap-user-roles role-groups="roleGroups" role-group-type="roleGroupType" enabled="ldapProperties.ServiceEnabled"> |
| 145 | </ldap-user-roles> |
| 146 | </div> |
| 147 | </div> |
| 148 | </div> |