suspend dns record page

This commit is contained in:
Serghey Rodin 2012-06-14 17:25:38 +03:00
commit b306202a80
19 changed files with 583 additions and 28 deletions

View file

@ -46,6 +46,7 @@ sed -i "/\/$domain.db\"/d" /etc/named.conf
# Adding suspend in config
update_object_value 'dns' 'DOMAIN' "$domain" '$SUSPENDED' 'yes'
sed -i "s/SUSPENDED='no'/SUSPENDED='yes'/g" $USER_DATA/dns/$domain.conf
increase_user_value "$user" '$SUSPENDED_DNS'
# Restart named

71
bin/v_suspend_dns_domain_record Executable file
View file

@ -0,0 +1,71 @@
#!/bin/bash
# info: suspend dns domain record
# options: user domain id [restart]
#
# The function suspends a certain domain record.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
id=$3
restart="$4"
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '3' "$#" 'user domain id [restart]'
validate_format 'user' 'domain' 'id'
is_system_enabled "$DNS_SYSTEM"
is_object_valid 'user' 'USER' "$user"
is_object_valid 'dns' 'DOMAIN' "$domain"
is_object_unsuspended 'dns' 'DOMAIN' "$domain"
is_object_valid "dns/$domain" 'ID' "$id"
is_object_unsuspended "dns/$domain" 'ID' "$id"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
line=$(grep "ID='$id'" $USER_DATA/dns/$domain.conf)
eval $line
sed -i "/^ID='$id'/d" $USER_DATA/dns/$domain.conf
# Adding record
dns_rec="ID='$id' RECORD='$RECORD' TYPE='$TYPE' PRIORITY='$PRIORITY'"
dns_rec="$dns_rec VALUE='$VALUE' SUSPENDED='yes' TIME='$TIME' DATE='$DATE'"
echo "$dns_rec" >> $USER_DATA/dns/$domain.conf
# Sorting records
sort_dns_records
# Updating zone
update_domain_zone
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v_restart_dns "$EVENT"
fi
# Logging
log_event "$OK" "$EVENT"
exit

View file

@ -47,6 +47,8 @@ echo "zone \"$domain\" { type master; file \"/etc/namedb/$domain.db\"; };" \
# Unsuspending domain in config
update_object_value 'dns' 'DOMAIN' "$domain" '$SUSPENDED' 'no'
decrease_user_value "$user" '$SUSPENDED_DNS'
sed -i "s/SUSPENDED='yes'/SUSPENDED='no'/g" $USER_DATA/dns/$domain.conf
# Restart named
if [ "$restart" != 'no' ]; then

View file

@ -0,0 +1,70 @@
#!/bin/bash
# info: unsuspend dns domain record
# options: user domain id [restart]
#
# The function unsuspends a certain domain record.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain_idn=$(idn -t --quiet -a "$domain")
id=$3
restart="$4"
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '3' "$#" 'user domain id [restart]'
validate_format 'user' 'domain' 'id'
is_system_enabled "$DNS_SYSTEM"
is_object_valid 'user' 'USER' "$user"
is_object_valid 'dns' 'DOMAIN' "$domain"
is_object_unsuspended 'dns' 'DOMAIN' "$domain"
is_object_valid "dns/$domain" 'ID' "$id"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
line=$(grep "ID='$id'" $USER_DATA/dns/$domain.conf)
eval $line
sed -i "/^ID='$id'/d" $USER_DATA/dns/$domain.conf
# Adding record
dns_rec="ID='$id' RECORD='$RECORD' TYPE='$TYPE' PRIORITY='$PRIORITY'"
dns_rec="$dns_rec VALUE='$VALUE' SUSPENDED='no' TIME='$TIME' DATE='$DATE'"
echo "$dns_rec" >> $USER_DATA/dns/$domain.conf
# Sorting records
sort_dns_records
# Updating zone
update_domain_zone
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v_restart_dns "$EVENT"
fi
# Logging
log_event "$OK" "$EVENT"
exit

View file

@ -1,9 +1,9 @@
ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='4' RECORD='mail' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='5' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='6' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='7' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='8' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='mail' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='9' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='4' RECORD='mail' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='5' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='6' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='7' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='8' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='mail' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='9' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'

View file

