Possibility to exclude attributes in sessions conversion
This commit is contained in:
parent
321be132c4
commit
67c8df09ad
|
@ -23,11 +23,13 @@ our $VERSION = "2.0.12";
|
||||||
# -c: configuration file
|
# -c: configuration file
|
||||||
# -r: rename attributes
|
# -r: rename attributes
|
||||||
# -i: ignore errors
|
# -i: ignore errors
|
||||||
|
# -x: exclude attributes
|
||||||
|
|
||||||
my $debug;
|
my $debug;
|
||||||
my $config_file;
|
my $config_file;
|
||||||
my $ignore_errors;
|
my $ignore_errors;
|
||||||
my %rename;
|
my %rename;
|
||||||
|
my @exclude;
|
||||||
my $help;
|
my $help;
|
||||||
my $nb_converted = 0;
|
my $nb_converted = 0;
|
||||||
my $nb_error = 0;
|
my $nb_error = 0;
|
||||||
|
@ -38,6 +40,7 @@ GetOptions(
|
||||||
'config|c=s' => \$config_file,
|
'config|c=s' => \$config_file,
|
||||||
'ignore-errors|i' => \$ignore_errors,
|
'ignore-errors|i' => \$ignore_errors,
|
||||||
'rename|r=s' => \%rename,
|
'rename|r=s' => \%rename,
|
||||||
|
'exclude|x=s' => \@exclude,
|
||||||
) or pod2usage(2);
|
) or pod2usage(2);
|
||||||
pod2usage(
|
pod2usage(
|
||||||
-exitval => 1,
|
-exitval => 1,
|
||||||
|
@ -133,6 +136,16 @@ Lemonldap::NG::Common::Apache::Session->get_key_from_all_sessions(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (@exclude) {
|
||||||
|
for my $excludekey (@exclude) {
|
||||||
|
if ( $entry->{$excludekey} ) {
|
||||||
|
print "Exclude $excludekey in session $id\n"
|
||||||
|
if $debug;
|
||||||
|
delete $entry->{$excludekey};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print "Processing session $id\n" if $debug;
|
print "Processing session $id\n" if $debug;
|
||||||
my $s = Lemonldap::NG::Common::Session->new( {
|
my $s = Lemonldap::NG::Common::Session->new( {
|
||||||
storageModule => $backendTo->{backend},
|
storageModule => $backendTo->{backend},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user