diff --git a/create-alias.php b/add-alias.php similarity index 95% rename from create-alias.php rename to add-alias.php index 7a1895d..d3f7356 100644 --- a/create-alias.php +++ b/add-alias.php @@ -22,13 +22,11 @@ // fGoto // fDomain // -require("./variables.inc.php"); -require("./config.inc.php"); require("./functions.inc.php"); include("./languages/" . check_language() . ".lang"); $SESSID_USERNAME = check_session(); -$list_domains = list_domains_for_admin($SESSID_USERNAME); +$list_domains = list_domains($SESSID_USERNAME); if ($_SERVER['REQUEST_METHOD'] == "GET") { $pCreate_alias_goto_text = $LANG['Create_alias_goto_text']; @@ -109,6 +107,6 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") { } include("./templates/header.tpl"); include("./templates/menu.tpl"); -include("./templates/create-alias.tpl"); +include("./templates/add-alias.tpl"); include("./templates/footer.tpl"); ?> diff --git a/create-mailbox.php b/add-mailbox.php similarity index 97% rename from create-mailbox.php rename to add-mailbox.php index 3c3b829..2369879 100644 --- a/create-mailbox.php +++ b/add-mailbox.php @@ -28,13 +28,11 @@ // fActive // fMail // -require("./variables.inc.php"); -require("./config.inc.php"); require("./functions.inc.php"); include("./languages/" . check_language() . ".lang"); $SESSID_USERNAME = check_session(); -$list_domains = list_domains_for_admin($SESSID_USERNAME); +$list_domains = list_domains($SESSID_USERNAME); if ($_SERVER['REQUEST_METHOD'] == "GET") { $tQuota = $CONF['maxquota']; @@ -188,6 +186,6 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") { } include("./templates/header.tpl"); include("./templates/menu.tpl"); -include("./templates/create-mailbox.tpl"); +include("./templates/add-mailbox.tpl"); include("./templates/footer.tpl"); ?> diff --git a/admin/add-alias.php b/admin/add-alias.php index 8d1c032..ac2bcff 100644 --- a/admin/add-alias.php +++ b/admin/add-alias.php @@ -27,12 +27,18 @@ include '../languages/' . check_language() . '.lang'; $list_domains = list_domains(); +if ($_SERVER['REQUEST_METHOD'] == "GET") { + $domain = filter_input(INPUT_GET, 'domain', FILTER_VALIDATE_DOMAIN); + $domain_key = array_search($domain, array_column($list_domains, 'domain')); +} + if ($_SERVER['REQUEST_METHOD'] == "POST") { $address = strtolower(filter_input(INPUT_POST, 'address', FILTER_DEFAULT)); $domain = filter_input(INPUT_POST, 'domain', FILTER_VALIDATE_DOMAIN); $goto = strtolower(filter_input(INPUT_POST, 'goto', FILTER_DEFAULT)); $domain_key = array_search($domain, array_column($list_domains, 'domain')); + print "$domain_key"; $from = filter_var($address . '@' . $domain, FILTER_VALIDATE_EMAIL); if (!str_contains($goto, '@')) { diff --git a/admin/add-mailbox.php b/admin/add-mailbox.php index 76e84c0..d6f2fe7 100644 --- a/admin/add-mailbox.php +++ b/admin/add-mailbox.php @@ -29,8 +29,12 @@ include '../languages/' . check_language() . '.lang'; $list_domains = list_domains(); -if ($_SERVER['REQUEST_METHOD'] == "POST") { +if ($_SERVER['REQUEST_METHOD'] == "GET") { + $domain = filter_input(INPUT_GET, 'domain', FILTER_VALIDATE_DOMAIN); + $domain_key = array_search($domain, array_column($list_domains, 'domain')); +} +if ($_SERVER['REQUEST_METHOD'] == "POST") { $username = strtolower(filter_input(INPUT_POST, 'username', FILTER_DEFAULT)); $domain = filter_input(INPUT_POST, 'domain', FILTER_VALIDATE_DOMAIN); $password1 = filter_input(INPUT_POST, 'password1', FILTER_DEFAULT); diff --git a/admin/list-virtual.php b/admin/list-virtual.php index c9e4606..76e1928 100644 --- a/admin/list-virtual.php +++ b/admin/list-virtual.php @@ -29,7 +29,7 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") { $limit = PAGE_SIZE; if (count($list_domains) > 0) { $domain = filter_input(INPUT_GET, 'domain', FILTER_VALIDATE_DOMAIN) ?? $list_domains[0]['domain']; - $selected_domain = array_search($domain, array_column($list_domains, 'domain')); + $domain_key = array_search($domain, array_column($list_domains, 'domain')); $list_alias = list_aliases($domain, $offset, $limit); $list_mailbox = list_mailboxes($domain, $offset, $limit); } diff --git a/admin/viewlog.php b/admin/viewlog.php index 43fdcad..40d9de4 100644 --- a/admin/viewlog.php +++ b/admin/viewlog.php @@ -24,6 +24,7 @@ $list_domains = list_domains(); if ($_SERVER['REQUEST_METHOD'] == "GET") { $domain = filter_input(INPUT_GET, 'domain', FILTER_VALIDATE_DOMAIN) ?? $list_domains[0]['domain']; + $domain_key = array_search($domain, array_column($list_domains, 'domain')); $dbh = connect_db(); $sth = $dbh->prepare("SELECT * FROM log WHERE domain=? ORDER BY timestamp DESC LIMIT 10"); $sth->bindParam(1, $domain, PDO::PARAM_STR); diff --git a/list-virtuals.php b/list-virtuals.php index b10de07..6683e3c 100644 --- a/list-virtuals.php +++ b/list-virtuals.php @@ -14,14 +14,13 @@ // list_alias // list_mailbox // -// Form GET Variables: +// Form POST \ GET Variables: // // domain // offset // require_once './functions.inc.php'; include './languages/' . check_language() . '.lang'; -include './templates/header.tpl'; $SESSID_USERNAME = check_session(); $list_domains = list_domains($SESSID_USERNAME); @@ -34,10 +33,11 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") { $domain_key = array_search($domain, array_column($list_domains, 'domain')); $list_alias = list_aliases($domain, $offset, $limit); $list_mailbox = list_mailboxes($domain, $offset, $limit); - $template = "list-virtual.tpl"; - include './templates/menu.tpl'; - include './templates/list-virtuals.tpl'; } } + +include './templates/header.tpl'; +include './templates/menu.tpl'; +include './templates/list-virtuals.tpl'; include './templates/footer.tpl'; ?> diff --git a/password.php b/password.php index 4284426..d03a0e0 100644 --- a/password.php +++ b/password.php @@ -19,8 +19,6 @@ // fPassword // fPassword2 // -require("./variables.inc.php"); -require("./config.inc.php"); require("./functions.inc.php"); include("./languages/" . check_language() . ".lang"); diff --git a/sendmail.php b/sendmail.php index f89cf76..b683444 100644 --- a/sendmail.php +++ b/sendmail.php @@ -22,8 +22,6 @@ // fSubject // fBody // -require("./variables.inc.php"); -require("./config.inc.php"); require("./functions.inc.php"); include("./languages/" . check_language() . ".lang"); diff --git a/templates/add-alias.tpl b/templates/add-alias.tpl index 28b655d..bca4f98 100644 --- a/templates/add-alias.tpl +++ b/templates/add-alias.tpl @@ -12,7 +12,7 @@ " . $row['domain'] . "\n"; } ?> diff --git a/templates/add-mailbox.tpl b/templates/add-mailbox.tpl index 35306c5..96286bf 100644 --- a/templates/add-mailbox.tpl +++ b/templates/add-mailbox.tpl @@ -12,7 +12,7 @@ " . $row['domain'] . "\n"; } ?> diff --git a/templates/admin_list-domain.tpl b/templates/admin_list-domain.tpl index 2338630..366f82f 100644 --- a/templates/admin_list-domain.tpl +++ b/templates/admin_list-domain.tpl @@ -5,7 +5,7 @@ if (count($list_admins) > 0) { foreach ($list_admins as $row) { echo '\n"; } } diff --git a/templates/admin_list-virtual.tpl b/templates/admin_list-virtual.tpl index 0bce685..6688e7d 100644 --- a/templates/admin_list-virtual.tpl +++ b/templates/admin_list-virtual.tpl @@ -5,7 +5,7 @@ if (count($list_domains) > 0) { foreach ($list_domains as $row) { echo '\n"; } } @@ -16,8 +16,8 @@ if (count($list_domains) > 0) {
- - + +