Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LemonLDAP NG
lemonldap-ng
Commits
b8b9a085
Commit
b8b9a085
authored
Jul 18, 2021
by
Clément OUDOT
Browse files
Merge branch 'convertSessions-delete-attribute' into 'v2.0'
Exclude attributes in convert sessions script See merge request
!206
parents
fac231ba
4414ed2b
Pipeline
#14839
passed with stage
in 13 minutes and 43 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
doc/sources/admin/changesessionbackend.rst
View file @
b8b9a085
...
@@ -46,6 +46,7 @@ Options:
...
@@ -46,6 +46,7 @@ Options:
- ``-c``: job configuration file (mandatory)
- ``-c``: job configuration file (mandatory)
- ``-r oldkey=newkey``: rename session keys during conversion (optional, can be given multiple times)
- ``-r oldkey=newkey``: rename session keys during conversion (optional, can be given multiple times)
- ``-x key``: remove session keys during conversion (optional, can be given multiple times)
- ``-i``: ignore errors. By default errors will stop the script
- ``-i``: ignore errors. By default errors will stop the script
execution
execution
- ``-d``: print debugging output
- ``-d``: print debugging output
lemonldap-ng-common/scripts/convertSessions
View file @
b8b9a085
...
@@ -16,18 +16,20 @@ use strict;
...
@@ -16,18 +16,20 @@ use strict;
use
Getopt::
Long
;
use
Getopt::
Long
;
use
Pod::
Usage
;
use
Pod::
Usage
;
our
$VERSION
=
"
2.0.
6
";
our
$VERSION
=
"
2.0.
12
";
# Options
# Options
# -d: debug mode
# -d: debug mode
# -c: configuration file
# -c: configuration file
# -r:
configuration file
# -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(
...
@@ -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(
...
@@ -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
},
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment