tous les tests utilisent initco
parent
e51f9d89dc
commit
86213e94d0
|
@ -10,30 +10,14 @@ use Data::Dump qw( dump );
|
|||
|
||||
use lib '../';
|
||||
use app::app;
|
||||
|
||||
sub initco {
|
||||
|
||||
my $cfg = new Config::Simple('./config.ini');
|
||||
my $app = app->new( zdir => $cfg->param('zones_path'),
|
||||
dbname => $cfg->param('dbname'),
|
||||
dbhost => $cfg->param('host'),
|
||||
dbport => $cfg->param('port'),
|
||||
dbuser => $cfg->param('user'),
|
||||
dbpass => $cfg->param('passwd'),
|
||||
sgbd => $cfg->param('sgbd'),
|
||||
dnsapp => $cfg->param('dnsapp') );
|
||||
|
||||
$app->init();
|
||||
|
||||
return $app;
|
||||
}
|
||||
use initco;
|
||||
|
||||
if( @ARGV != 0 ) {
|
||||
say "usage : ./get_all_domains.pl";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
my $app = initco();
|
||||
my $app = initco::initco();
|
||||
|
||||
my %domains = $app->get_all_domains();
|
||||
|
||||
|
|
|
@ -10,30 +10,14 @@ use Data::Dump qw( dump );
|
|||
|
||||
use lib '../';
|
||||
use app::app;
|
||||
|
||||
sub initco {
|
||||
|
||||
my $cfg = new Config::Simple('./config.ini');
|
||||
my $app = app->new( zdir => $cfg->param('zones_path'),
|
||||
dbname => $cfg->param('dbname'),
|
||||
dbhost => $cfg->param('host'),
|
||||
dbport => $cfg->param('port'),
|
||||
dbuser => $cfg->param('user'),
|
||||
dbpass => $cfg->param('passwd'),
|
||||
sgbd => $cfg->param('sgbd'),
|
||||
dnsapp => $cfg->param('dnsapp') );
|
||||
|
||||
$app->init();
|
||||
|
||||
return $app;
|
||||
}
|
||||
use initco;
|
||||
|
||||
if( @ARGV != 0 ) {
|
||||
say "usage : ./get_all_domains.pl";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
my $app = initco();
|
||||
my $app = initco::initco();
|
||||
|
||||
my %users = $app->get_all_users();
|
||||
|
||||
|
|
|
@ -10,30 +10,14 @@ use Data::Dump qw( dump );
|
|||
|
||||
use lib '../';
|
||||
use app::app;
|
||||
|
||||
sub initco {
|
||||
|
||||
my $cfg = new Config::Simple('./config.ini');
|
||||
my $app = app->new( zdir => $cfg->param('zones_path'),
|
||||
dbname => $cfg->param('dbname'),
|
||||
dbhost => $cfg->param('host'),
|
||||
dbport => $cfg->param('port'),
|
||||
dbuser => $cfg->param('user'),
|
||||
dbpass => $cfg->param('passwd'),
|
||||
sgbd => $cfg->param('sgbd'),
|
||||
dnsapp => $cfg->param('dnsapp') );
|
||||
|
||||
$app->init();
|
||||
|
||||
return $app;
|
||||
}
|
||||
use initco;
|
||||
|
||||
if( @ARGV < 2) {
|
||||
say "usage : ./auth.pl login mdp";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
my $app = initco();
|
||||
my $app = initco::initco();
|
||||
my ($auth_ok, $user, $isadmin) = $app->auth($ARGV[0], $ARGV[1]);
|
||||
|
||||
if($auth_ok) {
|
||||
|
|
Reference in New Issue