Utente creato!
-
Quella che segue è la password temporanea. Comunicala all'utente attraverso un canale sicuro e invitalo a modificarla prima di ogni altra cosa,
+
Quella che segue è la password temporanea. Comunicala all'utente attraverso un canale sicuro e invitalo a modificarla prima di ogni altra cosa,
accedendo a https://login.lilik.it. Copiala e inviala ora, non verrà mostrata in un secondo momento!
{{newPasswd}}
diff --git a/static/add.js b/static/add.js
index cd2262e..c3156b0 100644
--- a/static/add.js
+++ b/static/add.js
@@ -12,6 +12,22 @@
var lilikAddUserApp = angular.module('lilikAddUserApp', []);
+ lilikAddUserApp.filter('excludeKey', function() {
+ return function(input, search) {
+ if (!input) return input;
+ if (!search) return input;
+ var excluded_key = ('' + search);
+ var result = {};
+ angular.forEach(input, function(value, key) {
+ var actual_key = ('' + key);
+ if (actual_key != excluded_key) {
+ result[key] = value;
+ }
+ });
+ return result;
+ }
+ });
+
lilikAddUserApp.controller('AddUserController', function AddUserController($scope, $http) {
// Initialize scope variable
$scope.showLoginForm = true;
@@ -19,11 +35,16 @@
$scope.showConfirmForm = false;
$scope.startConfirm = false;
$scope.creationPending = false;
+ $scope.newExtraGroups = [];
$scope.typingUser = function () {
$scope.newUid = $scope.newUid.toLowerCase().replace(' ', '-');
$scope.newCn = $scope.newUid.replace('-',' ').replace(/(^\w|\s\w)/g, m => m.toUpperCase());
- };
+ };
+
+ $scope.notPrincipal = function (group) {
+ return group.key !== $scope.newGroup;
+ }
// Try to login and download groups
$scope.getGroups = function () {
@@ -52,7 +73,8 @@
$scope.confirmNewUser = function () {
newEntry = {
"cn": $scope.newCn,
- "sn": $scope.newSn
+ "sn": $scope.newSn,
+ "memberOf": $scope.newExtraGroups
};
$http.post('../user_backend/group/'+$scope.newGroup+'/create/'+$scope.newUid,
{
@@ -67,7 +89,7 @@
} else {
$scope.createError = result.reason;
}
- });
+ });
};
// Clear old user scope variable and start creating another
@@ -77,6 +99,7 @@
delete $scope.newUid;
delete $scope.newCn;
delete $scope.newSn;
+ $scope.newExtraGroups = [];
$scope.startConfirm = false;
};