strip urlencode / active from templates

This commit is contained in:
mischa 2022-09-03 08:44:32 +00:00
parent c5315bbcd7
commit 1c10461fa7
19 changed files with 181 additions and 306 deletions

View File

@ -5,27 +5,25 @@
// Copyright (c) 2022 High5!
// License Info: LICENSE.TXT
//
// File: create-alias.php
// File: add-alias.php
//
// Template File: create-alias.tpl
// Template File: add-alias.tpl
//
// Template Variables:
//
// tMessage
// tAddress
// tGoto
// message
// address
// domain
// goto
//
// Form POST \ GET Variables:
//
// address
// fGoto
// domain
// goto
//
require("../variables.inc.php");
require("../config.inc.php");
require("../functions.inc.php");
include("../languages/" . check_language() . ".lang");
require_once '../functions.inc.php';
include '../languages/' . check_language() . ".lang';
$list_domains = list_domains();
@ -67,8 +65,8 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
}
}
}
include("../templates/header.tpl");
include("../templates/admin_menu.tpl");
include("../templates/add-alias.tpl");
include("../templates/footer.tpl");
include '../templates/header.tpl';
include '../templates/admin_menu.tpl';
include '../templates/add-alias.tpl';
include '../templates/footer.tpl';
?>

View File

@ -5,31 +5,27 @@
// Copyright (c) 2022 High5!
// License Info: LICENSE.TXT
//
// File: create-mailbox.php
// File: add-mailbox.php
//
// Template File: create-mailbox.tpl
// Template File: add-mailbox.tpl
//
// Template Variables:
//
// tMessage
// tUsername
// tName
// tQuota
// tDomain
// message
// username
// name
// domain
//
// Form POST \ GET Variables:
//
// username
// fPassword
// fPassword2
// fName
// fQuota
// password1
// password2
// name
// domain
// fActive
// fMail
//
require_once("../functions.inc.php");
include("../languages/" . check_language() . ".lang");
require_once '../functions.inc.php';
include '../languages/' . check_language() . '.lang';
$list_domains = list_domains();
@ -90,8 +86,8 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
}
}
}
include("../templates/header.tpl");
include("../templates/admin_menu.tpl");
include("../templates/add-mailbox.tpl");
include("../templates/footer.tpl");
include '../templates/header.tpl';
include '../templates/admin_menu.tpl';
include '../templates/add-mailbox.tpl';
include '../templates/footer.tpl';
?>

View File

@ -5,26 +5,27 @@
// Copyright (c) 2022 High5!
// License Info: LICENSE.TXT
//
// File: create-admin.php
// File: admin.php
//
// Template File: admin_create-admin.tpl
// Template File: admin_admin.tpl
//
//
// Template Variables:
//
// tMessage
// tUsername
// tDomains
// action
// message
// username
// domains
//
// Form POST \ GET Variables:
//
// fUsername
// fPassword
// fPassword2
// fDomains
// username
// password1
// password2
// domains
//
require_once("../functions.inc.php");
include("../languages/" . check_language() . ".lang");
require_once '../functions.inc.php';
include '../languages/' . check_language() . '.lang';
$list_domains = list_domains();
$list_admins = list_admins();
@ -47,15 +48,15 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
if ($action == 'add') {
if (empty($username) || in_array($username, array_column($list_admins, 'username'))) {
$message = $PALANG['pAdminCreate_admin_username_error'];
$message = $PALANG['pAdminAdd_admin_username_error'];
}
if (empty($password1) || $password1 != $password2) {
$message = $PALANG['pAdminCreate_admin_password_error'];
$message = $PALANG['pAdminAdd_admin_password_error'];
}
if (empty($domains['domains'])) {
$message = $PALANG['pAdminCreate_admin_domain_error'];
$message = $PALANG['pAdminAdd_admin_domain_error'];
}
if (empty($message)) {
@ -72,16 +73,16 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
$sth->bindParam(2, $row, PDO::PARAM_STR);
$sth->execute();
}
$message = $PALANG['pAdminCreate_admin_result_succes'] . "<br />($username)</br />";
$message = $PALANG['pAdminAdd_admin_result_succes'] . "<br />($username)</br />";
} catch(PDOException $e) {
$message = $PALANG['pAdminCreate_admin_result_error'] . "<br />($username)<br />";
$message = $PALANG['pAdminAdd_admin_result_error'] . "<br />($username)<br />";
}
}
}
if (in_array($username, array_column($list_admins, 'username')) && $action == 'edit') {
if ($password1 != $password2) {
$message = $PALANG['pAdminCreate_admin_password_error'];
$message = $PALANG['pAdminAdd_admin_password_error'];
}
if (empty($message)) {
try {
@ -97,7 +98,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
}
if (empty($domains['domains'])) {
$message = $PALANG['pAdminCreate_admin_domain_error'];
$message = $PALANG['pAdminAdd_admin_domain_error'];
}
if (empty($message)) {
try {
@ -127,8 +128,8 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
}
}
}
include("../templates/header.tpl");
include("../templates/admin_menu.tpl");
include("../templates/admin_admin.tpl");
include("../templates/footer.tpl");
include '../templates/header.tpl';
include '../templates/admin_menu.tpl';
include '../templates/admin_admin.tpl';
include '../templates/footer.tpl';
?>

View File

@ -11,7 +11,7 @@
//
// Template Variables:
//
// tMessage
// message
//
// Form POST \ GET Variables:
//
@ -20,8 +20,8 @@
// delete
// domain
//
require_once("../functions.inc.php");
include("../languages/" . check_language() . ".lang");
require_once '../functions.inc.php';
include '../languages/' . check_language() . '.lang';
if ($_SERVER['REQUEST_METHOD'] == "GET") {
$table = strtolower(filter_input(INPUT_GET, 'table', FILTER_DEFAULT));
@ -182,8 +182,8 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") {
}
}
}
include("../templates/header.tpl");
include("../templates/admin_menu.tpl");
include("../templates/message.tpl");
include("../templates/footer.tpl");
include '../templates/header.tpl';
include '../templates/admin_menu.tpl';
include '../templates/message.tpl';
include '../templates/footer.tpl';
?>

