From 1c10461fa74ea64658ef0ede4e68e2d76847bde6 Mon Sep 17 00:00:00 2001 From: mischa Date: Sat, 3 Sep 2022 08:44:32 +0000 Subject: [PATCH] strip urlencode / active from templates --- admin/add-alias.php | 26 +++++----- admin/add-mailbox.php | 34 ++++++------- admin/admin.php | 45 +++++++++--------- admin/delete.php | 14 +++--- admin/domain.php | 33 ++++++------- admin/list-virtual.php-orig | 61 ------------------------ admin/search.php | 82 +++++++++----------------------- functions.inc.php | 9 ++-- languages/en.lang | 44 ++++++++--------- templates/admin_admin.tpl | 20 +++++--- templates/admin_domain.tpl | 18 +++---- templates/admin_edit-admin.tpl | 5 -- templates/admin_list-admin.tpl | 1 - templates/admin_list-domain.tpl | 1 - templates/admin_list-virtual.tpl | 9 ++-- templates/admin_search.tpl | 46 +++++++----------- templates/list-virtuals.tpl | 14 +++--- templates/overview.tpl | 13 +++-- templates/search.tpl | 12 ++--- 19 files changed, 181 insertions(+), 306 deletions(-) delete mode 100644 admin/list-virtual.php-orig diff --git a/admin/add-alias.php b/admin/add-alias.php index 031d7f3..bc082f0 100644 --- a/admin/add-alias.php +++ b/admin/add-alias.php @@ -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'; ?> diff --git a/admin/add-mailbox.php b/admin/add-mailbox.php index 1de342c..96b35f9 100644 --- a/admin/add-mailbox.php +++ b/admin/add-mailbox.php @@ -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'; ?> diff --git a/admin/admin.php b/admin/admin.php index e6f9a42..f146bdd 100644 --- a/admin/admin.php +++ b/admin/admin.php @@ -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'] . "
($username)
"; + $message = $PALANG['pAdminAdd_admin_result_succes'] . "
($username)
"; } catch(PDOException $e) { - $message = $PALANG['pAdminCreate_admin_result_error'] . "
($username)
"; + $message = $PALANG['pAdminAdd_admin_result_error'] . "
($username)
"; } } } 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'; ?> diff --git a/admin/delete.php b/admin/delete.php index 962de78..6168a4c 100644 --- a/admin/delete.php +++ b/admin/delete.php @@ -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'; ?> diff --git a/admin/domain.php b/admin/domain.php index 2e24f6e..cbc691e 100644 --- a/admin/domain.php +++ b/admin/domain.php @@ -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'] . "
($domain)
"; + $message = $PALANG['pAdminAdd_domain_result_succes'] . "
($domain)
"; } catch(PDOException $e) { - $message = $PALANG['pAdminCreate_domain_result_error'] . "
($domain)
"; + $message = $PALANG['pAdminAdd_domain_result_error'] . "
($domain)
"; } } 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') { diff --git a/admin/list-virtual.php-orig b/admin/list-virtual.php-orig deleted file mode 100644 index 4896fad..0000000 --- a/admin/list-virtual.php-orig +++ /dev/null @@ -1,61 +0,0 @@ - -// 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'; -?> diff --git a/admin/search.php b/admin/search.php index a600b2e..784210a 100644 --- a/admin/search.php +++ b/admin/search.php @@ -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"; - } 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; - } - } + $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 { + $list_alias = array(); + $list_mailbox = array(); } -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'; ?> diff --git a/functions.inc.php b/functions.inc.php index 04de3e1..a349b60 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -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; } // @@ -176,7 +173,7 @@ function list_domains($username = null) { $sth = $dbh->prepare('SELECT * FROM domain ORDER BY domain'); } $sth->execute(); - $list= $sth->fetchAll(); + $list = $sth->fetchAll(); for ($i = 0; $i < count($list); $i++) { $sth = $dbh->prepare("SELECT COUNT(*) FROM alias WHERE domain=? AND goto NOT IN ('vmail')"); diff --git a/languages/en.lang b/languages/en.lang index f3f27ad..9577580 100644 --- a/languages/en.lang +++ b/languages/en.lang @@ -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'] = 'The domain already exists.'; -$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'] = 'Unable to add domain.'; -$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'] = 'The domain already exists.'; +$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'] = 'Unable to add domain.'; +$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'] = 'Unable to modify domain.'; -$PALANG['pAdminCreate_admin_welcome'] = 'Add a new domain admin'; -$PALANG['pAdminCreate_admin_username'] = 'Admin (email address)'; -$PALANG['pAdminCreate_admin_username_error'] = 'Admin already exists or is not valid.'; -$PALANG['pAdminCreate_admin_password1'] = 'Password'; -$PALANG['pAdminCreate_admin_password2'] = 'Password (again)'; -$PALANG['pAdminCreate_admin_password_error'] = 'The passwords you supplied don\'t match, or are empty.'; -$PALANG['pAdminCreate_admin_domain_error'] = 'No domains selected.'; -$PALANG['pAdminCreate_admin_button'] = 'Add Admin'; -$PALANG['pAdminCreate_admin_result_error'] = 'Unable to add admin.'; -$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'] = 'Admin already exists or is not valid.'; +$PALANG['pAdminAdd_admin_password1'] = 'Password'; +$PALANG['pAdminAdd_admin_password2'] = 'Password (again)'; +$PALANG['pAdminAdd_admin_password_error'] = 'The passwords you supplied don\'t match, or are empty.'; +$PALANG['pAdminAdd_admin_domain_error'] = 'No domains selected.'; +$PALANG['pAdminAdd_admin_button'] = 'Add Admin'; +$PALANG['pAdminAdd_admin_result_error'] = 'Unable to add admin.'; +$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'; diff --git a/templates/admin_admin.tpl b/templates/admin_admin.tpl index 25b8a7c..6b2d2d4 100644 --- a/templates/admin_admin.tpl +++ b/templates/admin_admin.tpl @@ -2,22 +2,30 @@
- + + + + + - + + + + + - + - + - + - + diff --git a/templates/admin_domain.tpl b/templates/admin_domain.tpl index 2071a1d..b019d6b 100644 --- a/templates/admin_domain.tpl +++ b/templates/admin_domain.tpl @@ -5,35 +5,35 @@ - + - + - + - + - + - + - + - + - + diff --git a/templates/admin_edit-admin.tpl b/templates/admin_edit-admin.tpl index e679e27..3c30391 100644 --- a/templates/admin_edit-admin.tpl +++ b/templates/admin_edit-admin.tpl @@ -18,11 +18,6 @@ - - - - - "; echo " "; echo " "; - $active = ($row['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; echo " "; echo " "; echo " \n"; diff --git a/templates/admin_list-domain.tpl b/templates/admin_list-domain.tpl index 18a57a0..e1fb439 100644 --- a/templates/admin_list-domain.tpl +++ b/templates/admin_list-domain.tpl @@ -35,7 +35,6 @@ if (count($list_domains) > 0) { echo ""; echo ""; echo ""; - $active = ($row['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; echo ""; echo ""; echo "\n"; diff --git a/templates/admin_list-virtual.tpl b/templates/admin_list-virtual.tpl index c1ae8e2..3e01f1e 100644 --- a/templates/admin_list-virtual.tpl +++ b/templates/admin_list-virtual.tpl @@ -40,7 +40,6 @@ if ($list_domains[$selected_domain]['alias_count'] > $limit || $list_domains[$se } echo "\n"; } - if (count($list_alias) > 0) { print "

 
 
 
> 
" . $row['username'] . "" . $row['domain_count'] . "" . $row['modified'] . "" . $PALANG['edit'] . "" . $PALANG['del'] . "
" . $row['alias_count'] . " / " . $row['aliases'] . "" . $row['mailbox_count'] . " / " . $row['mailboxes'] . "" . $row['modified'] . "" . $PALANG['edit'] . "" . $PALANG['del'] . "
\n"; print " \n"; @@ -58,8 +57,8 @@ if (count($list_alias) > 0) { print " \n"; print " \n"; print " \n"; - print " \n"; - print " \n"; + print " \n"; + print " \n"; print " \n"; } print "
" . $row['address'] . "" . preg_replace("/,/", "
", $row['goto']) . "
" . $row['modified'] . "" . $PALANG['edit'] . "" . $PALANG['del'] . "" . $PALANG['edit'] . "" . $PALANG['del'] . "
\n"; @@ -82,8 +81,8 @@ if (count($list_mailbox) > 0) { print " " . $row['username'] . "\n"; print " " . $row['name'] . "\n"; print " " . $row['modified'] . "\n"; - print " " . $PALANG['edit'] . "\n"; - print " " . $PALANG['del'] . "\n"; + print " " . $PALANG['edit'] . "\n"; + print " " . $PALANG['del'] . "\n"; print " \n"; } print "\n"; diff --git a/templates/admin_search.tpl b/templates/admin_search.tpl index 4d0cc58..9c020e1 100644 --- a/templates/admin_search.tpl +++ b/templates/admin_search.tpl @@ -1,11 +1,11 @@
-

