Manage Zero only in manager (#970)
This commit is contained in:
parent
2118a4242b
commit
2250202fa9
|
@ -71,17 +71,9 @@ sub getConfByNum {
|
||||||
unless ( %{ $self->currentConf }
|
unless ( %{ $self->currentConf }
|
||||||
and $cfgNum == $self->currentConf->{cfgNum} )
|
and $cfgNum == $self->currentConf->{cfgNum} )
|
||||||
{
|
{
|
||||||
my $tmp;
|
my $tmp = $self->confAcc->getConf(
|
||||||
if ( $cfgNum == 0 ) {
|
{ cfgNum => $cfgNum, raw => 1, noCache => 1, @args } );
|
||||||
require Lemonldap::NG::Manager::Conf::Zero;
|
return undef unless ( $tmp and ref($tmp) and %$tmp );
|
||||||
$tmp = Lemonldap::NG::Manager::Conf::Zero::zeroConf();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$tmp =
|
|
||||||
$self->confAcc->getConf(
|
|
||||||
{ cfgNum => $cfgNum, raw => 1, noCache => 1, @args } );
|
|
||||||
return undef unless ( $tmp and ref($tmp) and %$tmp );
|
|
||||||
}
|
|
||||||
$self->currentConf($tmp);
|
$self->currentConf($tmp);
|
||||||
}
|
}
|
||||||
return $cfgNum;
|
return $cfgNum;
|
||||||
|
|
|
@ -146,12 +146,32 @@ sub prx {
|
||||||
# IV. Upload methods #
|
# IV. Upload methods #
|
||||||
######################
|
######################
|
||||||
|
|
||||||
# In this section, 3 methods:
|
# In this section, 4 methods:
|
||||||
|
# - getConfByNum: override SUPER method to be able to use Zero
|
||||||
# - newConf()
|
# - newConf()
|
||||||
# - newRawConf(): restore a saved conf
|
# - newRawConf(): restore a saved conf
|
||||||
# - applyConf(): called by the 2 previous to prevent other servers that a new
|
# - applyConf(): called by the 2 previous to prevent other servers that a new
|
||||||
# configuration is available
|
# configuration is available
|
||||||
|
|
||||||
|
sub getConfByNum {
|
||||||
|
my ( $self, $cfgNum, @args ) = @_;
|
||||||
|
unless ( %{ $self->currentConf }
|
||||||
|
and $cfgNum == $self->currentConf->{cfgNum} )
|
||||||
|
{
|
||||||
|
my $tmp;
|
||||||
|
if ( $cfgNum == 0 ) {
|
||||||
|
require Lemonldap::NG::Manager::Conf::Zero;
|
||||||
|
$tmp = Lemonldap::NG::Manager::Conf::Zero::zeroConf();
|
||||||
|
$self->currentConf($tmp);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$tmp = $self->SUPER::getConfByNum( $cfgNum, @args );
|
||||||
|
return undef unless (defined $tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $cfgNum;
|
||||||
|
}
|
||||||
|
|
||||||
## @method PSGI-JSON-response newConf($req)
|
## @method PSGI-JSON-response newConf($req)
|
||||||
# Call Lemonldap::NG::Manager::Conf::Parser to parse new configuration and store
|
# Call Lemonldap::NG::Manager::Conf::Parser to parse new configuration and store
|
||||||
# it
|
# it
|
||||||
|
|
Loading…
Reference in New Issue
Block a user