setting.user.php 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. global $myUser;
  3. if(!$myUser->can('user','configure')) throw new Exception("Permissions insuffisantes",403);
  4. ?>
  5. <div class="row">
  6. <div class="col-md-12">
  7. <br>
  8. <h3>Utilisateurs</h3>
  9. <hr/>
  10. <div id="userFormAdmin" data-action="save_user">
  11. <div class="row">
  12. <div class="col-md-6">
  13. <label for="login">Identifiant :</label>
  14. <input id="login" required class="form-control" placeholder="Identifiant" type="text">
  15. </div>
  16. <div class="col-md-6">
  17. <label for="mail">Mail :</label>
  18. <input id="mail" required class="form-control" placeholder="Mail" type="text">
  19. </div>
  20. </div>
  21. <div class="row">
  22. <div class="col-md-6">
  23. <label for="password">Mot de passe :</label>
  24. <input required type="password" data-show-strength data-generator data-type="password" placeholder="Mot de passe" class="form-control" id="password"/>
  25. </div>
  26. <div class="col-md-6">
  27. <label for="password2">Mot de passe (confirmation) :</label>
  28. <input required type="password" data-type="password" placeholder="Mot de passe (confirmation)" class="form-control" id="password2"/>
  29. </div>
  30. </div>
  31. <div class="row">
  32. <div class="col-md-6">
  33. <label for="name">Nom :</label>
  34. <input id="name" class="form-control" placeholder="Nom" type="text">
  35. </div>
  36. <div class="col-md-6">
  37. <label for="firstname">Prénom :</label>
  38. <input id="firstname" class="form-control" placeholder="Prénom" type="text">
  39. </div>
  40. </div>
  41. <div class="row">
  42. <div class="col-md-6">
  43. <label for="manager">Manager :</label>
  44. <input id="manager" data-type="user" class="form-control" placeholder="Manager" type="text">
  45. </div>
  46. <div class="col-md-6 pt-4">
  47. <div onclick="save_user();" class="btn btn-success float-right"><i class="fas fa-check"></i> Enregistrer</div>
  48. </div>
  49. </div>
  50. </div>
  51. <hr><br>
  52. <div class="panel panel-default">
  53. <div class="panel-heading">Liste des utilisateurs existants :</div><br>
  54. <table id="users" class="table table-users table-striped ">
  55. <thead>
  56. <tr>
  57. <th class="avatar-head"></th>
  58. <th>Nom</th>
  59. <th>Mail</th>
  60. <th>Identifiant</th>
  61. <th>Origine</th>
  62. <th></th>
  63. </tr>
  64. </thead>
  65. <tbody>
  66. <tr data-user="{{login}}" class="noDisplay">
  67. <td class="text-center avatar-cell"><img class="avatar-medium avatar-rounded" data-src="{{avatar}}"/></td>
  68. <td>{{firstname}} {{name}}</td>
  69. <td>{{mail}}</td>
  70. <td><code>{{login}}</code></td>
  71. <td>{{origin}}</td>
  72. <td class="text-right">
  73. <?php if($myUser->can('user','edit')): ?>
  74. {{#id}}<div onclick="edit_user(this)" class="btn btn-info btn-squarred btn-mini" title="Modifier"><i class="fas fa-pencil-alt"></i></div>{{/id}}
  75. <?php endif; ?>
  76. <?php if($myUser->superadmin): ?>
  77. <div onclick="window.location='action.php?action=user_impersonation&login={{login}}';" title="Se connecter en tant que {{login}}" class="btn btn-warning btn-squarred btn-mini"><i class="far fa-meh-blank"></i></div>
  78. <?php endif; ?>
  79. <div onclick="delete_user(this)" class="btn btn-danger btn-squarred btn-mini"><i class="fas fa-times"></i></div>
  80. </td>
  81. </tr>
  82. </tbody>
  83. </table>
  84. </div>
  85. </div>
  86. </div>