FIX: everything is english now

This commit is contained in:
Paolo Asperti 2016-09-18 10:22:33 +02:00
parent 3a4f502165
commit 0b485392e0
2 changed files with 11 additions and 9 deletions

View File

@ -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.

View File

@ -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, <FH> line XXXXXXXX.
use strict;
use Getopt::Long;