opensmtpdadmin/list-domain.php

44 lines
957 B
PHP
Raw Normal View History

2022-09-04 16:04:56 +02:00
<?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();
2022-09-06 13:56:05 +02:00
$ROLE = check_role($SESSID_USERNAME);
2022-09-04 16:04:56 +02:00
2022-09-05 20:29:41 +02:00
if ($_SERVER['REQUEST_METHOD'] == "GET") {
$username = filter_input(INPUT_GET, 'username', FILTER_VALIDATE_EMAIL);
if ($ROLE == ADMIN_ROLE) {
2022-09-05 20:29:41 +02:00
$list_admins = list_admins();
if (empty($username)) {
$list_domains = list_domains();
} else {
$list_domains = list_domains($username);
}
} else {
$list_domains = list_domains($SESSID_USERNAME);
}
}
2022-09-04 16:04:56 +02:00
include './templates/header.tpl';
include './templates/menu.tpl';
include './templates/list-domain.tpl';
include './templates/footer.tpl';
?>