opensmtpdadmin/list-domain.php
2022-09-06 11:56:05 +00:00

44 lines
957 B
PHP

<?php
//
// OpenSMTPD Admin
// by Mischa Peters <mischa at high5 dot nl>
// Copyright (c) 2022 High5!
// License Info: LICENSE.TXT
//
// File: list-domains.php
//
// Template File: list-domains.tpl
//
// Template variables:
//
// list_domains
//
// GET / POST variables:
//
// -none-
//
require_once './functions.inc.php';
include './languages/' . check_language() . '.lang';
$SESSID_USERNAME = check_session();
$ROLE = check_role($SESSID_USERNAME);
if ($_SERVER['REQUEST_METHOD'] == "GET") {
$username = filter_input(INPUT_GET, 'username', FILTER_VALIDATE_EMAIL);
if ($ROLE == ADMIN_ROLE) {
$list_admins = list_admins();
if (empty($username)) {
$list_domains = list_domains();
} else {
$list_domains = list_domains($username);
}
} else {
$list_domains = list_domains($SESSID_USERNAME);
}
}
include './templates/header.tpl';
include './templates/menu.tpl';
include './templates/list-domain.tpl';
include './templates/footer.tpl';
?>