+

0) { +if (count($list_alias) > 0) { print "\n"; print " \n"; print " "; @@ -17,21 +17,19 @@ if (count($tAlias) > 0) { print " \n"; print " \n"; - for ($i = 0; $i < count($tAlias); $i++) { - if ((is_array($tAlias) and count($tAlias) > 0)) { - print " \n"; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - } + foreach ($list_alias as $row) { + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; } print "

".$PALANG['pOverview_alias_title']."

 
" . $tAlias[$i]['address'] . "" . preg_replace("/,/", "
", $tAlias[$i]['goto']) . "
" . $tAlias[$i]['modified'] . "" . $PALANG['edit'] . "" . $PALANG['del'] . "
" . $row['address'] . "" . preg_replace("/,/", "
", $row['goto']) . "
" . $row['modified'] . "" . $PALANG['edit'] . "" . $PALANG['del'] . "
\n"; } -if (count($tMailbox) > 0) { +if (count($list_mailbox) > 0) { print "\n"; print " \n"; print " "; @@ -39,25 +37,17 @@ if (count($tMailbox) > 0) { print " \n"; print " \n"; print " \n"; - if ($CONF['quota'] == 'YES') print " \n"; print " \n"; - print " \n"; print " \n"; print " \n"; - for ($i = 0; $i < count($tMailbox); $i++) { - if ((is_array($tMailbox) and count($tMailbox) > 0)) { - print " \n"; - print " \n"; - print " \n"; - if ($CONF['quota'] == 'YES') print " \n"; - print " \n"; - $active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; - print " \n"; - print " \n"; - print " \n"; - print " \n"; - } + foreach ($list_mailbox as $row) { + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; } print "

".$PALANG['pOverview_mailbox_title']."

" . $PALANG['pOverview_mailbox_username'] . "" . $PALANG['pOverview_mailbox_name'] . "" . $PALANG['pOverview_mailbox_quota'] . "" . $PALANG['pOverview_mailbox_modified'] . "" . $PALANG['pOverview_mailbox_active'] . " 
" . $tMailbox[$i]['username'] . "" . $tMailbox[$i]['name'] . "" . $tMailbox[$i]['quota'] / $CONF['quota_multiplier'] . "" . $tMailbox[$i]['modified'] . "" . $active . "" . $PALANG['edit'] . "" . $PALANG['del'] . "
" . $row['username'] . "" . $row['name'] . "" . $PALANG['edit'] . "" . $PALANG['del'] . "
\n"; } diff --git a/templates/list-virtuals.tpl b/templates/list-virtuals.tpl index 54fc7f6..9b5e583 100644 --- a/templates/list-virtuals.tpl +++ b/templates/list-virtuals.tpl @@ -65,12 +65,12 @@ if (count($list_alias) > 0) { echo " " . $row['modified'] . "\n"; if ($CONF['special_alias_control'] == 'YES') { - echo " " . $PALANG['edit'] . "\n"; - echo " " . $PALANG['del'] . "\n"; + echo " " . $PALANG['edit'] . "\n"; + echo " " . $PALANG['del'] . "\n"; } else { if (!in_array($row['goto'], $CONF['default_aliases'])) { - echo " " . $PALANG['edit'] . "\n"; - echo " " . $PALANG['del'] . "\n"; + echo " " . $PALANG['edit'] . "\n"; + echo " " . $PALANG['del'] . "\n"; } else { echo "  \n"; echo "  \n"; @@ -100,10 +100,8 @@ if (count($list_mailbox) > 0) { echo " " . $row['username'] . "\n"; echo " " . $row['name'] . "\n"; echo " " . $row['modified'] . "\n"; - $active = ($row['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; - echo " " . $active . "\n"; - echo " " . $PALANG['edit'] . "\n"; - echo " " . $PALANG['del'] . "\n"; + echo " " . $PALANG['edit'] . "\n"; + echo " " . $PALANG['del'] . "\n"; echo " \n"; } echo "\n"; diff --git a/templates/overview.tpl b/templates/overview.tpl index 60992c2..c038161 100644 --- a/templates/overview.tpl +++ b/templates/overview.tpl @@ -65,12 +65,12 @@ if (count($list_alias) > 0) { echo " " . $row['modified'] . "\n"; if ($CONF['special_alias_control'] == 'YES') { - echo " " . $PALANG['edit'] . "\n"; - echo " " . $PALANG['del'] . "\n"; + echo " " . $PALANG['edit'] . "\n"; + echo " " . $PALANG['del'] . "\n"; } else { if (!in_array($row['goto'], $CONF['default_aliases'])) { - echo " " . $PALANG['edit'] . "\n"; - echo " " . $PALANG['del'] . "\n"; + echo " " . $PALANG['edit'] . "\n"; + echo " " . $PALANG['del'] . "\n"; } else { echo "  \n"; echo "  \n"; @@ -101,9 +101,8 @@ if (count($list_mailbox) > 0) { echo " " . $row['name'] . "\n"; echo " " . $row['modified'] . "\n"; $active = ($row['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; - echo " " . $active . "\n"; - echo " " . $PALANG['edit'] . "\n"; - echo " " . $PALANG['del'] . "\n"; + echo " " . $PALANG['edit'] . "\n"; + echo " " . $PALANG['del'] . "\n"; echo " \n"; } echo "\n"; diff --git a/templates/search.tpl b/templates/search.tpl index 58386c3..1c7911d 100644 --- a/templates/search.tpl +++ b/templates/search.tpl @@ -23,8 +23,8 @@ if (count($tAlias) > 0) { print " " . $tAlias[$i]['address'] . "\n"; print " " . preg_replace("/,/", "
", $tAlias[$i]['goto']) . "\n"; print " " . $tAlias[$i]['modified'] . "\n"; - print " " . $PALANG['edit'] . "\n"; - print " " . $PALANG['del'] . "\n"; + print " " . $PALANG['edit'] . "\n"; + print " " . $PALANG['del'] . "\n"; print " \n"; } } @@ -51,12 +51,8 @@ if (count($tMailbox) > 0) { print " \n"; print " " . $tMailbox[$i]['username'] . "\n"; print " " . $tMailbox[$i]['name'] . "\n"; - if ($CONF['quota'] == 'YES') print " " . $tMailbox[$i]['quota'] / $CONF['quota_multiplier'] . "\n"; - print " " . $tMailbox[$i]['modified'] . "\n"; - $active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; - print " " . $active . "\n"; - print " " . $PALANG['edit'] . "\n"; - print " " . $PALANG['del'] . "\n"; + print " " . $PALANG['edit'] . "\n"; + print " " . $PALANG['del'] . "\n"; print " \n"; } }