View File

@ -5,28 +5,25 @@
// Copyright (c) 2022 High5!
// License Info: LICENSE.TXT
//
// File: create-domain.php
// File: domain.php
//
// Template File: admin_create-domain.tpl
// Template File: admin_domain.tpl
//
// Template Variables:
//
// tMessage
// tDomain
// tDescription
// tAliases
// tMailboxes
// tMaxquota
// tDefaultaliases
// action
// message
// domain
// description
// aliases
// mailboxes
//
// Form POST \ GET Variables:
//
// fDomain
// fDescription
// fAliases
// fMailboxes
// fMaxquota
// fDefaultaliases
// domain
// description
// aliases
// mailboxes
//
require_once '../functions.inc.php';
include '../languages/' . check_language() . '.lang';
@ -60,12 +57,12 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
$sth->bindParam(3, $aliases, PDO::PARAM_INT);
$sth->bindParam(4, $mailboxes, PDO::PARAM_INT);
$sth->execute();
$message = $PALANG['pAdminCreate_domain_result_succes'] . "<br />($domain)</br />";
$message = $PALANG['pAdminAdd_domain_result_succes'] . "<br />($domain)</br />";
} catch(PDOException $e) {
$message = $PALANG['pAdminCreate_domain_result_error'] . "<br />($domain)<br />";
$message = $PALANG['pAdminAdd_domain_result_error'] . "<br />($domain)<br />";
}
} else {
$message = $PALANG['pAdminCreate_domain_domain_text_error'];
$message = $PALANG['pAdminAdd_domain_domain_text_error'];
}
if (in_array($domain, array_column($list_domains, 'domain')) && $action == 'edit') {

View File

@ -1,61 +0,0 @@
<?php
//
// OpenSMTPD Admin
// by Mischa Peters <mischa at high5 dot nl>
// Copyright (c) 2022 High5!
// License Info: LICENSE.TXT
//
// File: list-virtual.php
//
// Template File: admin_list-virtual.tpl
//
// Template Variables:
//
// list_alias
// list_mailbox
//
// Form GET Variables:
//
// domain
// offset
//
require_once '../functions.inc.php';
include '../languages/' . check_language() . '.lang';
$list_domains = list_domains();
$dbh = new PDO(DB_TYPE . ':host='. DB_HOST . ';dbname='. DB_NAME , DB_USER, DB_PASS);
if ($_SERVER['REQUEST_METHOD'] == "GET") {
$offset = filter_input(INPUT_GET, 'offset', FILTER_VALIDATE_INT) ?? '0';
$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'));
if ($CONF['alias_control'] == "NO") {
$sth = $dbh->prepare("SELECT alias.address,alias.goto,alias.modified FROM alias LEFT JOIN mailbox ON alias.address=mailbox.username WHERE alias.domain=? AND mailbox.maildir IS NULL ORDER BY alias.address LIMIT ?, ?");
} else {
$sth = $dbh->prepare("SELECT alias.address,alias.goto,alias.modified FROM alias WHERE alias.domain=? ORDER BY alias.address LIMIT ?, ?");
}
$sth->bindParam(1, $domain, PDO::PARAM_STR);
$sth->bindParam(2, $offset, PDO::PARAM_INT);
$sth->bindParam(3, $limit, PDO::PARAM_INT);
$sth->execute();
$list_alias = $sth->fetchAll();
$sth = $dbh->prepare("SELECT * FROM mailbox WHERE domain=? ORDER BY username LIMIT ?, ?");
$sth->bindParam(1, $domain, PDO::PARAM_STR);
$sth->bindParam(2, $offset, PDO::PARAM_INT);
$sth->bindParam(3, $limit, PDO::PARAM_INT);
$sth->execute();
$list_mailbox = $sth->fetchAll();
}
}
include '../templates/header.tpl';
include '../templates/admin_menu.tpl';
include '../templates/admin_list-virtual.tpl';
include '../templates/footer.tpl';
?>

View File

