Merge branch 'features/modEntry' into debug
commit
e24bad43f6
104
app/app.pm
104
app/app.pm
|
@ -168,4 +168,108 @@ sub new_tmp {
|
||||||
$ze->new_tmp();
|
$ze->new_tmp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub _mod_entry {
|
||||||
|
my ($self, $login, $domain, $entryToDelete, $action, $newEntry) = @_;
|
||||||
|
|
||||||
|
my $name = $entryToDelete->{'name'};
|
||||||
|
my $type = $entryToDelete->{'type'};
|
||||||
|
my $ttl = $entryToDelete->{'ttl'};
|
||||||
|
my $host = $entryToDelete->{'host'};
|
||||||
|
my $priority = $entryToDelete->{'priority'};
|
||||||
|
|
||||||
|
my $new_name = $newEntry->{'newname'};
|
||||||
|
my $new_type = $newEntry->{'newtype'};
|
||||||
|
my $new_ttl = $newEntry->{'newttl'};
|
||||||
|
my $new_host = $newEntry->{'newhost'};
|
||||||
|
my $new_priority = $newEntry->{'newpriority'};
|
||||||
|
|
||||||
|
# say "in _mod_entry : $action";
|
||||||
|
# say "in _mod_entry : $new_name";
|
||||||
|
my $zone = $self->get_domain($login , $domain);
|
||||||
|
my $dump = $zone->dump;
|
||||||
|
|
||||||
|
my $record;
|
||||||
|
my $found = 0;
|
||||||
|
|
||||||
|
given( lc $type )
|
||||||
|
{
|
||||||
|
when ('a')
|
||||||
|
{
|
||||||
|
$record = $zone->a;
|
||||||
|
$found = 1;
|
||||||
|
}
|
||||||
|
when ('aaaa')
|
||||||
|
{
|
||||||
|
$record = $zone->aaaa;
|
||||||
|
$found = 1;
|
||||||
|
}
|
||||||
|
when ('cname')
|
||||||
|
{
|
||||||
|
$record = $zone->cname;
|
||||||
|
$found = 1;
|
||||||
|
}
|
||||||
|
when ('ns')
|
||||||
|
{
|
||||||
|
$record = $zone->ns;
|
||||||
|
$found = 1;
|
||||||
|
}
|
||||||
|
when ('mx')
|
||||||
|
{
|
||||||
|
$record = $zone->mx;
|
||||||
|
$found = 1;
|
||||||
|
}
|
||||||
|
when ('ptr')
|
||||||
|
{
|
||||||
|
$record = $zone->ptr;
|
||||||
|
$found = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( $found )
|
||||||
|
{
|
||||||
|
|
||||||
|
foreach my $i ( 0 .. scalar @{$record}-1 )
|
||||||
|
{
|
||||||
|
|
||||||
|
if( $action eq 'del' )
|
||||||
|
{
|
||||||
|
delete $record->[$i]
|
||||||
|
if( $record->[$i]->{'name'} eq $name &&
|
||||||
|
$record->[$i]->{'host'} eq $host &&
|
||||||
|
$record->[$i]->{'ttl'} == $ttl );
|
||||||
|
}
|
||||||
|
if ( $action eq 'mod' )
|
||||||
|
{
|
||||||
|
if( $record->[$i]->{'name'} eq $name &&
|
||||||
|
$record->[$i]->{'host'} eq $host &&
|
||||||
|
$record->[$i]->{'ttl'} == $ttl )
|
||||||
|
{
|
||||||
|
$record->[$i]->{'name'} = $new_name;
|
||||||
|
$record->[$i]->{'host'} = $new_host;
|
||||||
|
$record->[$i]->{'ttl'} = $new_ttl;
|
||||||
|
if( defined $new_priority )
|
||||||
|
{
|
||||||
|
$record->[$i]->{'priority'} = $new_priority
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->update_domain( $login, $zone, $domain );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub delete_entry {
|
||||||
|
my ($self, $login, $domain, $entryToDelete) = @_;
|
||||||
|
$self->_mod_entry( $login, $domain, $entryToDelete, 'del' );
|
||||||
|
}
|
||||||
|
|
||||||
|
sub modify_entry {
|
||||||
|
my ($self, $login, $domain, $entryToDelete, $newEntry) = @_;
|
||||||
|
$self->_mod_entry( $login, $domain, $entryToDelete, 'mod', $newEntry );
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
@ -245,8 +245,8 @@ prefix '/domain' => sub {
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
my $app = initco();
|
my $app = initco();
|
||||||
my ($auth_ok, $user, $isadmin) = $app->auth(param('login'),
|
# my ($auth_ok, $user, $isadmin) = $app->auth(param('login'),
|
||||||
param('password') );
|
# param('password') );
|
||||||
|
|
||||||
my $zone = $app->get_domain(session('login') , param('domain'));
|
my $zone = $app->get_domain(session('login') , param('domain'));
|
||||||
|
|
||||||
|
@ -363,305 +363,286 @@ prefix '/domain' => sub {
|
||||||
else {
|
else {
|
||||||
# Load :domain and search for corresponding data
|
# Load :domain and search for corresponding data
|
||||||
my $app = initco();
|
my $app = initco();
|
||||||
my ($auth_ok, $user, $isadmin) = $app->auth(param('login'),
|
# my ($auth_ok, $user, $isadmin) = $app->auth(param('login'),
|
||||||
param('password') );
|
# param('password') );
|
||||||
|
|
||||||
my $zone = $app->get_domain(session('login') , param('domain'));
|
$app->delete_entry( session('login'),
|
||||||
my $dump = $zone->dump;
|
param('domain'),
|
||||||
|
|
||||||
my $record;
|
|
||||||
my $found = false;
|
|
||||||
|
|
||||||
given( lc param('type') )
|
|
||||||
{
|
|
||||||
when ('a')
|
|
||||||
{
|
{
|
||||||
$record = $zone->a;
|
type => param('type'),
|
||||||
$found = true;
|
name => param('name'),
|
||||||
}
|
host => param('host'),
|
||||||
when ('aaaa')
|
ttl => param('ttl')
|
||||||
{
|
});
|
||||||
$record = $zone->aaaa;
|
|
||||||
$found = true;
|
|
||||||
}
|
|
||||||
when ('cname')
|
|
||||||
{
|
|
||||||
$record = $zone->cname;
|
|
||||||
$found = true;
|
|
||||||
}
|
|
||||||
when ('ns')
|
|
||||||
{
|
|
||||||
$record = $zone->ns;
|
|
||||||
$found = true;
|
|
||||||
}
|
|
||||||
when ('mx')
|
|
||||||
{
|
|
||||||
$record = $zone->mx;
|
|
||||||
$found = true;
|
|
||||||
}
|
|
||||||
when ('ptr')
|
|
||||||
{
|
|
||||||
$record = $zone->ptr;
|
|
||||||
$found = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if( $found )
|
redirect '/domain/details/'. param('domain');
|
||||||
{
|
|
||||||
|
|
||||||
foreach my $i ( 0 .. scalar @{$record}-1 )
|
|
||||||
{
|
|
||||||
|
|
||||||
if( $record->[$i]->{'name'} eq param('name') &&
|
|
||||||
$record->[$i]->{'host'} eq param('host') &&
|
|
||||||
$record->[$i]->{'ttl'} == param('ttl') )
|
|
||||||
{
|
|
||||||
delete $record->[$i];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$app->update_domain( session('login'), $zone, param('domain') );
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
redirect '/domain/details/'. param('domain');
|
get '/mod/:domain/:name/:type/:host/:ttl' => sub {
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
any ['get', 'post'] => '/admin' => sub {
|
unless( session( 'user' ) and defined param('domain') ) {
|
||||||
|
session errmsg => q<Domaine non renseigné.>;
|
||||||
unless( session('login') )
|
redirect get_route;
|
||||||
{
|
|
||||||
redirect '/';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
my $app = initco();
|
|
||||||
my ($auth_ok, $user, $isadmin) = $app->auth(session('login'),
|
|
||||||
session('password') );
|
|
||||||
|
|
||||||
unless ( $auth_ok && $isadmin ) {
|
|
||||||
redirect '/ ';
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
# Load :domain and search for corresponding data
|
||||||
|
my $app = initco();
|
||||||
|
# my ($auth_ok, $user, $isadmin) = $app->auth(param('login'),
|
||||||
|
# param('password') );
|
||||||
|
|
||||||
my %alldomains = $app->get_all_domains;
|
$app->modify_entry( session('login'),
|
||||||
my %allusers = $app->get_all_users;
|
param('domain'),
|
||||||
my ($success, @domains) = $app->get_domains( session('login') );
|
{
|
||||||
|
type => param('type'),
|
||||||
|
name => param('name'),
|
||||||
|
host => param('host'),
|
||||||
|
ttl => param('ttl')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
newtype => param('newtype'),
|
||||||
|
newname => param('newname'),
|
||||||
|
newhost => param('newhost'),
|
||||||
|
newttl => param('newttl'),
|
||||||
|
newpriority => param('newpriority')
|
||||||
|
});
|
||||||
|
|
||||||
|
redirect '/domain/details/'. param('domain');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
any ['get', 'post'] => '/admin' => sub {
|
||||||
|
|
||||||
|
unless( session('login') )
|
||||||
|
{
|
||||||
|
redirect '/';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
my $app = initco();
|
||||||
|
my ($auth_ok, $user, $isadmin) = $app->auth(session('login'),
|
||||||
|
session('password') );
|
||||||
|
|
||||||
|
unless ( $auth_ok && $isadmin ) {
|
||||||
|
redirect '/ ';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
my %alldomains = $app->get_all_domains;
|
||||||
|
my %allusers = $app->get_all_users;
|
||||||
|
my ($success, @domains) = $app->get_domains( session('login') );
|
||||||
|
|
||||||
|
template administration => {
|
||||||
|
login => session('login')
|
||||||
|
, admin => session('admin')
|
||||||
|
, errmsg => get_errmsg
|
||||||
|
, domains => [ @domains ]
|
||||||
|
, alldomains => { %alldomains }
|
||||||
|
, allusers => { %allusers } };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template administration => {
|
|
||||||
login => session('login')
|
|
||||||
, admin => session('admin')
|
|
||||||
, errmsg => get_errmsg
|
|
||||||
, domains => [ @domains ]
|
|
||||||
, alldomains => { %alldomains }
|
|
||||||
, allusers => { %allusers } };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
prefix '/user' => sub {
|
prefix '/user' => sub {
|
||||||
|
|
||||||
get '/logout' => sub {
|
get '/logout' => sub {
|
||||||
session->destroy;
|
session->destroy;
|
||||||
redirect '/';
|
redirect '/';
|
||||||
};
|
};
|
||||||
|
|
||||||
post '/add/' => sub {
|
post '/add/' => sub {
|
||||||
|
|
||||||
if ( param('login') && param('password') )
|
if ( param('login') && param('password') )
|
||||||
{
|
{
|
||||||
|
|
||||||
my $app = initco();
|
my $app = initco();
|
||||||
my ($success) = $app->register_user(param('login')
|
my ($success) = $app->register_user(param('login')
|
||||||
, param('password'));
|
, param('password'));
|
||||||
|
|
||||||
if($success) {
|
if($success) {
|
||||||
session login => param('login');
|
session login => param('login');
|
||||||
session password => param('password');
|
session password => param('password');
|
||||||
redirect '/home';
|
redirect '/home';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
session errmsg => q/Ce pseudo est déjà pris./;
|
session errmsg => q/Ce pseudo est déjà pris./;
|
||||||
redirect '/user/subscribe';
|
redirect '/user/subscribe';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
session errmsg => q/login ou password non renseignés/;
|
session errmsg => q/login ou password non renseignés/;
|
||||||
redirect '/user/subscribe';
|
redirect '/user/subscribe';
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
get '/subscribe' => sub {
|
get '/subscribe' => sub {
|
||||||
|
|
||||||
if( defined session('login') )
|
if( defined session('login') )
|
||||||
{
|
{
|
||||||
redirect '/home';
|
redirect '/home';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
template subscribe => {
|
template subscribe => {
|
||||||
errmsg => get_errmsg
|
errmsg => get_errmsg
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
get '/unsetadmin/:user' => sub {
|
get '/unsetadmin/:user' => sub {
|
||||||
|
|
||||||
unless( defined param('user') )
|
unless( defined param('user') )
|
||||||
{
|
{
|
||||||
|
|
||||||
# TODO ajouter une erreur à afficher
|
# TODO ajouter une erreur à afficher
|
||||||
session errmsg => "L'administrateur n'est pas défini." ;
|
session errmsg => "L'administrateur n'est pas défini." ;
|
||||||
redirect request->referer;
|
redirect request->referer;
|
||||||
|
|
||||||
}
|
}
|
||||||
elsif(! defined session('login') )
|
elsif(! defined session('login') )
|
||||||
{
|
{
|
||||||
|
|
||||||
session errmsg => "Vous n'êtes pas connecté." ;
|
session errmsg => "Vous n'êtes pas connecté." ;
|
||||||
redirect '/';
|
redirect '/';
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
my $app = initco();
|
my $app = initco();
|
||||||
|
|
||||||
my ($auth_ok, $user, $isadmin) = $app->auth(session('login'),
|
my ($auth_ok, $user, $isadmin) = $app->auth(session('login'),
|
||||||
session('password') );
|
session('password') );
|
||||||
|
|
||||||
if ( $auth_ok && $isadmin ) {
|
if ( $auth_ok && $isadmin ) {
|
||||||
$app->set_admin(param('user'), 0);
|
$app->set_admin(param('user'), 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
session errmsg => q/Vous n'êtes pas administrateur./;
|
session errmsg => q/Vous n'êtes pas administrateur./;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( request->referer =~ "/admin" ) {
|
if( request->referer =~ "/admin" ) {
|
||||||
redirect request->referer;
|
redirect request->referer;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
redirect '/';
|
redirect '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
get '/setadmin/:user' => sub {
|
get '/setadmin/:user' => sub {
|
||||||
|
|
||||||
unless( defined param('user') )
|
unless( defined param('user') )
|
||||||
{
|
{
|
||||||
|
|
||||||
# TODO ajouter une erreur à afficher
|
# TODO ajouter une erreur à afficher
|
||||||
session errmsg => "L'utilisateur n'est pas défini." ;
|
session errmsg => "L'utilisateur n'est pas défini." ;
|
||||||
redirect request->referer;
|
redirect request->referer;
|
||||||
|
|
||||||
}
|
}
|
||||||
elsif(! defined session('login') )
|
elsif(! defined session('login') )
|
||||||
{
|
{
|
||||||
|
|
||||||
session errmsg => "Vous n'êtes pas connecté." ;
|
session errmsg => "Vous n'êtes pas connecté." ;
|
||||||
redirect '/';
|
redirect '/';
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
my $app = initco();
|
my $app = initco();
|
||||||
|
|
||||||
my ($auth_ok, $user, $isadmin) = $app->auth(session('login'),
|
my ($auth_ok, $user, $isadmin) = $app->auth(session('login'),
|
||||||
session('password') );
|
session('password') );
|
||||||
|
|
||||||
if ( $auth_ok && $isadmin ) {
|
if ( $auth_ok && $isadmin ) {
|
||||||
$app->set_admin(param('user'), 1);
|
$app->set_admin(param('user'), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( request->referer =~ "/admin" ) {
|
if( request->referer =~ "/admin" ) {
|
||||||
redirect request->referer;
|
redirect request->referer;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
redirect '/';
|
redirect '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
get '/del/:user' => sub {
|
get '/del/:user' => sub {
|
||||||
|
|
||||||
if(defined param 'user') {
|
if(defined param 'user') {
|
||||||
|
|
||||||
my $app = initco();
|
my $app = initco();
|
||||||
|
|
||||||
my ($auth_ok, $user, $isadmin) = $app->auth(session('login'),
|
my ($auth_ok, $user, $isadmin) = $app->auth(session('login'),
|
||||||
session('password') );
|
session('password') );
|
||||||
|
|
||||||
if ( $auth_ok && $isadmin || session('login') eq param('user')) {
|
if ( $auth_ok && $isadmin || session('login') eq param('user')) {
|
||||||
unless ( $app->delete_user(param('user'))) {
|
unless ( $app->delete_user(param('user'))) {
|
||||||
session errmsg => "L'utilisateur "
|
session errmsg => "L'utilisateur "
|
||||||
. param 'user'
|
. param 'user'
|
||||||
. " n'a pas pu être supprimé.";
|
. " n'a pas pu être supprimé.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
session errmsg => q{Le nom d'utilisateur n'est pas renseigné.};
|
session errmsg => q{Le nom d'utilisateur n'est pas renseigné.};
|
||||||
}
|
}
|
||||||
|
|
||||||
if( defined request->referer) {
|
if( defined request->referer) {
|
||||||
redirect request->referer;
|
redirect request->referer;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
redirect '/';
|
redirect '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
post '/login' => sub {
|
post '/login' => sub {
|
||||||
|
|
||||||
# Check if user is already logged
|
# Check if user is already logged
|
||||||
unless ( session('login') )
|
unless ( session('login') )
|
||||||
{
|
{
|
||||||
# Check user login and password
|
# Check user login and password
|
||||||
if ( param('login') && param('password') )
|
if ( param('login') && param('password') )
|
||||||
{
|
{
|
||||||
|
|
||||||
my $app = initco();
|
my $app = initco();
|
||||||
my ($auth_ok, $user, $isadmin) = $app->auth(param('login'),
|
my ($auth_ok, $user, $isadmin) = $app->auth(param('login'),
|
||||||
param('password') );
|
param('password') );
|
||||||
|
|
||||||
if( $auth_ok )
|
if( $auth_ok )
|
||||||
{
|
{
|
||||||
|
|
||||||
session login => param('login');
|
session login => param('login');
|
||||||
# TODO : change password storage…
|
# TODO : change password storage…
|
||||||
session password => param('password');
|
session password => param('password');
|
||||||
session user => freeze( $user );
|
session user => freeze( $user );
|
||||||
session admin => $isadmin;
|
session admin => $isadmin;
|
||||||
|
|
||||||
if( $isadmin ) {
|
if( $isadmin ) {
|
||||||
redirect '/admin';
|
redirect '/admin';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
session errmsg => q<Impossible de se connecter (login ou mot de passe incorrect).>;
|
session errmsg => q<Impossible de se connecter (login ou mot de passe incorrect).>;
|
||||||
redirect '/';
|
redirect '/';
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
redirect '/home';
|
redirect '/home';
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,66 +26,84 @@
|
||||||
|
|
||||||
<% FOREACH address in ns %>
|
<% FOREACH address in ns %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><% address.name %></td>
|
<form action='/domain/mod/<%domain%>/<%address.name%>/NS/<%address.host%>/<%address.ttl%>'>
|
||||||
|
<td><input type='text' name='newname' class="form-control" value='<% address.name %>'></input></td>
|
||||||
<td><% address.class %></td>
|
<td><% address.class %></td>
|
||||||
<td>NS</td>
|
<td>NS</td>
|
||||||
<td><% address.host %></td>
|
<td><input type='text' name='newhost' class="form-control" value='<% address.host %>'/></td>
|
||||||
<td><% address.ttl %></td>
|
<td><input type='number' name='newttl' class="form-control" value='<% address.ttl %>'/></td>
|
||||||
|
<td><input type='submit' id='submit' class="btn btn-success btn-xs" value='✔' />
|
||||||
|
</form>
|
||||||
<td><button type="button" class="btn btn-primary btn-danger btn-xs" onclick="location.href='http://'+location.host+'/domain/del/<% domain %>/<% address.name %>/NS/<% address.host %>/<% address.ttl %>';">✘</button></td>
|
<td><button type="button" class="btn btn-primary btn-danger btn-xs" onclick="location.href='http://'+location.host+'/domain/del/<% domain %>/<% address.name %>/NS/<% address.host %>/<% address.ttl %>';">✘</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% END %>
|
<% END %>
|
||||||
|
|
||||||
<% FOREACH address in a %>
|
<% FOREACH address in a %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><% address.name %></td>
|
<form action='/domain/mod/<%domain%>/<%address.name%>/A/<%address.host%>/<%address.ttl%>'>
|
||||||
|
<td><input type='text' name='newname' class="form-control" value='<% address.name %>'/></td>
|
||||||
<td><% address.class %></td>
|
<td><% address.class %></td>
|
||||||
<td>A</td>
|
<td>A</td>
|
||||||
<td><% address.host %></td>
|
<td><input type='text' name='newhost' class="form-control" value='<% address.host %>'/></td>
|
||||||
<td><% address.ttl %></td>
|
<td><input type='number' name='newttl' class="form-control" value='<% address.ttl %>'/></td>
|
||||||
|
<td><input type='submit' id='submit' class="btn btn-success btn-xs" value='✔' />
|
||||||
|
</form>
|
||||||
<td><button type="button" class="btn btn-primary btn-danger btn-xs" onclick="location.href='http://'+location.host+'/domain/del/<% domain %>/<% address.name %>/A/<% address.host %>/<% address.ttl %>';">✘</button></td>
|
<td><button type="button" class="btn btn-primary btn-danger btn-xs" onclick="location.href='http://'+location.host+'/domain/del/<% domain %>/<% address.name %>/A/<% address.host %>/<% address.ttl %>';">✘</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% END %>
|
<% END %>
|
||||||
|
|
||||||
<% FOREACH address in aaaa %>
|
<% FOREACH address in aaaa %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><% address.name %></td>
|
<form action='/domain/mod/<%domain%>/<%address.name%>/AAAA/<%address.host%>/<%address.ttl%>'>
|
||||||
|
<td><input type='text' name='newname' class="form-control" value='<% address.name %>'/></td>
|
||||||
<td><% address.class %></td>
|
<td><% address.class %></td>
|
||||||
<td>AAAA</td>
|
<td>AAAA</td>
|
||||||
<td><% address.host %></td>
|
<td><input type='text' name='newhost' class="form-control" value='<% address.host %>'/></td>
|
||||||
<td><% address.ttl %></td>
|
<td><input type='number' name='newttl' class="form-control" value='<% address.ttl %>'/></td>
|
||||||
|
<td><input type='submit' id='submit' class="btn btn-success btn-xs" value='✔' />
|
||||||
|
</form>
|
||||||
<td><button type="button" class="btn btn-primary btn-danger btn-xs" onclick="location.href='http://'+location.host+'/domain/del/<% domain %>/<% address.name %>/AAAA/<% address.host %>/<% address.ttl %>';">✘</button></td>
|
<td><button type="button" class="btn btn-primary btn-danger btn-xs" onclick="location.href='http://'+location.host+'/domain/del/<% domain %>/<% address.name %>/AAAA/<% address.host %>/<% address.ttl %>';">✘</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% END %>
|
<% END %>
|
||||||
|
|
||||||
<% FOREACH address in cname %>
|
<% FOREACH address in cname %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><% address.name %></td>
|
<form action='/domain/mod/<%domain%>/<%address.name%>/CNAME/<%address.host%>/<%address.ttl%>'>
|
||||||
|
<td><input type='text' name='newname' class="form-control" value='<% address.name %>'/></td>
|
||||||
<td><% address.class %></td>
|
<td><% address.class %></td>
|
||||||
<td>CNAME</td>
|
<td>CNAME</td>
|
||||||
<td><% address.host %></td>
|
<td><input type='text' name='newhost' class="form-control" value='<% address.host %>'/></td>
|
||||||
<td><% address.ttl %></td>
|
<td><input type='number' name='newttl' class="form-control" value='<% address.ttl %>'/></td>
|
||||||
|
<td><input type='submit' id='submit' class="btn btn-success btn-xs" value='✔' />
|
||||||
|
</form>
|
||||||
<td><button type="button" class="btn btn-primary btn-danger btn-xs" onclick="location.href='http://'+location.host+'/domain/del/<% domain %>/<% address.name %>/CNAME/<% address.host %>/<% address.ttl %>';">✘</button></td>
|
<td><button type="button" class="btn btn-primary btn-danger btn-xs" onclick="location.href='http://'+location.host+'/domain/del/<% domain %>/<% address.name %>/CNAME/<% address.host %>/<% address.ttl %>';">✘</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% END %>
|
<% END %>
|
||||||
|
|
||||||
<% FOREACH address in ptr %>
|
<% FOREACH address in ptr %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><% address.name %></td>
|
<form action='/domain/mod/<%domain%>/<%address.name%>/PTR/<%address.host%>/<%address.ttl%>'>
|
||||||
|
<td><input type='text' name='newname' class="form-control" value='<% address.name %>'/></td>
|
||||||
<td><% address.class %></td>
|
<td><% address.class %></td>
|
||||||
<td>PTR</td>
|
<td>PTR</td>
|
||||||
<td><% address.host %></td>
|
<td><input type='text' name='newhost' class="form-control" value='<% address.host %>'/></td>
|
||||||
<td><% address.ttl %></td>
|
<td><input type='number' name='newttl' class="form-control" value='<% address.ttl %>'/></td>
|
||||||
|
<td><input type='submit' id='submit' class="btn btn-success btn-xs" value='✔' />
|
||||||
|
</form>
|
||||||
<td><button type="button" class="btn btn-primary btn-danger btn-xs" onclick="location.href='http://'+location.host+'/domain/del/<% domain %>/<% address.name %>/PTR/<% address.host %>/<% address.ttl %>';">✘</button></td>
|
<td><button type="button" class="btn btn-primary btn-danger btn-xs" onclick="location.href='http://'+location.host+'/domain/del/<% domain %>/<% address.name %>/PTR/<% address.host %>/<% address.ttl %>';">✘</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% END %>
|
<% END %>
|
||||||
|
|
||||||
<% FOREACH address in mx %>
|
<% FOREACH address in mx %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><% address.name %></td>
|
<form action='/domain/mod/<%domain%>/<%address.name%>/MX/<%address.host%>/<%address.ttl%>'>
|
||||||
|
<td><input type='text' name='newname' class="form-control" value='<% address.name %>'/></td>
|
||||||
<td><% address.class %></td>
|
<td><% address.class %></td>
|
||||||
<td>MX</td>
|
<td>MX</td>
|
||||||
<td><% address.host %> (<% address.priority %>)</td>
|
<td><input type='text' name='newhost' class="form-control" value='<% address.host %>'/><input type='number' name='newpriority' class="form-control" value='<%address.priority%>'/></td>
|
||||||
<td><% address.ttl %></td>
|
<td><input type='number' name='newttl' class="form-control" value='<% address.ttl %>'/></td>
|
||||||
|
<td><input type='submit' id='submit' class="btn btn-success btn-xs" value='✔' />
|
||||||
|
</form>
|
||||||
<td><button type="button" class="btn btn-primary btn-danger btn-xs" onclick="location.href='http://'+location.host+'/domain/del/<% domain %>/<% address.name %>/MX/<% address.host %>/<% address.ttl %>';">✘</button></td>
|
<td><button type="button" class="btn btn-primary btn-danger btn-xs" onclick="location.href='http://'+location.host+'/domain/del/<% domain %>/<% address.name %>/MX/<% address.host %>/<% address.ttl %>';">✘</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% END %>
|
<% END %>
|
||||||
|
|
Loading…
Reference in New Issue