@ -1,14 +1,14 @@
ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='4' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='5' RECORD='localhost' TYPE='A' PRIORITY='' VALUE='127.0.0.1' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='6' RECORD='mail' TYPE='CNAME' PRIORITY='' VALUE='ghs.google.com.' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='7' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='8' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='9' RECORD='@' TYPE='MX' PRIORITY='1' VALUE='ASPMX.L.GOOGLE.COM.' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='10' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT1.ASPMX.L.GOOGLE.COM.' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='11' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT2.ASPMX.L.GOOGLE.COM.' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='12' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ASPMX2.GOOGLEMAIL.COM.' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='13' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ASPMX3.GOOGLEMAIL.COM.' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='14' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPEND='no' TIME='%time%' DATE='%date%'
ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='4' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='5' RECORD='localhost' TYPE='A' PRIORITY='' VALUE='127.0.0.1' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='6' RECORD='mail' TYPE='CNAME' PRIORITY='' VALUE='ghs.google.com.' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='7' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='8' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='9' RECORD='@' TYPE='MX' PRIORITY='1' VALUE='ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='10' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT1.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='11' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT2.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='12' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ASPMX2.GOOGLEMAIL.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='13' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ASPMX3.GOOGLEMAIL.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
ID='14' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'

View file

@ -114,7 +114,9 @@ update_domain_zone() {
done
RECORD=$(idn --quiet -a -t "$RECORD")
eval echo -e "\"$fields\""|sed -e "s/%quote%/'/g" >> $conf
if [ "$SUSPENDED" != 'yes' ]; then
eval echo -e "\"$fields\""|sed -e "s/%quote%/'/g" >> $conf
fi
done < $USER_DATA/dns/$domain.conf
}

69
web/suspend/dns/index.php Normal file
View file

@ -0,0 +1,69 @@
<?php
// Init
//error_reporting(NULL);
ob_start();
session_start();
$TAB = 'DNS';
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Are you admin?
if ($_SESSION['user'] == 'admin') {
// Cancel
if (!empty($_POST['back'])) {
header("Location: /list/dns/");
}
// DNS domain
if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
$v_username = escapeshellarg($user);
$v_domain = escapeshellarg($_GET['domain']);
exec (VESTA_CMD."v_suspend_dns_domain ".$v_username." ".$v_domain, $output, $return_var);
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = 'Error: vesta did not return any output.';
$_SESSION['error_msg'] = $error;
} else {
$_SESSION['ok_msg'] = "OK: dns domain <b>".$_GET['domain']."</b> has been suspended.";
unset($v_lname);
}
unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_suspend_dns.html');
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/suspend_dns.html');
unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']);
}
// DNS record
if ((!empty($_GET['domain'])) && (!empty($_GET['record_id']))) {
$v_username = escapeshellarg($user);
$v_domain = escapeshellarg($_GET['domain']);
$v_record_id = escapeshellarg($_GET['record_id']);
exec (VESTA_CMD."v_suspend_dns_domain_record ".$v_username." ".$v_domain." ".$v_record_id, $output, $return_var);
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = 'Error: vesta did not return any output.';
$_SESSION['error_msg'] = $error;
} else {
$_SESSION['ok_msg'] = "OK: dns record has been suspended.";
unset($v_lname);
}
unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_suspend_dns_rec.html');
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/suspend_dns_rec.html');
unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']);
}
}
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

View file