@ -11,72 +11,36 @@
//
// Template Variables:
//
// tAlias
// tMailbox
// list_alias
// list_mailbox
//
// Form POST \ GET Variables:
//
// fSearch
// search
//
require("../variables.inc.php");
require("../config.inc.php");
require("../functions.inc.php");
include("../languages/" . check_language() . ".lang");
require_once '../functions.inc.php';
include '../languages/' . check_language() . '.lang';
$tAlias = array();
$tMailbox = array();
$search = filter_input(INPUT_POST, 'search', FILTER_DEFAULT);
if ($_SERVER['REQUEST_METHOD'] == "GET") {
if (isset($_GET['search'])) $fSearch = escape_string($_GET['search']);
if (isset($search)) {
$dbh = connect_db();
$sth = $dbh->prepare("SELECT alias.address,alias.goto,alias.modified,alias.domain FROM alias LEFT JOIN mailbox ON alias.address=mailbox.username WHERE alias.address LIKE ? AND mailbox.maildir IS NULL ORDER BY alias.address");
$sth->bindValue(1, '%'.$search.'%', PDO::PARAM_STR);
$sth->execute();
$list_alias = $sth->fetchAll();
if ($CONF['alias_control'] == "YES") {
$query = "SELECT alias.address,alias.goto,alias.modified,alias.domain FROM alias WHERE alias.address LIKE '%$fSearch%' OR alias.goto LIKE '%$fSearch%' ORDER BY alias.address";
$sth = $dbh->prepare("SELECT * FROM mailbox WHERE username LIKE ? ORDER BY username");
$sth->bindValue(1, '%'.$search.'%', PDO::PARAM_STR);
$sth->execute();
$list_mailbox = $sth->fetchAll();
} else {
$query = "SELECT alias.address,alias.goto,alias.modified,alias.domain FROM alias LEFT JOIN mailbox ON alias.address=mailbox.username WHERE alias.address LIKE '%$fSearch%' AND mailbox.maildir IS NULL ORDER BY alias.address";
$list_alias = array();
$list_mailbox = array();
}
$result = db_query("$query");
if ($result['rows'] > 0) {
while ($row = db_array($result['result'])) {
$tAlias[] = $row;
}
}
$result = db_query("SELECT * FROM mailbox WHERE username LIKE '%$fSearch%' ORDER BY username");
if ($result['rows'] > 0) {
while ($row = db_array($result['result'])) {
$tMailbox[] = $row;
}
}
}
if ($_SERVER['REQUEST_METHOD'] == "POST") {
if (isset($_POST['search'])) $fSearch = escape_string($_POST['search']);
if ($CONF['alias_control'] == "YES") {
$query = "SELECT alias.address,alias.goto,alias.modified,alias.domain FROM alias WHERE alias.address LIKE '%$fSearch%' OR alias.goto LIKE '%$fSearch%' ORDER BY alias.address";
} else {
$query = "SELECT alias.address,alias.goto,alias.modified,alias.domain FROM alias LEFT JOIN mailbox ON alias.address=mailbox.username WHERE alias.address LIKE '%$fSearch%' AND mailbox.maildir IS NULL ORDER BY alias.address";
}
$result = db_query("$query");
if ($result['rows'] > 0) {
while ($row = db_array($result['result'])) {
$tAlias[] = $row;
}
}
$result = db_query("SELECT * FROM mailbox WHERE username LIKE '%$fSearch%' ORDER BY username");
if ($result['rows'] > 0) {
while ($row = db_array($result['result'])) {
$tMailbox[] = $row;
}
}
}
include("../templates/header.tpl");
include("../templates/admin_menu.tpl");
include("../templates/admin_search.tpl");
include("../templates/footer.tpl");
include '../templates/header.tpl';
include '../templates/admin_menu.tpl';
include '../templates/admin_search.tpl';
include '../templates/footer.tpl';
?>

View File

@ -9,7 +9,7 @@
//
if(preg_match("/functions.inc.php/", $_SERVER['SCRIPT_NAME'])) {
header("Location: login.php");
exit;
die();
}
DEFINE("VERSION", "version 1.0.0");
@ -18,8 +18,6 @@ require_once ROOT_PATH . 'conf.php';
require_once ROOT_PATH . 'config.inc.php';
require_once ROOT_PATH . 'variables.inc.php';
$version = "1.0.0";
//
// Check of debug is enabled or not
//
@ -64,9 +62,8 @@ function check_user_session() {
// Call: check_language
//
function check_language() {
global $CONF;
// Currently only English is supported, no need to run through the check now.
return $CONF['default_language'];
return DEFAULT_LANGUAGE;
}
//

View File

@ -182,17 +182,17 @@ $PALANG['pAdminList_virtual_mailbox_name'] = 'Name';
$PALANG['pAdminList_virtual_mailbox_modified'] = 'Last Modified';
$PALANG['pAdminList_virtual_mailbox_active'] = 'Active';
$PALANG['pAdminCreate_domain_welcome'] = 'Add a new domain';
$PALANG['pAdminCreate_domain_domain'] = 'Domain';
$PALANG['pAdminCreate_domain_domain_text_error'] = '<span class="error_msg">The domain already exists.</span>';
$PALANG['pAdminCreate_domain_description'] = 'Description';
$PALANG['pAdminCreate_domain_aliases'] = 'Aliases';
$PALANG['pAdminCreate_domain_aliases_text'] = '-1 = disable | 0 = unlimited';
$PALANG['pAdminCreate_domain_mailboxes'] = 'Mailboxes';
$PALANG['pAdminCreate_domain_mailboxes_text'] = '-1 = disable | 0 = unlimited';
$PALANG['pAdminCreate_domain_button'] = 'Add Domain';
$PALANG['pAdminCreate_domain_result_error'] = '<span class="error_msg">Unable to add domain.</span>';
$PALANG['pAdminCreate_domain_result_succes'] = 'Domain has been added.';
$PALANG['pAdminAdd_domain_welcome'] = 'Add a new domain';
$PALANG['pAdminAdd_domain_domain'] = 'Domain';
$PALANG['pAdminAdd_domain_domain_text_error'] = '<span class="error_msg">The domain already exists.</span>';
$PALANG['pAdminAdd_domain_description'] = 'Description';
$PALANG['pAdminAdd_domain_aliases'] = 'Aliases';
$PALANG['pAdminAdd_domain_aliases_text'] = '-1 = disable | 0 = unlimited';
$PALANG['pAdminAdd_domain_mailboxes'] = 'Mailboxes';
$PALANG['pAdminAdd_domain_mailboxes_text'] = '-1 = disable | 0 = unlimited';
$PALANG['pAdminAdd_domain_button'] = 'Add Domain';
$PALANG['pAdminAdd_domain_result_error'] = '<span class="error_msg">Unable to add domain.</span>';
$PALANG['pAdminAdd_domain_result_succes'] = 'Domain has been added.';
$PALANG['pAdminEdit_domain_welcome'] = 'Edit a domain';
$PALANG['pAdminEdit_domain_domain'] = 'Domain';
@ -205,17 +205,17 @@ $PALANG['pAdminEdit_domain_active'] = 'Active';
$PALANG['pAdminEdit_domain_button'] = 'Edit Domain';
$PALANG['pAdminEdit_domain_result_error'] = '<span class="error_msg">Unable to modify domain.</span>';
$PALANG['pAdminCreate_admin_welcome'] = 'Add a new domain admin';
$PALANG['pAdminCreate_admin_username'] = 'Admin (email address)';
$PALANG['pAdminCreate_admin_username_error'] = '<span class="error_msg">Admin already exists or is not valid.</span>';
$PALANG['pAdminCreate_admin_password1'] = 'Password';
$PALANG['pAdminCreate_admin_password2'] = 'Password (again)';
$PALANG['pAdminCreate_admin_password_error'] = '<span class="error_msg">The passwords you supplied don\'t match, or are empty.</span>';
$PALANG['pAdminCreate_admin_domain_error'] = '<span class="error_msg">No domains selected.</span>';
$PALANG['pAdminCreate_admin_button'] = 'Add Admin';
$PALANG['pAdminCreate_admin_result_error'] = '<span class="error_msg">Unable to add admin.</span>';
$PALANG['pAdminCreate_admin_result_succes'] = 'Admin has been added.';
$PALANG['pAdminCreate_admin_address'] = 'Domain';
$PALANG['pAdminAdd_admin_welcome'] = 'Add a new domain admin';
$PALANG['pAdminAdd_admin_username'] = 'Admin (email address)';
$PALANG['pAdminAdd_admin_username_error'] = '<span class="error_msg">Admin already exists or is not valid.</span>';
$PALANG['pAdminAdd_admin_password1'] = 'Password';
$PALANG['pAdminAdd_admin_password2'] = 'Password (again)';
$PALANG['pAdminAdd_admin_password_error'] = '<span class="error_msg">The passwords you supplied don\'t match, or are empty.</span>';
$PALANG['pAdminAdd_admin_domain_error'] = '<span class="error_msg">No domains selected.</span>';
$PALANG['pAdminAdd_admin_button'] = 'Add Admin';
$PALANG['pAdminAdd_admin_result_error'] = '<span class="error_msg">Unable to add admin.</span>';
$PALANG['pAdminAdd_admin_result_succes'] = 'Admin has been added.';
$PALANG['pAdminAdd_admin_address'] = 'Domain';
$PALANG['pAdminEdit_admin_welcome'] = 'Edit a domain admin';
$PALANG['pAdminEdit_admin_username'] = 'Admin';

View File

@ -2,22 +2,30 @@
<form name="create_admin" method="post">
<table>
<tr>
<td colspan="2"><h3><?php echo $PALANG['pAdminCreate_admin_welcome']; ?></h3></td>
<?php if ($action == 'edit') { ?>
<td colspan="2"><h3><?php echo $PALANG['pAdminEdit_admin_welcome']; ?></h3></td>
<?php } else { ?>
<td colspan="2"><h3><?php echo $PALANG['pAdminAdd_admin_welcome']; ?></h3></td>
<?php } ?>
</tr>
<tr>
<td><?php echo $PALANG['pAdminCreate_admin_username'] . ":"; ?></td>
<td><?php echo $PALANG['pAdminAdd_admin_username'] . ":"; ?></td>
<?php if ($action == 'edit') { ?>
<td><input class="flat" type="hidden" name="username" value="<?php echo $username; ?>" /><?php print $username; ?></td>
<?php } else { ?>
<td><input class="flat" type="text" name="username" value="<?php echo $username ?? ''; ?>" /></td>
<?php } ?>
</tr>
<tr>
<td><?php echo $PALANG['pAdminCreate_admin_password1'] . ":"; ?></td>
<td><?php echo $PALANG['pAdminAdd_admin_password1'] . ":"; ?></td>
<td><input class="flat" type="password" name="password1" /></td>
</tr>
<tr>
<td><?php echo $PALANG['pAdminCreate_admin_password2'] . ":"; ?></td>
<td><?php echo $PALANG['pAdminAdd_admin_password2'] . ":"; ?></td>
<td><input class="flat" type="password" name="password2" /></td>
</tr>
<tr>
<td><?php echo $PALANG['pAdminCreate_admin_address'] . ":"; ?></td>
<td><?php echo $PALANG['pAdminAdd_admin_address'] . ":"; ?></td>
<td>
<select name="domains[]" size="10" multiple="multiple">
<?php
@ -31,7 +39,7 @@
</td>
</tr>
<tr>
<td colspan="2" class="hlp_center"><input class="button" type="submit" name="submit" value="<?php echo $PALANG['pAdminCreate_admin_button']; ?>" /></td>
<td colspan="2" class="hlp_center"><input class="button" type="submit" name="submit" value="<?php echo $PALANG['pAdminAdd_admin_button']; ?>" /></td>
</tr>
<tr>
<td colspan="2" class="standout"><?php echo $message ?? '&nbsp;'; ?></td>

View File

@ -5,35 +5,35 @@
<?php if ($action == 'edit') { ?>
<td colspan="3"><h3><?php print $PALANG['pAdminEdit_domain_welcome']; ?></h3></td>
<?php } else { ?>
<td colspan="3"><h3><?php echo $PALANG['pAdminCreate_domain_welcome']; ?></h3></td>
<td colspan="3"><h3><?php echo $PALANG['pAdminAdd_domain_welcome']; ?></h3></td>
<?php } ?>
</tr>
<tr>
<td><?php echo $PALANG['pAdminCreate_domain_domain'] . ":"; ?></td>
<td><?php echo $PALANG['pAdminAdd_domain_domain'] . ":"; ?></td>
<?php if ($action == 'edit') { ?>
<td><input class="flat" type="hidden" name="domain" value="<?php echo $domain ?? ''; ?>" /><?php print $domain; ?></td>
<td><input class="flat" type="hidden" name="domain" value="<?php echo $domain; ?>" /><?php print $domain; ?></td>
<?php } else { ?>
<td><input class="flat" type="text" name="domain" value="<?php echo $domain ?? ''; ?>" /></td>
<td>&nbsp;</td>
<?php } ?>
</tr>
<tr>
<td><?php echo $PALANG['pAdminCreate_domain_description'] . ":"; ?></td>
<td><?php echo $PALANG['pAdminAdd_domain_description'] . ":"; ?></td>
<td><input class="flat" type="text" name="description" value="<?php echo $description ?? ''; ?>" /></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><?php echo $PALANG['pAdminCreate_domain_aliases'] . ":"; ?></td>
<td><?php echo $PALANG['pAdminAdd_domain_aliases'] . ":"; ?></td>
<td><input class="flat" type="text" name="aliases" value="<?php echo $aliases ?? ALIASES; ?>" /></td>
<td><?php echo $PALANG['pAdminCreate_domain_aliases_text']; ?></td>
<td><?php echo $PALANG['pAdminAdd_domain_aliases_text']; ?></td>
</tr>
<tr>
<td><?php echo $PALANG['pAdminCreate_domain_mailboxes'] . ":"; ?></td>
<td><?php echo $PALANG['pAdminAdd_domain_mailboxes'] . ":"; ?></td>
<td><input class="flat" type="text" name="mailboxes" value="<?php echo $mailboxes ?? MAILBOXES; ?>" /></td>
<td><?php echo $PALANG['pAdminCreate_domain_mailboxes_text']; ?></td>
<td><?php echo $PALANG['pAdminAdd_domain_mailboxes_text']; ?></td>
</tr>
<tr>
<td colspan="3" class="hlp_center"><input class="button" type="submit" name="submit" value="<?php echo $PALANG['pAdminCreate_domain_button']; ?>" /></td>
<td colspan="3" class="hlp_center"><input class="button" type="submit" name="submit" value="<?php echo $PALANG['pAdminAdd_domain_button']; ?>" /></td>
</tr>
<tr>
<td colspan="3" class="standout"><?php echo $message ?? '&nbsp;'; ?></td>

View File

@ -18,11 +18,6 @@
<td><input class="flat" type="password" name="fPassword2" ></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><?php print $PALANG['pAdminEdit_admin_active'] . ":"; ?></td>
<td><input class="flat" type="checkbox" name="fActive" <?php print (!empty($tActive)) ? 'checked' : ''; ?> ></td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan=3 align=center>
<select name="fDomains[]" size="10" multiple="multiple">

View File

@ -15,7 +15,6 @@ if (count($list_admins) > 0) {
echo " <td><a href=\"list-domain.php?username=" . $row['username'] . "\">" . $row['username'] . "</a></td>";
echo " <td>" . $row['domain_count'] . "</td>";
echo " <td>" . $row['modified'] . "</td>";
$active = ($row['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
echo " <td><a href=\"admin.php?action=edit&username=" . $row['username'] . "\">" . $PALANG['edit'] . "</a></td>";
echo " <td><a href=\"delete.php?table=admin&where=username&delete=" . $row['username'] . "\" onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pAdminList_admin_username'] . ": " . $row['username'] . "')\">" . $PALANG['del'] . "</a></td>";
echo " </tr>\n";

View File

@ -35,7 +35,6 @@ if (count($list_domains) > 0) {
echo "<td>" . $row['alias_count'] . " / " . $row['aliases'] . "</td>";
echo "<td>" . $row['mailbox_count'] . " / " . $row['mailboxes'] . "</td>";
echo "<td>" . $row['modified'] . "</td>";
$active = ($row['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
echo "<td><a href=\"domain.php?action=edit&domain=" . $row['domain'] . "\">" . $PALANG['edit'] . "</a></td>";
echo "<td><a href=\"delete.php?table=domain&domain=" . $row['domain'] . "\" onclick=\"return confirm ('" . $PALANG['confirm_domain'] . $PALANG['pAdminList_admin_domain'] . ": " . $row['domain'] . "')\">" . $PALANG['del'] . "</a></td>";
echo "</tr>\n";

View File

@ -40,7 +40,6 @@ if ($list_domains[$selected_domain]['alias_count'] > $limit || $list_domains[$se
}
echo "</div>\n";
}
if (count($list_alias) > 0) {
print "<table id=\"alias_table\">\n";
print " <tr>\n";
@ -58,8 +57,8 @@ if (count($list_alias) > 0) {
print " <td>" . $row['address'] . "</td>\n";
print " <td>" . preg_replace("/,/", "<br>", $row['goto']) . "</td>\n";
print " <td>" . $row['modified'] . "</td>\n";
print " <td><a href=\"edit-alias.php?address=" . urlencode($row['address']) . "&domain=" . $list_domains[$selected_domain]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
print " <td><a href=\"delete.php?table=alias" . "&delete=" . urlencode($row['address']) . "&domain=" . $list_domains[$selected_domain]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $row['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
print " <td><a href=\"edit-alias.php?address=" . $row['address'] . "&domain=" . $list_domains[$selected_domain]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
print " <td><a href=\"delete.php?table=alias" . "&delete=" . $row['address'] . "&domain=" . $list_domains[$selected_domain]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $row['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
print " </tr>\n";
}
print "</table>\n";
@ -82,8 +81,8 @@ if (count($list_mailbox) > 0) {
print " <td>" . $row['username'] . "</td>\n";
print " <td>" . $row['name'] . "</td>\n";
print " <td>" . $row['modified'] . "</td>\n";
print " <td><a href=\"edit-mailbox.php?username=" . urlencode($row['username']) . "&domain=" . $list_domains[$selected_domain]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
print " <td><a href=\"delete.php?table=mailbox" . "&delete=" . urlencode($row['username']) . "&domain=" . $list_domains[$selected_domain]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $row['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
print " <td><a href=\"edit-mailbox.php?username=" . $row['username'] . "&domain=" . $list_domains[$selected_domain]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
print " <td><a href=\"delete.php?table=mailbox" . "&delete=" . $row['username'] . "&domain=" . $list_domains[$selected_domain]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $row['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
print " </tr>\n";
}
print "</table>\n";

View File

@ -1,11 +1,11 @@
<div id="overview">
<h4><?php print $PALANG['pSearch_welcome'] . $fSearch; ?></h4>
<h4><?php print $PALANG['pSearch_welcome'] . $search; ?></h4>
<form name="search" method="post" action="search.php">
<input type="textbox" name="search">
</form>
</div>
<?php
if (count($tAlias) > 0) {
if (count($list_alias) > 0) {
print "<table id=\"alias_table\">\n";
print " <tr>\n";
print " <td colspan=\"5\"><h3>".$PALANG['pOverview_alias_title']."</h3></td>";
@ -17,21 +17,19 @@ if (count($tAlias) > 0) {
print " <td colspan=\"2\">&nbsp;</td>\n";
print " </tr>\n";
for ($i = 0; $i < count($tAlias); $i++) {
if ((is_array($tAlias) and count($tAlias) > 0)) {
foreach ($list_alias as $row) {
print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
print " <td>" . $tAlias[$i]['address'] . "</td>\n";
print " <td>" . preg_replace("/,/", "<br>", $tAlias[$i]['goto']) . "</td>\n";
print " <td>" . $tAlias[$i]['modified'] . "</td>\n";
print " <td><a href=\"edit-alias.php?address=" . urlencode($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
print " <td><a href=\"delete.php?table=alias&delete=" . urlencode($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $tAlias[$i]['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
print " <td>" . $row['address'] . "</td>\n";
print " <td>" . preg_replace("/,/", "<br>", $row['goto']) . "</td>\n";
print " <td>" . $row['modified'] . "</td>\n";
print " <td><a href=\"edit-alias.php?action=edit&address=" . $row['address'] . "&domain=" . $row['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
print " <td><a href=\"delete.php?table=alias&delete=" . $row['address'] . "&domain=" . $row['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $row['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
print " </tr>\n";
}
}
print "</table>\n";
}
if (count($tMailbox) > 0) {
if (count($list_mailbox) > 0) {
print "<table id=\"mailbox_table\">\n";
print " <tr>\n";
print " <td colspan=\"7\"><h3>".$PALANG['pOverview_mailbox_title']."</h3></td>";
@ -39,26 +37,18 @@ if (count($tMailbox) > 0) {
print " <tr class=\"header\">\n";
print " <td>" . $PALANG['pOverview_mailbox_username'] . "</td>\n";
print " <td>" . $PALANG['pOverview_mailbox_name'] . "</td>\n";
if ($CONF['quota'] == 'YES') print " <td>" . $PALANG['pOverview_mailbox_quota'] . "</td>\n";
print " <td>" . $PALANG['pOverview_mailbox_modified'] . "</td>\n";
print " <td>" . $PALANG['pOverview_mailbox_active'] . "</td>\n";
print " <td colspan=\"2\">&nbsp;</td>\n";
print " </tr>\n";
for ($i = 0; $i < count($tMailbox); $i++) {
if ((is_array($tMailbox) and count($tMailbox) > 0)) {
foreach ($list_mailbox as $row) {
print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
print " <td>" . $tMailbox[$i]['username'] . "</td>\n";
print " <td>" . $tMailbox[$i]['name'] . "</td>\n";
if ($CONF['quota'] == 'YES') print " <td>" . $tMailbox[$i]['quota'] / $CONF['quota_multiplier'] . "</td>\n";
print " <td>" . $tMailbox[$i]['modified'] . "</td>\n";
$active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
print " <td><a href=\"edit-active.php?username=" . urlencode($tMailbox[$i]['username']) . "&domain=" . $tMailbox[$i]['domain'] . "\">" . $active . "</a></td>\n";
print " <td><a href=\"edit-mailbox.php?username=" . urlencode($tMailbox[$i]['username']) . "&domain=" . $tMailbox[$i]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
print " <td><a href=\"delete.php?table=mailbox&delete=" . urlencode($tMailbox[$i]['username']) . "&domain=" . $tMailbox[$i]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $tMailbox[$i]['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
print " <td>" . $row['username'] . "</td>\n";
print " <td>" . $row['name'] . "</td>\n";
print " <td><a href=\"edit-mailbox.php?action=edit&username=" . $row['username'] . "&domain=" . $row['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
print " <td><a href=\"delete.php?table=mailbox&delete=" . $row['username'] . "&domain=" . $row['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $row['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
print " </tr>\n";
}
}
print "</table>\n";
}
?>

View File

@ -65,12 +65,12 @@ if (count($list_alias) > 0) {
echo " <td>" . $row['modified'] . "</td>\n";
if ($CONF['special_alias_control'] == 'YES') {
echo " <td><a href=\"edit-alias.php?address=" . urlencode($row['address']) . "&domain=" . $list_domains[$domain_key]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
echo " <td><a href=\"delete.php?delete=" . urlencode($row['address']) . "&domain=" . $list_domains[$domain_key]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $row['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
echo " <td><a href=\"edit-alias.php?address=" . $row['address'] . "&domain=" . $list_domains[$domain_key]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
echo " <td><a href=\"delete.php?delete=" . $row['address'] . "&domain=" . $list_domains[$domain_key]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $row['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
} else {
if (!in_array($row['goto'], $CONF['default_aliases'])) {
echo " <td><a href=\"edit-alias.php?address=" . urlencode($row['address']) . "&domain=" . $row['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
echo " <td><a href=\"delete.php?delete=" . urlencode($row['address']) . "&domain=" . $row['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $row['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
echo " <td><a href=\"edit-alias.php?address=" . $row['address'] . "&domain=" . $row['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
echo " <td><a href=\"delete.php?delete=" . $row['address'] . "&domain=" . $row['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $row['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
} else {
echo " <td>&nbsp;</td>\n";
echo " <td>&nbsp;</td>\n";
@ -100,10 +100,8 @@ if (count($list_mailbox) > 0) {
echo " <td>" . $row['username'] . "</td>\n";
echo " <td>" . $row['name'] . "</td>\n";
echo " <td>" . $row['modified'] . "</td>\n";
$active = ($row['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
echo " <td><a href=\"edit-active.php?username=" . urlencode($row['username']) . "&domain=$fDomain" . "\">" . $active . "</a></td>\n";
echo " <td><a href=\"edit-mailbox.php?username=" . urlencode($row['username']) . "&domain=$fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n";
echo " <td><a href=\"delete.php?delete=" . urlencode($row['username']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $row['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
echo " <td><a href=\"edit-mailbox.php?username=" . $row['username'] . "&domain=$fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n";
echo " <td><a href=\"delete.php?delete=" . $row['username'] . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $row['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
echo " </tr>\n";
}
echo "</table>\n";

View File

@ -65,12 +65,12 @@ if (count($list_alias) > 0) {
echo " <td>" . $row['modified'] . "</td>\n";
if ($CONF['special_alias_control'] == 'YES') {
echo " <td><a href=\"edit-alias.php?address=" . urlencode($row['address']) . "&domain=fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n";
echo " <td><a href=\"delete.php?delete=" . urlencode($row['address']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $row['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
echo " <td><a href=\"edit-alias.php?address=" . $row['address'] . "&domain=fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n";
echo " <td><a href=\"delete.php?delete=" . $row['address'] . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $row['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
} else {
if (!in_array($row['goto'], $CONF['default_aliases'])) {
echo " <td><a href=\"edit-alias.php?address=" . urlencode($row['address']) . "&domain=fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n";
echo " <td><a href=\"delete.php?delete=" . urlencode($row['address']) . "&domain=fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $row['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
echo " <td><a href=\"edit-alias.php?address=" . $row['address'] . "&domain=fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n";
echo " <td><a href=\"delete.php?delete=" . $row['address'] . "&domain=fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $row['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
} else {
echo " <td>&nbsp;</td>\n";
echo " <td>&nbsp;</td>\n";
@ -101,9 +101,8 @@ if (count($list_mailbox) > 0) {
echo " <td>" . $row['name'] . "</td>\n";
echo " <td>" . $row['modified'] . "</td>\n";
$active = ($row['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
echo " <td><a href=\"edit-active.php?username=" . urlencode($row['username']) . "&domain=$fDomain" . "\">" . $active . "</a></td>\n";
echo " <td><a href=\"edit-mailbox.php?username=" . urlencode($row['username']) . "&domain=$fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n";
echo " <td><a href=\"delete.php?delete=" . urlencode($row['username']) . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $row['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
echo " <td><a href=\"edit-mailbox.php?username=" . $row['username'] . "&domain=$fDomain" . "\">" . $PALANG['edit'] . "</a></td>\n";
echo " <td><a href=\"delete.php?delete=" . $row['username'] . "&domain=$fDomain" . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $row['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
echo " </tr>\n";
}
echo "</table>\n";

View File

@ -23,8 +23,8 @@ if (count($tAlias) > 0) {
print " <td>" . $tAlias[$i]['address'] . "</td>\n";
print " <td>" . preg_replace("/,/", "<br>", $tAlias[$i]['goto']) . "</td>\n";
print " <td>" . $tAlias[$i]['modified'] . "</td>\n";
print " <td><a href=\"edit-alias.php?address=" . urlencode($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
print " <td><a href=\"delete.php?delete=" . urlencode($tAlias[$i]['address']) . "&domain=" . $tAlias[$i]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $tAlias[$i]['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
print " <td><a href=\"edit-alias.php?address=" . $tAlias[$i]['address'] . "&domain=" . $tAlias[$i]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
print " <td><a href=\"delete.php?delete=" . $tAlias[$i]['address'] . "&domain=" . $tAlias[$i]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_aliases'] . ": ". $tAlias[$i]['address'] . "')\">" . $PALANG['del'] . "</a></td>\n";
print " </tr>\n";
}
}
@ -51,12 +51,8 @@ if (count($tMailbox) > 0) {
print " <tr class=\"hilightoff\" onMouseOver=\"className='hilighton';\" onMouseOut=\"className='hilightoff';\">\n";
print " <td>" . $tMailbox[$i]['username'] . "</td>\n";
print " <td>" . $tMailbox[$i]['name'] . "</td>\n";
if ($CONF['quota'] == 'YES') print " <td>" . $tMailbox[$i]['quota'] / $CONF['quota_multiplier'] . "</td>\n";
print " <td>" . $tMailbox[$i]['modified'] . "</td>\n";
$active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
print " <td><a href=\"edit-active.php?username=" . urlencode($tMailbox[$i]['username']) . "&domain=" . $tMailbox[$i]['domain'] . "\">" . $active . "</a></td>\n";
print " <td><a href=\"edit-mailbox.php?username=" . urlencode($tMailbox[$i]['username']) . "&domain=" . $tMailbox[$i]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
print " <td><a href=\"delete.php?delete=" . urlencode($tMailbox[$i]['username']) . "&domain=" . $tMailbox[$i]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $tMailbox[$i]['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
print " <td><a href=\"edit-mailbox.php?username=" . $tMailbox[$i]['username'] . "&domain=" . $tMailbox[$i]['domain'] . "\">" . $PALANG['edit'] . "</a></td>\n";
print " <td><a href=\"delete.php?delete=" . $tMailbox[$i]['username'] . "&domain=" . $tMailbox[$i]['domain'] . "\"onclick=\"return confirm ('" . $PALANG['confirm'] . $PALANG['pOverview_get_mailboxes'] . ": ". $tMailbox[$i]['username'] . "')\">" . $PALANG['del'] . "</a></td>\n";
print " </tr>\n";
}
}