This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues/pull-requests.
2014-01-22 17:01:34 +01:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use v5.14;
|
|
|
|
use autodie;
|
|
|
|
use Modern::Perl;
|
|
|
|
use DNS::ZoneParse;
|
|
|
|
use Config::Simple;
|
|
|
|
use Data::Dump qw( dump );
|
|
|
|
|
|
|
|
use lib '../';
|
|
|
|
use app::app;
|
2014-01-25 17:35:42 +01:00
|
|
|
use initco;
|
2014-01-22 17:01:34 +01:00
|
|
|
|
|
|
|
if( @ARGV < 2) {
|
|
|
|
say "usage : ./auth.pl login mdp";
|
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
|
2014-01-25 17:35:42 +01:00
|
|
|
my $app = initco::initco();
|
2014-01-22 17:01:34 +01:00
|
|
|
my ($auth_ok, $user, $isadmin) = $app->auth($ARGV[0], $ARGV[1]);
|
|
|
|
|
|
|
|
if($auth_ok) {
|
|
|
|
say "auth $auth_ok";
|
|
|
|
say "isadmin $isadmin";
|
|
|
|
}
|
|
|
|
|
|
|
|
my ($success, $domains) = $app->get_domains( $ARGV[0] );
|
|
|
|
|
|
|
|
say "success $success";
|
|
|
|
dump($domains);
|
|
|
|
|
|
|
|
#if( $domains ) {
|
|
|
|
# if( scalar(@$domains) != 0) {
|
|
|
|
# say join ", ", @{$domains};
|
|
|
|
# }
|
|
|
|
# else {
|
|
|
|
# say "tableau vide";
|
|
|
|
# }
|
|
|
|
#}
|
|
|
|
#else {
|
|
|
|
# say "domains undef";
|
|
|
|
#}
|