@ -5,12 +5,51 @@ foreach ($data as $key => $value) {
++$i;
if ($data[$key]['SUSPENDED'] == 'yes') {
$status = 'suspended';
$spnd_action = 'ususpend' ;
$spnd_action = 'unsuspend' ;
} else {
$status = 'active';
$spnd_action = 'suspend' ;
}
?>
<script type="text/javascript">
$(function(){
$('#<?php echo $spnd_action ?>_dialog_<?php echo "$i" ?>').dialog({
modal: true,
autoOpen: false,
width: 360,
buttons: {
"Ok": function(event, ui) {
location.href = '/<?php echo $spnd_action ?>/dns/?domain=<?php echo "$key" ?>';
},
"Cancel": function() {
$(this).dialog("close");
}
}
});
$('#<?php echo $spnd_action ?>_link_<?php echo "$i" ?>').click(function(){
$('#<?php echo $spnd_action ?>_dialog_<?php echo "$i" ?>').dialog('open');
return false;
});
$('#delete_dialog_<?php echo "$i" ?>').dialog({
modal: true,
autoOpen: false,
width: 360,
buttons: {
"Ok": function(event, ui) {
location.href = '/delete/dns/?domain=<?php echo "$key" ?>';
},
"Cancel": function() {
$(this).dialog("close");
}
}
});
$('#delete_link_<?php echo "$i" ?>').click(function(){
$('#delete_dialog_<?php echo "$i" ?>').dialog('open');
return false;
});
});
</script>
<tr class="data-row">
<td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
@ -27,7 +66,13 @@ foreach ($data as $key => $value) {
<td class="data-controls" width="96px"><img src="/images/more.png" width="8px" height="8px"><a href="/list/dns/?domain=<?php echo $key ?>"> list records</a></td>
<td class="data-controls" width="92px"><img src="/images/add.png" width="8px" height="8px"><a href="/add/dns/?domain=<?php echo $key ?>"> add record</a></td>
<td class="data-controls" width="50px"><img src="/images/edit.png" width="8px" height="8px"><a href="/edit/dns/?domain=<?php echo $key ?>"> edit</a></td>
<td class="data-controls" width="80px"><img src="/images/suspend.png" width="7px" height="8px"><a href="#"> <?php echo $spnd_action ?></a></td>
<td class="data-controls" width="80px">
<img src="/images/suspend.png" width="7px" height="8px">
<a href="#" id="<?php echo $spnd_action ?>_link_<?php echo "$i" ?>"> <?php echo $spnd_action ?></a>
<div id="<?php echo $spnd_action ?>_dialog_<?php echo "$i" ?>" title="Confirmation">
<p class="counter-value">Are you sure you want to <?php echo $spnd_action ?> <span style="color: #34536A;"><b><?php echo "$key" ?></b></span> domain?</p>
</div>
</td>
<td class="data-controls" width="70px"><img src="/images/delete.png" width="7px" height="7px"><a href="#"> delete</a></td>
</tr></table>

View file

@ -5,12 +5,51 @@ foreach ($data as $key => $value) {
++$i;
if ($data[$key]['SUSPENDED'] == 'yes') {
$status = 'suspended';
$spnd_action = 'ususpend' ;
$spnd_action = 'unsuspend' ;
} else {
$status = 'active';
$spnd_action = 'suspend' ;
}
?>
<script type="text/javascript">
$(function(){
$('#<?php echo $spnd_action ?>_dialog_<?php echo "$i" ?>').dialog({
modal: true,
autoOpen: false,
width: 360,
buttons: {
"Ok": function(event, ui) {
location.href = '/<?php echo $spnd_action ?>/dns/?domain=<?php echo $_GET['domain'] ?>&record_id=<?php echo $data[$key]['ID'] ?>';
},
"Cancel": function() {
$(this).dialog("close");
}
}
});
$('#<?php echo $spnd_action ?>_link_<?php echo "$i" ?>').click(function(){
$('#<?php echo $spnd_action ?>_dialog_<?php echo "$i" ?>').dialog('open');
return false;
});
$('#delete_dialog_<?php echo "$i" ?>').dialog({
modal: true,
autoOpen: false,
width: 360,
buttons: {
"Ok": function(event, ui) {
location.href = '/delete/dns/?domain=<?php echo $_GET['domain'] ?>&record_id=<?php echo $data[$key]['ID'] ?>';
},
"Cancel": function() {
$(this).dialog("close");
}
}
});
$('#delete_link_<?php echo "$i" ?>').click(function(){
$('#delete_dialog_<?php echo "$i" ?>').dialog('open');
return false;
});
});
</script>
<tr class="data-row">
<td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
@ -24,7 +63,14 @@ foreach ($data as $key => $value) {
<table width="830px"><tr>
<td></td>
<td class="data-controls" width="50px"><img src="/images/edit.png" width="8px" height="8px"><a href="/edit/dns/?domain=<?php echo $_GET['domain'] ?>&record_id=<?php echo $data[$key]['ID'] ?>"> edit</a></td>
<td class="data-controls" width="80px"><img src="/images/suspend.png" width="7px" height="8px"><a href="/<?php echo $spnd_action ?>/dns/?domain=<?php echo $_GET['domain'] ?>&record_id=<?php echo $data[$key]['ID'] ?>"> <?php echo $spnd_action ?></a></td>
<td class="data-controls" width="80px">
<img src="/images/suspend.png" width="7px" height="8px">
<a href="#" id="<?php echo $spnd_action ?>_link_<?php echo "$i" ?>"> <?php echo $spnd_action ?></a>
<div id="<?php echo $spnd_action ?>_dialog_<?php echo "$i" ?>" title="Confirmation">
<p class="counter-value">Are you sure you want to <?php echo $spnd_action ?> <span style="color: #34536A;"><b><?php echo $data[$key]['RECORD'] ?></b></span> record?</p>
</div>
</td>
<td class="data-controls" width="70px"><img src="/images/delete.png" width="7px" height="7px"><a href="/delete/dns/?domain=<?php echo $_GET['domain'] ?>&record_id=<?php echo $data[$key]['ID'] ?>"> delete</a></td>
</tr></table>

View file

@ -0,0 +1,15 @@
<table class="sub-menu">
<tr>
<td style="padding: 50px 2px 38px 153px;" >
<?php
if (!empty($_SESSION['error_msg'])) {
echo "<a class=\"add-error\">".$_SESSION['error_msg']."</a>";
} else {
if (!empty($_SESSION['ok_msg'])) {
echo "<a class=\"add-ok\"> ".$_SESSION['ok_msg']."</a>";
}
}
?>
</td>
</tr>
</table>

View file

@ -0,0 +1,15 @@
<table class="sub-menu">
<tr>
<td style="padding: 50px 2px 38px 153px;" >
<?php
if (!empty($_SESSION['error_msg'])) {
echo "<a class=\"add-error\">".$_SESSION['error_msg']."</a>";
} else {
if (!empty($_SESSION['ok_msg'])) {
echo "<a class=\"add-ok\"> ".$_SESSION['ok_msg']."</a>";
}
}
?>
</td>
</tr>
</table>

View file

@ -0,0 +1,15 @@
<table class="sub-menu">
<tr>
<td style="padding: 50px 2px 38px 153px;" >
<?php
if (!empty($_SESSION['error_msg'])) {
echo "<a class=\"add-error\">".$_SESSION['error_msg']."</a>";
} else {
if (!empty($_SESSION['ok_msg'])) {
echo "<a class=\"add-ok\"> ".$_SESSION['ok_msg']."</a>";
}
}
?>
</td>
</tr>
</table>

View file

@ -0,0 +1,15 @@
<table class="sub-menu">
<tr>
<td style="padding: 50px 2px 38px 153px;" >
<?php
if (!empty($_SESSION['error_msg'])) {
echo "<a class=\"add-error\">".$_SESSION['error_msg']."</a>";
} else {
if (!empty($_SESSION['ok_msg'])) {
echo "<a class=\"add-ok\"> ".$_SESSION['ok_msg']."</a>";
}
}
?>
</td>
</tr>
</table>

View file

@ -0,0 +1,30 @@
<table class='data'>
<tr class="data-add">
<td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
<table class="data-col1">
<tr><td style="padding: 18 0 4 18;"></td></tr>
</table>
</td>
<td class="data-dotted" width="830px" style="vertical-align:top;">
<table width="830px"><tr>
<td></td>
</tr></table>
<table class="data-col2" width="830px">
<tr>
<td style="padding: 24px 0 0 0;" width="100px">
<form method="get">
<input type="button" class="add-button" value="List domains" onClick="location.href='/list/dns/'">
</form>
</td>
<td style="padding: 24px 0 0 0;">
<form action="/unsuspend/dns/" method="get">
<input type="hidden" name="domain" value="<?php echo $_GET['domain']?>">
<input type="submit" class="add-button" name="unsuspend" value="Unsuspend <?php echo $_GET['domain']?>">
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>

View file

@ -0,0 +1,31 @@
<table class='data'>
<tr class="data-add">
<td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
<table class="data-col1">
<tr><td style="padding: 18 0 4 18;"></td></tr>
</table>
</td>
<td class="data-dotted" width="830px" style="vertical-align:top;">
<table width="830px"><tr>
<td></td>
</tr></table>
<table class="data-col2" width="830px">
<tr>
<td style="padding: 24px 0 0 0;" width="100px">
<form method="get">
<input type="button" class="add-button" value="List records" onClick="location.href='/list/dns/?domain=<?php echo $_GET['domain']?>'">
</form>
</td>
<td style="padding: 24px 0 0 0;">
<form action="/unsuspend/dns/" method="get">
<input type="hidden" name="domain" value="<?php echo $_GET['domain']?>">
<input type="hidden" name="record_id" value="<?php echo $_GET['record_id']?>">
<input type="submit" class="add-button" name="unsuspend" value="Unsuspend record">
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>

View file

@ -0,0 +1,30 @@
<table class='data'>
<tr class="data-add">
<td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
<table class="data-col1">
<tr><td style="padding: 18 0 4 18;"></td></tr>
</table>
</td>
<td class="data-dotted" width="830px" style="vertical-align:top;">
<table width="830px"><tr>
<td></td>
</tr></table>
<table class="data-col2" width="830px">
<tr>
<td style="padding: 24px 0 0 0;" width="100px">
<form method="get">
<input type="button" class="add-button" value="List domains" onClick="location.href='/list/dns/'">
</form>
</td>
<td style="padding: 24px 0 0 0;">
<form action="/suspend/dns/" method="get">
<input type="hidden" name="domain" value="<?php echo $_GET['domain']?>">
<input type="submit" class="add-button" name="suspend" value="Suspend <?php echo $_GET['domain']?>">
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>

View file

@ -0,0 +1,31 @@
<table class='data'>
<tr class="data-add">
<td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
<table class="data-col1">
<tr><td style="padding: 18 0 4 18;"></td></tr>
</table>
</td>
<td class="data-dotted" width="830px" style="vertical-align:top;">
<table width="830px"><tr>
<td></td>
</tr></table>
<table class="data-col2" width="830px">
<tr>
<td style="padding: 24px 0 0 0;" width="100px">
<form method="get">
<input type="button" class="add-button" value="List records" onClick="location.href='/list/dns/?domain=<?php echo $_GET['domain']?>'">
</form>
</td>
<td style="padding: 24px 0 0 0;">
<form action="/suspend/dns/" method="get">
<input type="hidden" name="domain" value="<?php echo $_GET['domain']?>">
<input type="hidden" name="record_id" value="<?php echo $_GET['record_id']?>">
<input type="submit" class="add-button" name="suspend" value="Suspend record">
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>

View file

@ -0,0 +1,67 @@
<?php
// Init
//error_reporting(NULL);
ob_start();
session_start();
$TAB = 'DNS';
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Header
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
// Panel
top_panel($user,$TAB);
// Are you admin?
if ($_SESSION['user'] == 'admin') {
// Cancel
if (!empty($_POST['back'])) {
header("Location: /list/dns/");
}
// DNS domain
if ((!empty($_GET['domain'])) && (empty($_GET['record_id']))) {
$v_username = escapeshellarg($user);
$v_domain = escapeshellarg($_GET['domain']);
exec (VESTA_CMD."v_unsuspend_dns_domain ".$v_username." ".$v_domain, $output, $return_var);
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = 'Error: vesta did not return any output.';
$_SESSION['error_msg'] = $error;
} else {
$_SESSION['ok_msg'] = "OK: dns domain <b>".$_GET['domain']."</b> has been unsuspended.";
}
unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_unsuspend_dns.html');
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/unsuspend_dns.html');
unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']);
}
// DNS record
if ((!empty($_GET['domain'])) && (!empty($_GET['record_id']))) {
$v_username = escapeshellarg($user);
$v_domain = escapeshellarg($_GET['domain']);
$v_record_id = escapeshellarg($_GET['record_id']);
exec (VESTA_CMD."v_unsuspend_dns_domain_record ".$v_username." ".$v_domain." ".$v_record_id, $output, $return_var);
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = 'Error: vesta did not return any output.';
$_SESSION['error_msg'] = $error;
} else {
$_SESSION['ok_msg'] = "OK: dns record has been unsuspended.";
}
unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_unsuspend_dns_rec.html');
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/unsuspend_dns_rec.html');
unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']);
}
}
// Footer
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');