diff --git a/admin/add-domain.php b/admin/add-domain.php deleted file mode 100644 index f856144..0000000 --- a/admin/add-domain.php +++ /dev/null @@ -1,91 +0,0 @@ - -// Copyright (c) 2022 High5! -// License Info: LICENSE.TXT -// -// File: create-domain.php -// -// Template File: admin_create-domain.tpl -// -// Template Variables: -// -// tMessage -// tDomain -// tDescription -// tAliases -// tMailboxes -// tMaxquota -// tDefaultaliases -// -// Form POST \ GET Variables: -// -// fDomain -// fDescription -// fAliases -// fMailboxes -// fMaxquota -// fDefaultaliases -// -require_once '../functions.inc.php'; -include '../languages/' . check_language() . '.lang'; - -$list_domains = list_domains(); - -if ($_SERVER['REQUEST_METHOD'] == "GET") { - $action = filter_input(INPUT_GET, 'action', FILTER_DEFAULT) ?? 'new'; - if ($action == 'edit') { - $domain = filter_input(INPUT_GET, 'domain', FILTER_VALIDATE_DOMAIN); - $domain_key = array_search($domain, array_column($list_domains, 'domain')); - $description = $list_domains[$domain_key]['description']; - $aliases = $list_domains[$domain_key]['aliases']; - $mailboxes = $list_domains[$domain_key]['mailboxes']; - } -} - -if ($_SERVER['REQUEST_METHOD'] == "POST") { - $action = filter_input(INPUT_GET, 'action', FILTER_DEFAULT) ?? 'new'; - $domain = strtolower(filter_input(INPUT_POST, 'domain', FILTER_VALIDATE_DOMAIN)); - $description = filter_input(INPUT_POST, 'description', FILTER_CALLBACK, array('options' => 'htmlspecialchars')); - $aliases = filter_input(INPUT_POST, 'aliases', FILTER_VALIDATE_INT); - $mailboxes = filter_input(INPUT_POST, 'mailboxes', FILTER_VALIDATE_INT); - - if (!in_array($domain, array_column($list_domains, 'domain'))) { - try { - $dbh = connect_db(); - $sth = $dbh->prepare("INSERT INTO domain (domain,description,aliases,mailboxes,created,modified) VALUES (?,?,?,?,NOW(),NOW())"); - $sth->bindParam(1, $domain, PDO::PARAM_STR); - $sth->bindParam(2, $description, PDO::PARAM_STR); - $sth->bindParam(3, $aliases, PDO::PARAM_INT); - $sth->bindParam(4, $mailboxes, PDO::PARAM_INT); - $sth->execute(); - $message = $PALANG['pAdminCreate_domain_result_succes'] . "
($domain)
"; - } catch(PDOException $e) { - $message = $PALANG['pAdminCreate_domain_result_error'] . "
($domain)
"; - } - } else { - $message = $PALANG['pAdminCreate_domain_domain_text_error']; - } - - if (in_array($domain, array_column($list_domains, 'domain')) && $action == 'edit') { - try { - $dbh = connect_db(); - $sth = $dbh->prepare("UPDATE domain SET description=?,aliases=?,mailboxes=?,modified=NOW() WHERE domain=?"); - $sth->bindParam(1, $description, PDO::PARAM_STR); - $sth->bindParam(2, $aliases, PDO::PARAM_INT); - $sth->bindParam(3, $mailboxes, PDO::PARAM_INT); - $sth->bindParam(4, $domain, PDO::PARAM_STR); - $sth->execute(); - header("Location: list-domain.php"); - } catch(PDOException $e) { - $message = $PALANG['pAdminEdit_domain_result_error']; - } - } -} - -include '../templates/header.tpl'; -include '../templates/admin_menu.tpl'; -include '../templates/admin_add-domain.tpl'; -include '../templates/footer.tpl'; -?> diff --git a/admin/create-domain.php b/admin/create-domain.php deleted file mode 100644 index 81f855d..0000000 --- a/admin/create-domain.php +++ /dev/null @@ -1,65 +0,0 @@ - -// Copyright (c) 2022 High5! -// License Info: LICENSE.TXT -// -// File: create-domain.php -// -// Template File: admin_create-domain.tpl -// -// Template Variables: -// -// tMessage -// tDomain -// tDescription -// tAliases -// tMailboxes -// tMaxquota -// tDefaultaliases -// -// Form POST \ GET Variables: -// -// fDomain -// fDescription -// fAliases -// fMailboxes -// fMaxquota -// fDefaultaliases -// -require_once '../functions.inc.php'; -include '../languages/' . check_language() . '.lang'; - -if ($_SERVER['REQUEST_METHOD'] == "POST") { - - $list_domains = list_domains(); - - $domain = strtolower(filter_input(INPUT_POST, 'domain', FILTER_VALIDATE_DOMAIN)); - $description = filter_input(INPUT_POST, 'description', FILTER_CALLBACK, array('options' => 'htmlspecialchars')); - $aliases = filter_input(INPUT_POST, 'aliases', FILTER_VALIDATE_INT); - $mailboxes = filter_input(INPUT_POST, 'mailboxes', FILTER_VALIDATE_INT); - - if (!in_array($domain, array_column($list_domains, 'domain'))) { - try { - $dbh = connect_db(); - $sth = $dbh->prepare("INSERT INTO domain (domain,description,aliases,mailboxes,created,modified) VALUES (?,?,?,?,NOW(),NOW())"); - $sth->bindParam(1, $domain, PDO::PARAM_STR); - $sth->bindParam(2, $description, PDO::PARAM_STR); - $sth->bindParam(3, $aliases, PDO::PARAM_INT); - $sth->bindParam(4, $mailboxes, PDO::PARAM_INT); - $sth->execute(); - $message = $PALANG['pAdminCreate_domain_result_succes'] . "
($domain)
"; - } catch(PDOException $e) { - $message = $PALANG['pAdminCreate_domain_result_error'] . "
($domain)
"; - } - } else { - $message = $PALANG['pAdminCreate_domain_domain_text_error']; - } -} - -include '../templates/header.tpl'; -include '../templates/admin_menu.tpl'; -include '../templates/admin_create-domain.tpl'; -include '../templates/footer.tpl'; -?> diff --git a/admin/edit-domain.php b/admin/edit-domain.php deleted file mode 100644 index d725e1c..0000000 --- a/admin/edit-domain.php +++ /dev/null @@ -1,61 +0,0 @@ - -// Copyright (c) 2022 High5! -// License Info: LICENSE.TXT -// -// File: edit-domain.php -// -// Template File: admin_edit-domain.tpl -// -// Template Variables: -// -// tDescription -// tAliases -// tMailboxes -// tMaxquota -// tActive -// -// Form POST \ GET Variables: -// -// fDescription -// fAliases -// fMailboxes -// fMaxquota -// fActive -// -require("../functions.inc.php"); -include("../languages/" . check_language() . ".lang"); - -$list_domains = list_domains(); - -if ($_SERVER['REQUEST_METHOD'] == "GET") { - $action = filter_input(INPUT_GET, 'action', FILTER_DEFAULT); - $domain = filter_input(INPUT_GET, 'domain', FILTER_VALIDATE_DOMAIN); - $domain_key = array_search($domain, array_column($list_domains, 'domain')); - $description = $list_domains[$domain_key]['description']; - $aliases = $list_domains[$domain_key]['aliases']; - $mailboxes = $list_domains[$domain_key]['mailboxes']; -} - -if ($_SERVER['REQUEST_METHOD'] == "POST") { - $domain = escape_string($_GET['domain']); - - $fDescription = escape_string($_POST['fDescription']); - $fAliases = escape_string($_POST['fAliases']); - $fMailboxes = escape_string($_POST['fMailboxes']); - - - $result = db_query("UPDATE domain SET description='$fDescription',aliases='$fAliases',mailboxes='$fMailboxes',maxquota='$fMaxquota',transport='$fTransport',backupmx='$fBackupmx',active='$fActive',modified=NOW() WHERE domain='$domain'"); - if ($result['rows'] == 1) { - header("Location: list-domain.php"); - } else { - $tMessage = $PALANG['pAdminEdit_domain_result_error']; - } -} -include("../templates/header.tpl"); -include("../templates/admin_menu.tpl"); -include("../templates/admin_add-domain.tpl"); -include("../templates/footer.tpl"); -?> diff --git a/templates/admin_add-domain.tpl b/templates/admin_add-domain.tpl deleted file mode 100644 index 2071a1d..0000000 --- a/templates/admin_add-domain.tpl +++ /dev/null @@ -1,43 +0,0 @@ -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

 
 
-
-
diff --git a/templates/admin_create-domain.tpl b/templates/admin_create-domain.tpl deleted file mode 100644 index 19e89e6..0000000 --- a/templates/admin_create-domain.tpl +++ /dev/null @@ -1,35 +0,0 @@ -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

 
-
-
diff --git a/templates/admin_edit-domain.tpl b/templates/admin_edit-domain.tpl deleted file mode 100644 index 14c636b..0000000 --- a/templates/admin_edit-domain.tpl +++ /dev/null @@ -1,35 +0,0 @@ -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

 
 
-
-