Commit 2f48732a authored by Clément OUDOT's avatar Clément OUDOT

Manage configuration number increment (#649)

parent 81383893
......@@ -37,7 +37,11 @@ giveUpPrivileges( "www-data", "www-data" );
my ( $cli, $action, $method, $ret );
$cli = new Lemonldap::NG::Manager::Cli;
$cli = new Lemonldap::NG::Manager::Cli;
# Do not increment configuration by default
$cli->{confAccess}->{cfgNumFixed} = 1;
$action = shift(@ARGV);
$method = $cli->determineMethod($action);
......
......@@ -35,7 +35,7 @@ sub new {
## @method int saveConf ()
# Save LemonLDAP::NG configuration
#
# @return Configuration identifier.
# @return Configuration identifier
sub saveConf {
my ($self) = @_;
......@@ -43,13 +43,23 @@ sub saveConf {
$self->{conf}->{cfgAuthorIP} = "127.0.0.1";
$self->{conf}->{cfgDate} = time();
# Do not increment configuration number
$self->{conf}->{cfgNumFixed} = 1;
my $ret = $self->{confAccess}->saveConf( $self->{conf} );
return $ret;
}
## @method int increment ()
# Force increment of configuration number
#
# @return nothing
sub increment {
my ($self) = @_;
$self->{confAccess}->{cfgNumFixed} = 0;
$self->{confModified} = 1;
return;
}
## @method string determineMethod ()
# Determine the method from the arguments
#
......@@ -1033,6 +1043,7 @@ Global actions
lemonldap-ng-cli help - display this message
lemonldap-ng-cli info - show current configuration information
lemonldap-ng-cli increment - save current configuration into a new one
Simple parameters (key/value form)
==================================
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment