setting.activedirectory.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <?php
  2. global $myUser,$_,$conf;
  3. User::check_access('activedirectory','configure');
  4. require_once(__DIR__.SLASH.'ActiveDirectoryGroup.class.php');
  5. ?>
  6. <div class="row">
  7. <div class="col-md-12"><br>
  8. <div class="btn btn btn-success ml-2 float-right" onclick="activedirectory_setting_save();"><i class="fas fa-check"></i> Enregistrer</div>
  9. <h3>Réglages Active Directory</h3>
  10. <div class="clear"></div>
  11. <hr>
  12. <?php echo Configuration::html('activedirectory'); ?>
  13. <hr>
  14. </div>
  15. <div class="activedirectory-test-connection col-md-12 mt-3 mb-3">
  16. <div class="btn btn btn-primary float-right" onclick="activedirectory_connection_check();"><i class="fas fa-network-wired"></i> Tester la connexion</div>
  17. <legend>Récapitulatif de connexion</legend>
  18. <div class="clear"></div>
  19. <!-- Reload ajax partie bloc config -->
  20. <div class="row">
  21. <div class="col-sm-4">
  22. <div id="reach-connection" class="card text-center">
  23. <div class="card-body">
  24. <div class="label">
  25. <h5 class="">Connexion au serveur AD distant</h5>
  26. <small class="card-subtitle mb-2 text-muted">Test de connexion au serveur</small>
  27. </div>
  28. <span class="d-block mt-2 mb-3">
  29. <h2 class="card-icon d-block"><i class="fas fa-question-circle"></i></h2>
  30. </span>
  31. <small class="card-text text-muted">
  32. <div>IP Serveur : <span class="text-<?php echo !empty($conf->get('activedirectory_server'))?'primary':'danger'; ?>"><?php echo !empty($conf->get('activedirectory_server')) ? $conf->get('activedirectory_server') : "Non renseigné"; ?></span></div>
  33. <div>Port / Port SSL : <span class="text-<?php echo !empty($conf->get('activedirectory_port')) && !empty($conf->get('activedirectory_ssl_port'))?'primary':'danger'; ?>"><?php echo !empty($conf->get('activedirectory_port')) && !empty($conf->get('activedirectory_ssl_port')) ? $conf->get('activedirectory_port').' / '.$conf->get('activedirectory_ssl_port') : "Non renseigné"; ?></span></div>
  34. <div>Domaine : <span class="text-<?php echo !empty($conf->get('activedirectory_domain'))?'primary':'danger'; ?>"><?php echo !empty($conf->get('activedirectory_domain')) ? $conf->get('activedirectory_domain') : "Non renseigné"; ?></span></div>
  35. </small>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="col-sm-4">
  40. <div id="reader-connection" class="card text-center">
  41. <div class="card-body">
  42. <div class="label">
  43. <h5 class="">Connexion avec le compte AD <i>read-only</i></h5>
  44. <small class="card-subtitle mb-2 text-muted">Test d'identification avec le compte AD lecture seule</small>
  45. </div>
  46. <span class="d-block mt-2 mb-3">
  47. <h2 class="card-icon d-block"><i class="fas fa-question-circle"></i></h2>
  48. </span>
  49. <small class="card-text text-muted">
  50. <div class="text-fullbreak">CN : <span class="text-<?php echo !empty($conf->get('activedirectory_reader_login'))?'primary':'danger'; ?>"><?php echo !empty($conf->get('activedirectory_reader_login')) ? $conf->get('activedirectory_reader_login') : "Non renseigné"; ?></span></div>
  51. <div>Mot de passe : <span class="text-<?php echo !empty($conf->get('activedirectory_reader_password'))?'success':'danger'; ?>"><?php echo !empty($conf->get('activedirectory_reader_password')) ? "Renseigné" : "Non renseigné"; ?></span></div>
  52. </small>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="col-sm-4">
  57. <div id="users-connection" class="card text-center">
  58. <div class="card-body">
  59. <div class="label">
  60. <h5 class="">Récupération d'utilisateurs</h5>
  61. <small class="card-subtitle mb-2 text-muted">Test de récupération d'utilisateurs depuis l'AD</small>
  62. </div>
  63. <span class="d-block mt-2 mb-3">
  64. <h2 class="card-icon d-block"><i class="fas fa-question-circle"></i></h2>
  65. </span>
  66. <small class="card-text text-muted">
  67. <div class="mb-2">Racine des utilisateurs :
  68. <?php if(!empty($conf->get('activedirectory_users_root'))): ?>
  69. <ul class="pl-3 list-unstyled">
  70. <?php foreach(explode(';',$conf->get('activedirectory_users_root')) as $userRoot): ?>
  71. <li class="text-primary text-fullbreak"><?php echo $userRoot; ?></li>
  72. <?php endforeach; ?>
  73. </ul>
  74. <?php else: ?>
  75. <span class="text-danger">Non renseigné</span>
  76. <?php endif; ?>
  77. </div>
  78. <div>Racine des groupes :
  79. <?php if(!empty($conf->get('activedirectory_groups_root'))): ?>
  80. <ul class="pl-3 list-unstyled">
  81. <?php foreach(explode(';',$conf->get('activedirectory_groups_root')) as $userRoot): ?>
  82. <li class="text-primary text-fullbreak"><?php echo $userRoot; ?></li>
  83. <?php endforeach; ?>
  84. </ul>
  85. <?php else: ?>
  86. <span class="text-danger">Non renseigné</span>
  87. <?php endif; ?>
  88. </div>
  89. </small>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. <hr>
  95. </div>
  96. <div class="col-md-12">
  97. <legend>Correspondance Groupe / Rang / Établissement</legend>
  98. <table id="group-rank-firm" class="table table-striped table-bordered table-hover table-group-rank-firm">
  99. <thead>
  100. <tr>
  101. <th>Groupe AD</th>
  102. <th>Rang</th>
  103. <th>Établissement</th>
  104. <th></th>
  105. </tr>
  106. <tr id="ad-correspondance" data-id="" class="" data-action="activedirectory_group_save">
  107. <th><input type="text" name="ad-group" id="ad-group" placeholder="Nom du groupe" class="form-control"></th>
  108. <th>
  109. <select name="ad-rank" id="ad-rank" class="form-control">
  110. <option value="">-</option>
  111. <?php foreach(Rank::loadAll() as $rank): ?>
  112. <option value="<?php echo $rank->id; ?>"><?php echo $rank->label; ?></option>
  113. <?php endforeach; ?>
  114. </select>
  115. </th>
  116. <th>
  117. <select name="ad-firm" id="ad-firm" class="form-control">
  118. <option value="">-</option>
  119. <?php foreach(Firm::loadAll() as $firm): ?>
  120. <option value="<?php echo $firm->id; ?>"><?php echo $firm->label; ?></option>
  121. <?php endforeach; ?>
  122. </select>
  123. </th>
  124. <th class="text-center"><div class="btn btn-success" onclick="activedirectory_group_save();"><i class="fas fa-check"></i></div></th>
  125. </tr>
  126. </thead>
  127. <tbody>
  128. <tr data-id="{{id}}" class="hidden">
  129. <td>{{adgroup}}</td>
  130. <td>{{rankLabel}}</td>
  131. <td>{{firmLabel}}</td>
  132. <td class="text-center action-buttons">
  133. <div class="btn btn-info btn-squarred btn-mini" onclick="activedirectory_group_edit(this);"><i class="fas fa-pencil-alt"></i></div>
  134. <div class="btn btn-danger btn-squarred btn-mini" onclick="activedirectory_group_delete(this);"><i class="fas fa-times"></i></div>
  135. </td>
  136. </tr>
  137. </tbody>
  138. </table>
  139. <!-- Pagination -->
  140. <ul class="pagination justify-content-center">
  141. <li class="page-item hidden" data-value="{{value}}" title="Voir la page {{label}}" onclick="$(this).parent().find('li').removeClass('active');$(this).addClass('active');activedirectory_group_search()">
  142. <span class="page-link">{{label}}</span>
  143. </li>
  144. </ul>
  145. </div>
  146. </div>