Manage configuration number increment (#649)
This commit is contained in:
parent
8138389344
commit
2f48732a18
|
@ -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)
|
||||
==================================
|
||||
|
|
Loading…
Reference in New Issue
Block a user