From 0b485392e0de1a7121dee332ffb4485ae355f6a7 Mon Sep 17 00:00:00 2001 From: Paolo Asperti Date: Sun, 18 Sep 2016 10:22:33 +0200 Subject: [PATCH] FIX: everything is english now --- README.md | 8 ++++---- importa_utenti.pl => users_import.pl | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) rename importa_utenti.pl => users_import.pl (88%) diff --git a/README.md b/README.md index a5fb739..8fe51f1 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@ Beware that Microsoft Excel uses the semicolon (;) as a separator instead the co To import, simply call the script passing the input file as STDIN or via the --file switch. - ./importa_utenti.pl [--file INPUTFILE] [--separator SEPARATOR] [--add_existing_users_to_groups] [--remove_users] + ./users_import.pl [--file INPUTFILE] [--separator SEPARATOR] [--add_existing_users_to_groups] [--remove_users] Some examples: - ./importa_utenti.pl < test.csv - ./importa_utenti.pl --file test.csv --separator ";" - cat test.csv | ./importa_utenti.pl --separator "," --add_existing_users_to_groups + ./users_import.pl < test.csv + ./users_import.pl --file test.csv --separator ";" + cat test.csv | ./users_import.pl --separator "," --add_existing_users_to_groups You can specify a custom field separator. The import process will create all non-existing groups. If the user already exists and the "add_existing_users_to_groups" switch is NOT set, then the line is skipped (so if you specify a nonexistent group for this user, the group won't be created). If you enable "add_existing_users_to_groups" and the user is already present, the non-existing groups are created and the user is assigned to all the specified groups. diff --git a/importa_utenti.pl b/users_import.pl similarity index 88% rename from importa_utenti.pl rename to users_import.pl index 8a39251..798b7b0 100755 --- a/importa_utenti.pl +++ b/users_import.pl @@ -1,10 +1,12 @@ #!/usr/bin/perl -# TODO: quando un gruppo viene cancellato, nel database cambia "tipo" -# e da "group" diventa "group-deleted". -# questo fa casino, perchè il gruppo esiste, ma è cancellato. -# bisogna gestire correttamente questa cosa - +# TODO: +# - when a group is deleted, it changes type inside the database: +# from "group" it becomes "group-deleted". +# We still need to manage this, as we can't add a group with the same name +# of a removed group. +# - It looks like the above problem is present for users also. The error is: +# Attempt to create account 'XXXXXXXX' which already exists in passwd at /usr/share/perl5/vendor_perl/esmith/AccountsDB.pm line 493, line XXXXXXXX. use strict; use Getopt::Long;