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.

85 lines
5.4 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <!doctype html>
  2. <html lang="it" ng-app="lilikAddUserApp">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1" />
  6. <title>Create new user</title>
  7. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous" />
  8. <link rel="stylesheet" href="add.css" />
  9. <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js" integrity="sha384-7N66VCkbpJUVwHKCEz5qEgog94BLAJpgfXvD55ThBuHpdPrffMfva/Kl1WH8Y8FS" crossorigin="anonymous"></script>
  10. <script src="add.js"></script>
  11. </head>
  12. <body ng-controller="AddUserController">
  13. <div class="container text-center" ng-show="showLoginForm">
  14. <form class="form-signin">
  15. <h1 class="h3 mb-3 font-weight-normal">Accesso admin</h1>
  16. <label for="adminUid" class="sr-only">Username:</label>
  17. <input class="form-control" type="username" id="adminUid" ng-model="adminUid" placeholder="Username" required autofocus />
  18. <input class="form-control" type="password" id="adminPwd" ng-model="adminPwd" placeholder="Password" required />
  19. <button class="btn btn-lg btn-primary btn-block" type="submit" ng-click="getGroups()">Login</button>
  20. <div ng-show="loginError" class="alert alert-danger" role="alert">
  21. <h4>Impossibile accedere!</h4>
  22. <p>Non è stato possibile autenticarsi come amministratore.</p>
  23. </div>
  24. </form>
  25. </div>
  26. <div class="container" ng-show="showAddForm">
  27. <form name="newUserForm">
  28. <h1 ng-show="!startConfirm" class="h3 mb-3 font-weight-normal">Crea nuovo utente</h1>
  29. <h1 ng-show="startConfirm" class="h3 mb-3 font-weight-normal">Conferma creazione</h1>
  30. <div class="form-group">
  31. <label for="newGroup">Gruppo principale</label>
  32. <select class="form-control" id="newGroup" ng-model="newGroup" required ng-readonly="startConfirm">
  33. <option ng-repeat="(key, value) in groups" value="{{key}}">{{value}}</option>
  34. </select>
  35. </div>
  36. <div class="form-group">
  37. <label for="newExtraGroups">Gruppi aggiuntivi</label>
  38. <select multiple class="form-control" id="newExtraGroups" ng-model="newExtraGroups" ng-readonly="startConfirm">
  39. <option ng-repeat="(key,value) in groups | excludeKey: newGroup" value="{{key}}">{{value}}</option>
  40. </select>
  41. <div class="form-group">
  42. <label for="newUid">Username</label>
  43. <input class="form-control" type="username" id="newUid" ng-model="newUid" placeholder="nome.utente" aria-describedby="newUidHelp" required ng-readonly="startConfirm" ng-keyup="typingUser()" />
  44. <small id="newUidHelp" class="form-text text-muted">
  45. Nome utente utilizzato per il login e per gli indirizzi <i>nome.utente</i><b>@lilik.it</b>.
  46. </small>
  47. </div>
  48. <div class="form-group">
  49. <label for="newCn">Nome visualizzato</label>
  50. <input class="form-control" type="commonname" id="newCn" ng-model="newCn" placeholder="Nome Utente" aria-describedby="newCnHelp" required ng-readonly="startConfirm" />
  51. <small id="newCnHelp" class="form-text text-muted">
  52. Nome pubblico visualizzato, per esempio in file condivisi o chat.
  53. </small>
  54. </div>
  55. <div class="form-group">
  56. <label for="newCn">Nome e cognome</label>
  57. <input class="form-control" type="fullname" id="newSn" ng-model="newSn" placeholder="Nome Cognome" aria-describedby="newSnHelp" required ng-readonly="startConfirm" />
  58. <small id="newSnHelp" class="form-text text-muted">
  59. Nome e cognome completo. Non viene reso pubblico, solo per organizzazione interna.
  60. </small>
  61. </div>
  62. <button ng-disabled="newUserForm.$invalid" ng-show="!startConfirm" class="btn btn-lg btn-primary btn-block" type="submit" ng-click="createNewUser()">Crea</button>
  63. <button ng-disabled="creationPending" ng-show="startConfirm && !newPasswd && !createError" class="btn btn-lg btn-primary btn-block" type="submit" ng-click="confirmNewUser()">Conferma</button>
  64. <div ng-show="newPasswd" class="alert alert-success" role="alert">
  65. <h4>Utente creato!</h4>
  66. <p>Quella che segue è la password temporanea. Comunicala all'utente attraverso un canale sicuro e invitalo a modificarla prima di ogni altra cosa,
  67. accedendo a <u>https://login.lilik.it</u>. Copiala e inviala ora, non verrà mostrata in un secondo momento!</p>
  68. <hr>
  69. <h2 class="text-monospace text-center">{{newPasswd}}</h2>
  70. <hr>
  71. <a href="#" class="alert-link" ng-click="anotherUser()">Crea un altro utente</a>
  72. </div>
  73. <div ng-show="createError" class="alert alert-danger" role="alert">
  74. <h4>Errore!</h4>
  75. <p>Non è stato possibile completare la creazione dell'utente per il seguente motivo:</p>
  76. <hr>
  77. <p>{{createError}}</p>
  78. <hr>
  79. <a href="#" class="alert-link" ng-click="editUser()">Modifica dati utente</a>
  80. </div>
  81. </form>
  82. </div>
  83. </body>
  84. </body>
  85. </html>