setting.sheet.adserver.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <?php
  2. User::check_access('activedirectory','read');
  3. require_once(__DIR__.SLASH.'AdServer.class.php');
  4. $adserver = AdServer::provide();
  5. ?>
  6. <div class="plugin-activedirectory">
  7. <div id="adserver-form" class="row justify-content-md-center adserver-form" data-action="activedirectory_adserver_save" data-id="<?php echo $adserver->id; ?>">
  8. <div class="col-md-12">
  9. <h3>SERVEUR
  10. <div onclick="activedirectory_adserver_save();" class="btn btn-small btn-success right"><i class="fas fa-check"></i> Enregistrer</div>
  11. <div onclick="activedirectory_adserver_test();" class="btn btn-small btn-test btn-primary right mr-2"><i class="fas fa-vial"></i> Tester</div>
  12. <a href="setting.php?section=list.adserver" class="btn btn-small btn-dark right mr-2">Retour</a></h3>
  13. <div id="activedirectory-test" class="activedirectory-test">
  14. <template>
  15. <div class="shadow-sm bg-white p-3 mb-3">
  16. <h7 class="text-muted font-weight-bold">TESTS DE CONNEXION</h7>
  17. <div class="row">
  18. <div class="col-md-4 activedirectory-test-block">
  19. <div class="mb-3">
  20. {{#data_validity}}<i class="far fa-check-circle text-success"></i>{{/data_validity}}
  21. {{^data_validity}}<i class="far fa-times-circle text-danger"></i>{{/data_validity}}
  22. Validité des données configurées
  23. </div>
  24. </div>
  25. <div class="col-md-4 activedirectory-test-block">
  26. <div class="mb-3">
  27. {{#server_reachable}}<i class="far fa-check-circle text-success"></i>{{/server_reachable}}
  28. {{^server_reachable}}<i class="far fa-times-circle text-danger"></i>{{/server_reachable}}
  29. IP/PORT du serveur atteignables
  30. </div>
  31. </div>
  32. <div class="col-md-4 activedirectory-test-block">
  33. <div class="mb-3">
  34. {{#authentication_readonly}}<i class="far fa-check-circle text-success"></i>{{/authentication_readonly}}
  35. {{^authentication_readonly}}<i class="far fa-times-circle text-danger"></i>{{/authentication_readonly}}
  36. Authentification de l'utilisateur readonly
  37. </div>
  38. </div>
  39. <div class="col-md-4 activedirectory-test-block">
  40. <div class="">
  41. {{#authentication_readonly}}<i class="far fa-check-circle text-success"></i>{{/authentication_readonly}}
  42. {{^authentication_readonly}}<i class="far fa-times-circle text-danger"></i>{{/authentication_readonly}}
  43. Authentification de l'utilisateur admin
  44. </div>
  45. </div>
  46. <div class="col-md-4 activedirectory-test-block">
  47. <div class="">
  48. {{#users}}<i class="far fa-check-circle text-success"></i>{{/users}}
  49. {{^users}}<i class="far fa-times-circle text-danger"></i>{{/users}}
  50. Détection des comptes ({{users}} comptes)
  51. </div>
  52. </div>
  53. <div class="col-md-4 activedirectory-test-block">
  54. <div class="">
  55. {{#groups}}<i class="far fa-check-circle text-success"></i>{{/groups}}
  56. {{^groups}}<i class="far fa-times-circle text-danger"></i>{{/groups}}
  57. Détection des groupes ({{groups}} groupes)
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </template>
  63. </div>
  64. <div class="shadow-sm bg-white p-3">
  65. <h7 class="text-muted font-weight-bold">CONNEXION</h7>
  66. <div class="input-group mb-3">
  67. <div class="input-group-prepend">
  68. <label class="input-group-text" for="ip">IP</label>
  69. </div>
  70. <input value="<?php echo $adserver->ip; ?>" class="form-control" type="text" id="ip" >
  71. <div class="input-group-prepend">
  72. <label class="input-group-text" for="port">Port</label>
  73. </div>
  74. <input value="<?php echo $adserver->port; ?>" class="form-control" type="number" id="port" >
  75. <div class="input-group-prepend">
  76. <label class="input-group-text" for="sslPort">Port SSL</label>
  77. </div>
  78. <input value="<?php echo $adserver->sslPort; ?>" class="form-control" type="number" id="sslPort" >
  79. <div class="input-group-prepend">
  80. <label class="input-group-text" for="protocolVersion">Version LDAP</label>
  81. </div>
  82. <input value="<?php echo $adserver->protocolVersion; ?>" class="form-control" type="number" id="protocolVersion" >
  83. </div>
  84. <div class="input-group mb-3">
  85. <div class="input-group-prepend">
  86. <label class="input-group-text" for="ip">Domaine</label>
  87. </div>
  88. <input value="<?php echo $adserver->domain; ?>" placeholder="@domaine.local" class="form-control" type="text" id="domain" >
  89. </div>
  90. </div>
  91. <div class="shadow-sm bg-white p-3 mt-3">
  92. <h7 class="text-muted font-weight-bold">ARBORESCENCE</h7>
  93. <div class="row">
  94. <div class="col-md-6">
  95. <label for="userRoot">Racine des comptes utilisateurs
  96. <small class="text-muted">Une "OU" par ligne</small></label>
  97. <textarea class="form-control" type="text" id="userRoot"><?php echo $adserver->userRoot; ?></textarea>
  98. </div>
  99. <div class="col-md-6">
  100. <label for="groupRoot">Racine des groupes utilisateurs
  101. <small class="text-muted">Une "OU" par ligne</small></label>
  102. <textarea class="form-control" type="text" id="groupRoot"><?php echo $adserver->groupRoot; ?></textarea>
  103. </div>
  104. </div>
  105. </div>
  106. <div class="shadow-sm bg-white p-3 mt-3">
  107. <h7 class="text-muted font-weight-bold">AUTHENTIFICATION</h7>
  108. <label for="authenticationMode" class="d-block">Mode d'authentification</label>
  109. <?php
  110. $modes = array();
  111. foreach(AdServer::authenticationModes() as $key=>$mode){
  112. $modes[$key] = $mode['label'];
  113. }
  114. ?>
  115. <label class="d-block"><input value="<?php echo $adserver->authenticationMode ?>" data-values='<?php echo json_encode($modes) ?>' data-type="choice" id="authenticationMode" type="text" name="authenticationMode"></label>
  116. <div class="row">
  117. <div class="col-md-6">
  118. <label for="readonlyLogin">Identifiant du compte lecture seule</label>
  119. <input value="<?php echo $adserver->readonlyLogin; ?>" class="form-control" type="text" id="readonlyLogin" >
  120. <label for="readonlyPassword">Mot de passe du compte lecture seule</label>
  121. <input value="<?php echo decrypt($adserver->readonlyPassword); ?>" class="form-control" type="text" data-type="password" autocomplete="new-password" id="readonlyPassword" >
  122. </div>
  123. <div class="col-md-6">
  124. <label for="adminLogin">Identifiant compte administrateur</label>
  125. <input value="<?php echo $adserver->adminLogin; ?>" class="form-control" type="text" id="adminLogin" >
  126. <label for="adminPassword">Mot de passe compte administrateur</label>
  127. <input value="<?php echo decrypt($adserver->adminPassword); ?>" class="form-control" type="text" data-type="password" autocomplete="new-password" id="adminPassword" >
  128. </div>
  129. </div>
  130. </div>
  131. <div class="shadow-sm bg-white p-3 mt-3">
  132. <h7 class="text-muted font-weight-bold">GROUPES & RANGS</h7>
  133. <?php require_once(__DIR__.SLASH.'setting.list.ad.firm.rank.php'); ?>
  134. </div>
  135. <div class="shadow-sm bg-white p-3 mt-3">
  136. <h7 class="text-muted font-weight-bold">LIAISON DES CHAMPS</h7>
  137. <br>
  138. <label for="mapping">Plan de liaisons des champs Champ AD : Champ de la classe utilisateur</label>
  139. <input data-format="multiple-values" data-columns='{"slug":"Champ AD","label":"Libellé","field":"Attribut Utilisateur"}' value='<?php echo $adserver->mapping; ?>' data-type="jsontable" id="mapping">
  140. <div class="clear"></div>
  141. </div>
  142. </div>
  143. </div>
  144. </div>