diff --git a/web/add/mail/index.php b/web/add/mail/index.php new file mode 100644 index 00000000..d5f24c3e --- /dev/null +++ b/web/add/mail/index.php @@ -0,0 +1,135 @@ + $error) { + if ( $i == 0 ) { + $error_msg = $error; + } else { + $error_msg = $error_msg.", ".$error; + } + } + $_SESSION['error_msg'] = "Error: field ".$error_msg." can not be blank."; + } else { + + // Add mail domain + exec (VESTA_CMD."v_add_mail_domain ".$user." ".$v_domain." ".$v_antispam." ".$v_antivirus." ".$v_dkim, $output, $return_var); + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } + unset($output); + + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = "OK: domain ".$_POST[v_domain]." has been created successfully."; + unset($v_domain); + } + } + } + + + // Mail Account + if (!empty($_POST['ok_acc'])) { + // Check input + if (empty($_POST['v_domain'])) $errors[] = 'domain'; + if (empty($_POST['v_account'])) $errors[] = 'account'; + if (empty($_POST['v_password'])) $errors[] = 'password'; + + // Protect input + $v_domain = escapeshellarg($_POST['v_domain']); + $v_account = escapeshellarg($_POST['v_account']); + $v_password = escapeshellarg($_POST['v_password']); + $v_quota = escapeshellarg($_POST['v_quota']); + if (empty($_POST['v_quota'])) $v_quota = 0; + + // Check for errors + if (!empty($errors[0])) { + foreach ($errors as $i => $error) { + if ( $i == 0 ) { + $error_msg = $error; + } else { + $error_msg = $error_msg.", ".$error; + } + } + $_SESSION['error_msg'] = "Error: field ".$error_msg." can not be blank."; + } else { + // Add Mail Account + exec (VESTA_CMD."v_add_mail_account ".$user." ".$v_domain." ".$v_account." ".$v_password." ".$v_quota, $output, $return_var); + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } + unset($output); + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = "OK: account ".$_POST['v_account']." has been created successfully."; + unset($v_account); + unset($v_password); + } + } + } + + + if ((empty($_GET['domain'])) && (empty($_POST['domain']))) { + $v_domain = $_GET['domain']; + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_add_mail.html'); + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_mail.html'); + unset($_SESSION['error_msg']); + unset($_SESSION['ok_msg']); + } else { + $v_domain = $_GET['domain']; + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_add_mail_acc.html'); + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_mail_acc.html'); + unset($_SESSION['error_msg']); + unset($_SESSION['ok_msg']); + } +} + +// Footer +include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/delete/dns/index.php b/web/delete/dns/index.php new file mode 100644 index 00000000..92e0ff5e --- /dev/null +++ b/web/delete/dns/index.php @@ -0,0 +1,69 @@ +', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } else { + $_SESSION['ok_msg'] = "OK: dns domain ".$_GET['domain']." has been deleted."; + unset($v_lname); + } + unset($output); + + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_delete_dns.html'); + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/delete_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_delete_dns_domain_record ".$v_username." ".$v_domain." ".$v_record_id, $output, $return_var); + if ($return_var != 0) { + $error = implode('
', $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 deleted."; + unset($v_lname); + } + unset($output); + + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_delete_dns_rec.html'); + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/delete_dns_rec.html'); + unset($_SESSION['error_msg']); + unset($_SESSION['ok_msg']); + } + +} + +// Footer +include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/templates/admin/add_mail.html b/web/templates/admin/add_mail.html new file mode 100644 index 00000000..fdd48b2d --- /dev/null +++ b/web/templates/admin/add_mail.html @@ -0,0 +1,29 @@ + + + + + +
+ + +
+
+ + +
+ + + + + + + + + + +
Domain
AntiSpam Support
>
AntiVirus Support
>
DKIM Support
>
+ + +
+
diff --git a/web/templates/admin/add_mail_acc.html b/web/templates/admin/add_mail_acc.html new file mode 100644 index 00000000..fd523dcf --- /dev/null +++ b/web/templates/admin/add_mail_acc.html @@ -0,0 +1,43 @@ + + + + + + + + +
+ + +
+
+ + +
+ + + + + + + +
Domain
Account
Password generate
+
Quota (optional)
+ + +
+
diff --git a/web/templates/admin/delete_dns.html b/web/templates/admin/delete_dns.html new file mode 100644 index 00000000..c87840fb --- /dev/null +++ b/web/templates/admin/delete_dns.html @@ -0,0 +1,26 @@ + + + + + +
+ + +
+
+ + +
+ + + + + + +
+
+ +
+
+
+
diff --git a/web/templates/admin/delete_dns_rec.html b/web/templates/admin/delete_dns_rec.html new file mode 100644 index 00000000..77e35aee --- /dev/null +++ b/web/templates/admin/delete_dns_rec.html @@ -0,0 +1,26 @@ + + + + + +
+ + +
+
+ + +
+ + + + + + +
+
+ +
+
+
+
diff --git a/web/templates/admin/delete_user.html b/web/templates/admin/delete_user.html index d6328b40..243a65ca 100644 --- a/web/templates/admin/delete_user.html +++ b/web/templates/admin/delete_user.html @@ -14,7 +14,7 @@
- +
diff --git a/web/templates/admin/delete_web.html b/web/templates/admin/delete_web.html index 9a845382..60cfed35 100644 --- a/web/templates/admin/delete_web.html +++ b/web/templates/admin/delete_web.html @@ -14,7 +14,7 @@
- +
diff --git a/web/templates/admin/list_dns.html b/web/templates/admin/list_dns.html index 2c7b00e7..edb6fce4 100644 --- a/web/templates/admin/list_dns.html +++ b/web/templates/admin/list_dns.html @@ -73,9 +73,14 @@ foreach ($data as $key => $value) {

Are you sure you want to domain?

- delete + + + delete +
+

Are you sure you want to delete domain?

+
+ - diff --git a/web/templates/admin/menu_add_mail.html b/web/templates/admin/menu_add_mail.html new file mode 100644 index 00000000..33e18549 --- /dev/null +++ b/web/templates/admin/menu_add_mail.html @@ -0,0 +1,15 @@ +
+ + + + diff --git a/web/templates/admin/menu_add_mail_acc.html b/web/templates/admin/menu_add_mail_acc.html new file mode 100644 index 00000000..5664e748 --- /dev/null +++ b/web/templates/admin/menu_add_mail_acc.html @@ -0,0 +1,15 @@ + + + + + diff --git a/web/templates/admin/menu_delete_dns.html b/web/templates/admin/menu_delete_dns.html new file mode 100644 index 00000000..199a7e01 --- /dev/null +++ b/web/templates/admin/menu_delete_dns.html @@ -0,0 +1,15 @@ + + + + + diff --git a/web/templates/admin/menu_delete_dns_rec.html b/web/templates/admin/menu_delete_dns_rec.html new file mode 100644 index 00000000..199a7e01 --- /dev/null +++ b/web/templates/admin/menu_delete_dns_rec.html @@ -0,0 +1,15 @@ + + + + + diff --git a/web/templates/admin/menu_mail_acc.html b/web/templates/admin/menu_mail_acc.html index 25ee8506..7ad5bad8 100644 --- a/web/templates/admin/menu_mail_acc.html +++ b/web/templates/admin/menu_mail_acc.html @@ -1,7 +1,7 @@