|
<!doctype html>
|
|
<html lang="it" ng-app="lilikAddUserApp">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title>Create new user</title>
|
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous" />
|
|
<link rel="stylesheet" href="add.css" />
|
|
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js" integrity="sha384-7N66VCkbpJUVwHKCEz5qEgog94BLAJpgfXvD55ThBuHpdPrffMfva/Kl1WH8Y8FS" crossorigin="anonymous"></script>
|
|
<script src="add.js"></script>
|
|
</head>
|
|
<body ng-controller="AddUserController">
|
|
<div class="container text-center" ng-show="showLoginForm">
|
|
<form class="form-signin">
|
|
<h1 class="h3 mb-3 font-weight-normal">Accesso admin</h1>
|
|
<label for="adminUid" class="sr-only">Username:</label>
|
|
<input class="form-control" type="username" id="adminUid" ng-model="adminUid" placeholder="Username" required autofocus />
|
|
<input class="form-control" type="password" id="adminPwd" ng-model="adminPwd" placeholder="Password" required />
|
|
<button class="btn btn-lg btn-primary btn-block" type="submit" ng-click="getGroups()">Login</button>
|
|
<div ng-show="loginError" class="alert alert-danger" role="alert">
|
|
<h4>Impossibile accedere!</h4>
|
|
<p>Non è stato possibile autenticarsi come amministratore.</p>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="container" ng-show="showAddForm">
|
|
<form name="newUserForm">
|
|
<h1 ng-show="!startConfirm" class="h3 mb-3 font-weight-normal">Crea nuovo utente</h1>
|
|
<h1 ng-show="startConfirm" class="h3 mb-3 font-weight-normal">Conferma creazione</h1>
|
|
<div class="form-group">
|
|
<label for="newGroup">Gruppo principale</label>
|
|
<select class="form-control" id="newGroup" ng-model="newGroup" required ng-readonly="startConfirm">
|
|
<option ng-repeat="(key, value) in groups" value="{{key}}">{{value}}</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="newExtraGroups">Gruppi aggiuntivi</label>
|
|
<select multiple class="form-control" id="newExtraGroups" ng-model="newExtraGroups" ng-readonly="startConfirm">
|
|
<option ng-repeat="(key,value) in groups | excludeKey: newGroup" value="{{key}}">{{value}}</option>
|
|
</select>
|
|
<div class="form-group">
|
|
<label for="newUid">Username</label>
|
|
<input class="form-control" type="username" id="newUid" ng-model="newUid" placeholder="nome-utente" aria-describedby="newUidHelp" required ng-readonly="startConfirm" ng-keyup="typingUser()" />
|
|
<small id="newUidHelp" class="form-text text-muted">
|
|
Nome utente utilizzato per il login e per gli indirizzi <i>nome-utente</i><b>@lilik.it</b>.
|
|
</small>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="newCn">Nome visualizzato</label>
|
|
<input class="form-control" type="commonname" id="newCn" ng-model="newCn" placeholder="Nome Utente" aria-describedby="newCnHelp" required ng-readonly="startConfirm" />
|
|
<small id="newCnHelp" class="form-text text-muted">
|
|
Nome pubblico visualizzato, per esempio in file condivisi o chat.
|
|
</small>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="newCn">Nome e cognome</label>
|
|
<input class="form-control" type="fullname" id="newSn" ng-model="newSn" placeholder="Nome Cognome" aria-describedby="newSnHelp" required ng-readonly="startConfirm" />
|
|
<small id="newSnHelp" class="form-text text-muted">
|
|
Nome e cognome completo. Non viene reso pubblico, solo per organizzazione interna.
|
|
</small>
|
|
</div>
|
|
<button ng-disabled="newUserForm.$invalid" ng-show="!startConfirm" class="btn btn-lg btn-primary btn-block" type="submit" ng-click="createNewUser()">Crea</button>
|
|
<button ng-disabled="creationPending" ng-show="startConfirm && !newPasswd && !createError" class="btn btn-lg btn-primary btn-block" type="submit" ng-click="confirmNewUser()">Conferma</button>
|
|
<div ng-show="newPasswd" class="alert alert-success" role="alert">
|
|
<h4>Utente creato!</h4>
|
|
<p>Quella che segue è la password temporanea. Comunicala all'utente attraverso un canale sicuro e invitalo a modificarla prima di ogni altra cosa,
|
|
accedendo a <u>https://login.lilik.it</u>. Copiala e inviala ora, non verrà mostrata in un secondo momento!</p>
|
|
<hr>
|
|
<h2 class="text-monospace text-center">{{newPasswd}}</h2>
|
|
<hr>
|
|
<a href="#" class="alert-link" ng-click="anotherUser()">Crea un altro utente</a>
|
|
</div>
|
|
<div ng-show="createError" class="alert alert-danger" role="alert">
|
|
<h4>Errore!</h4>
|
|
<p>Non è stato possibile completare la creazione dell'utente per il seguente motivo:</p>
|
|
<hr>
|
|
<p>{{createError}}</p>
|
|
<hr>
|
|
<a href="#" class="alert-link" ng-click="editUser()">Modifica dati utente</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</body>
|
|
</body>
|
|
</html>
|