opensmtpdadmin/admin/list-domain.php
2022-08-18 14:01:52 +02:00

62 lines
1.5 KiB
PHP

<?php
//
// OpenSMTPD Admin
// by Mischa Peters <mischa at high5 dot nl>
// Copyright (c) 2022 High5!
// License Info: LICENSE.TXT
//
// File: list-domain.php
//
// Template File: admin_list-domain.tpl
//
// Template Variables:
//
// -none-
//
// Form POST \ GET Variables:
//
// fUsername
//
require("../variables.inc.php");
require("../config.inc.php");
require("../functions.inc.php");
include("../languages/" . check_language() . ".lang");
$list_admins = list_admins();
if ($_SERVER['REQUEST_METHOD'] == "GET") {
if (isset($_GET['username'])) {
$fUsername = escape_string($_GET['username']);
$list_domains = list_domains_for_admin($fUsername);
if ($list_domains != 0) {
for ($i = 0; $i < count($list_domains); $i++) {
$domain_properties[$i] = get_domain_properties($list_domains[$i]);
}
}
} else {
$list_domains = list_domains();
if ((is_array($list_domains) and count($list_domains) > 0)) {
for ($i = 0; $i < count($list_domains); $i++) {
$domain_properties[$i] = get_domain_properties($list_domains[$i]);
}
}
}
}
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$fUsername = escape_string($_POST['fUsername']);
$list_domains = list_domains_for_admin($fUsername);
if (!empty($list_domains)) {
for ($i = 0; $i < count($list_domains); $i++) {
$domain_properties[$i] = get_domain_properties($list_domains[$i]);
}
}
}
include("../templates/header.tpl");
include("../templates/admin_menu.tpl");
include("../templates/admin_list-domain.tpl");
include("../templates/footer.tpl");
?>