You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ldap-security.component.html 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <!--
  2. ~ Licensed to the Apache Software Foundation (ASF) under one
  3. ~ or more contributor license agreements. See the NOTICE file
  4. ~ distributed with this work for additional information
  5. ~ regarding copyright ownership. The ASF licenses this file
  6. ~ to you under the Apache License, Version 2.0 (the
  7. ~ "License"); you may not use this file except in compliance
  8. ~ with the License. You may obtain a copy of the License at
  9. ~
  10. ~ http://www.apache.org/licenses/LICENSE-2.0
  11. ~ Unless required by applicable law or agreed to in writing,
  12. ~ software distributed under the License is distributed on an
  13. ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. ~ KIND, either express or implied. See the License for the
  15. ~ specific language governing permissions and limitations
  16. ~ under the License.
  17. -->
  18. <form class="mt-3 mb-3" [formGroup]="userForm" (ngSubmit)="onSubmit()">
  19. <p class="row col-md-10">{{'security.config.ldap.explain'|translate}}</p>
  20. <div class="form-group row col-md-10"
  21. *ngFor="let attName of ['host_name','port','base_dn','groups_base_dn','bind_dn','bind_password']">
  22. <label class="col-md-3 col-form-label"
  23. for="{{attName}}">{{'security.config.ldap.attributes.' + attName |translate}}</label>
  24. <div [attr.class]="attName=='port'?'col-md-3':'col-md-7'">
  25. <input [attr.type]="attName=='bind_password'?'password':'text'" formControlName="{{attName}}"
  26. id="{{attName}}"
  27. [ngClass]="getInputClasses(attName)"
  28. >
  29. </div>
  30. </div>
  31. <div class="form-group row col-md-10">
  32. <label class="col-md-3 col-form-label"
  33. for="context_factory">{{'security.config.ldap.attributes.context_factory' |translate}}</label>
  34. <div class="col-md-7">
  35. <input type="text" formControlName="context_factory" id="context_factory"
  36. [ngClass]="getInputClasses('context_factory')" [ngbTypeahead]="searchContextFactory"
  37. [placement]="top"
  38. >
  39. </div>
  40. </div>
  41. <div class="form-group row col-md-10">
  42. <label class="col-md-3 col-form-label"
  43. for="authentication_method">{{'security.config.ldap.attributes.authentication_method' |translate}}</label>
  44. <div class="col-md-2">
  45. <select formControlName="authentication_method" id="authentication_method" class="form-control">
  46. <option *ngFor="let method of authenticationMethods">{{method}}</option>
  47. </select>
  48. </div>
  49. </div>
  50. <div class="form-group row col-md-10">
  51. <div class="col-md-3">{{'security.config.ldap.flags'|translate}}</div>
  52. <div class="col-md-7">
  53. <div class="form-check pt-1 pb-1"
  54. *ngFor="let flagName of ['writable','ssl_enabled','bind_authenticator_enabled','use_role_name_as_group']">
  55. <input class="form-check-input" type="checkbox" formControlName="{{flagName}}"
  56. id="{{flagName}}">
  57. <label class="form-check-label " for="{{flagName}}">
  58. {{'security.config.ldap.attributes.' + flagName|translate}}
  59. </label>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="form-group row col-md-10" >
  64. <div class="col-md-3">{{'security.config.ldap.attributes.properties'|translate}}</div>
  65. <div class="col-md-7 form-row">
  66. <input type="text" id="prop_key" formControlName="prop_key" class="form-control col" placeholder="{{'form.button.key'|translate}}"
  67. >
  68. <input type="prop_value" id="prop_value" formControlName="prop_value"
  69. class="form-control col" placeholder="{{'form.button.value'|translate}}">
  70. <button type="button" class="ml-2 btn btn-primary col" (click)="addProperty()">{{'form.button.add'|translate}}</button>
  71. </div>
  72. </div>
  73. <div class="form-group row col-md-10" *ngIf="ldapProperties && ldapProperties.size>0">
  74. <div class="col-md-3"></div>
  75. <div class="col-md-7 pl-2 list-group">
  76. <div class="list-group-item" *ngFor="let propEntry of ldapProperties |keyvalue">
  77. <span class="float-left">{{propEntry.key}}={{propEntry.value}}</span>
  78. <a class="float-right" [routerLink]="" (click)="removeProperty(propEntry.key)" ><i class="fas fa-trash-alt"></i></a>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="row col-md-10 mt-4">
  83. <button class="btn btn-primary col-md-2" type="submit"
  84. [disabled]="checkProgress|| userForm.invalid || !userForm.dirty">{{'form.button.save'|translate}}</button>
  85. <button class="btn btn-primary col-md-2 offset-1" type="button" (click)="checkLdapConnection()"
  86. [disabled]="checkProgress||userForm.invalid">
  87. <span *ngIf="checkProgress" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
  88. <span *ngIf="checkProgress">&nbsp;{{'form.button.checking'|translate}}</span>
  89. <span *ngIf="!checkProgress">{{'form.button.check'|translate}}</span></button>
  90. </div>
  91. <div class="row col-md-10 mt-2">
  92. <div class="alert col-md-6 ml-1 alert-success" role="alert"
  93. *ngIf="submitError">{{'security.config.ldap.submit_error'|translate:{error:submitError.toString()} }}</div>
  94. <div class="alert col-md-6 ml-1 alert-success" role="alert"
  95. *ngIf="checkResult=='success'">{{'security.config.ldap.check_success'|translate}}</div>
  96. <div class="alert col-md-6 ml-1 alert-warning" role="alert"
  97. *ngIf="checkResult=='error'">{{'security.config.ldap.check_failed'|translate}}</div>
  98. </div>
  99. </form>