clean up
This commit is contained in:
parent
f4071a612a
commit
36ef6f7c64
|
@ -16,7 +16,7 @@
|
||||||
// domain
|
// domain
|
||||||
// goto
|
// goto
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// address
|
// address
|
||||||
// domain
|
// domain
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
// name
|
// name
|
||||||
// domain
|
// domain
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// username
|
// username
|
||||||
// password1
|
// password1
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
// domain
|
// domain
|
||||||
// goto
|
// goto
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// address
|
// address
|
||||||
// domain
|
// domain
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
// name
|
// name
|
||||||
// domain
|
// domain
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// username
|
// username
|
||||||
// password1
|
// password1
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
// username
|
// username
|
||||||
// domains
|
// domains
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// username
|
// username
|
||||||
// password1
|
// password1
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//
|
//
|
||||||
// -none-
|
// -none-
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// -none-
|
// -none-
|
||||||
//
|
//
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//
|
//
|
||||||
// message
|
// message
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// table
|
// table
|
||||||
// where
|
// where
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
// aliases
|
// aliases
|
||||||
// mailboxes
|
// mailboxes
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// domain
|
// domain
|
||||||
// description
|
// description
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
// message
|
// message
|
||||||
// goto
|
// goto
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// address
|
// address
|
||||||
// domain
|
// domain
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
// message
|
// message
|
||||||
// name
|
// name
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// username
|
// username
|
||||||
// domain
|
// domain
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//
|
//
|
||||||
// -none-
|
// -none-
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// -none-
|
// -none-
|
||||||
//
|
//
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//
|
//
|
||||||
// list_admins
|
// list_admins
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// -none-
|
// -none-
|
||||||
//
|
//
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//
|
//
|
||||||
// list_domains
|
// list_domains
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// username
|
// username
|
||||||
//
|
//
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
// list_alias
|
// list_alias
|
||||||
// list_mailbox
|
// list_mailbox
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// domain
|
// domain
|
||||||
// offset
|
// offset
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
// list_alias
|
// list_alias
|
||||||
// list_mailbox
|
// list_mailbox
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// search
|
// search
|
||||||
//
|
//
|
||||||
|
@ -23,34 +23,35 @@ include '../languages/' . check_language() . '.lang';
|
||||||
|
|
||||||
$list_domains = list_domains();
|
$list_domains = list_domains();
|
||||||
|
|
||||||
$search = filter_input(INPUT_POST, 'search', FILTER_DEFAULT);
|
if ($_SERVER['REQUEST_METHOD'] == "POST") {
|
||||||
|
$search = filter_input(INPUT_POST, 'search', FILTER_DEFAULT);
|
||||||
|
|
||||||
if (isset($search)) {
|
if (isset($search)) {
|
||||||
$dbh = pdo_connect();
|
$dbh = pdo_connect();
|
||||||
$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 = $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->bindValue(1, '%'.$search.'%', PDO::PARAM_STR);
|
||||||
$sth->execute();
|
$sth->execute();
|
||||||
$list_alias = $sth->fetchAll();
|
$list_alias = $sth->fetchAll();
|
||||||
foreach ($list_alias as $key => $value) {
|
foreach ($list_alias as $key => $value) {
|
||||||
if (!in_array($value['domain'], array_column($list_domains, 'domain'))) {
|
if (!in_array($value['domain'], array_column($list_domains, 'domain'))) {
|
||||||
unset($list_alias[$key]);
|
unset($list_alias[$key]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$sth = $dbh->prepare("SELECT * FROM mailbox WHERE username LIKE ? ORDER BY username");
|
$sth = $dbh->prepare("SELECT * FROM mailbox WHERE username LIKE ? ORDER BY username");
|
||||||
$sth->bindValue(1, '%'.$search.'%', PDO::PARAM_STR);
|
$sth->bindValue(1, '%'.$search.'%', PDO::PARAM_STR);
|
||||||
$sth->execute();
|
$sth->execute();
|
||||||
$list_mailbox = $sth->fetchAll();
|
$list_mailbox = $sth->fetchAll();
|
||||||
foreach ($list_mailbox as $key => $value) {
|
foreach ($list_mailbox as $key => $value) {
|
||||||
if (!in_array($value['domain'], array_column($list_domains, 'domain'))) {
|
if (!in_array($value['domain'], array_column($list_domains, 'domain'))) {
|
||||||
unset($list_mailbox[$key]);
|
unset($list_mailbox[$key]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$list_alias = array();
|
||||||
|
$list_mailbox = array();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$list_alias = array();
|
|
||||||
$list_mailbox = array();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
include '../templates/header.tpl';
|
include '../templates/header.tpl';
|
||||||
include '../templates/admin_menu.tpl';
|
include '../templates/admin_menu.tpl';
|
||||||
include '../templates/search.tpl';
|
include '../templates/search.tpl';
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//
|
//
|
||||||
// log
|
// log
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// domain
|
// domain
|
||||||
//
|
//
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//
|
//
|
||||||
// message
|
// message
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// table
|
// table
|
||||||
// where
|
// where
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
// message
|
// message
|
||||||
// goto
|
// goto
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// address
|
// address
|
||||||
// domain
|
// domain
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
// message
|
// message
|
||||||
// name
|
// name
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// username
|
// username
|
||||||
// domain
|
// domain
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//
|
//
|
||||||
// -none-
|
// -none-
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// -none-
|
// -none-
|
||||||
//
|
//
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
// list_alias
|
// list_alias
|
||||||
// list_mailbox
|
// list_mailbox
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// domain
|
// domain
|
||||||
// offset
|
// offset
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//
|
//
|
||||||
// -none-
|
// -none-
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// -none-
|
// -none-
|
||||||
//
|
//
|
||||||
|
|
2
main.php
2
main.php
|
@ -13,7 +13,7 @@
|
||||||
//
|
//
|
||||||
// -none-
|
// -none-
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// -none-
|
// -none-
|
||||||
//
|
//
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//
|
//
|
||||||
// message
|
// message
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// password_current
|
// password_current
|
||||||
// password1
|
// password1
|
||||||
|
|
47
search.php
47
search.php
|
@ -14,7 +14,7 @@
|
||||||
// list_alias
|
// list_alias
|
||||||
// list_mailbox
|
// list_mailbox
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// search
|
// search
|
||||||
//
|
//
|
||||||
|
@ -24,34 +24,35 @@ include './languages/' . check_language() . '.lang';
|
||||||
$SESSID_USERNAME = check_session();
|
$SESSID_USERNAME = check_session();
|
||||||
$list_domains = list_domains($SESSID_USERNAME);
|
$list_domains = list_domains($SESSID_USERNAME);
|
||||||
|
|
||||||
$search = filter_input(INPUT_POST, 'search', FILTER_DEFAULT);
|
if ($_SERVER['REQUEST_METHOD'] == "POST") {
|
||||||
|
$search = filter_input(INPUT_POST, 'search', FILTER_DEFAULT);
|
||||||
|
|
||||||
if (isset($search)) {
|
if (isset($search)) {
|
||||||
$dbh = pdo_connect();
|
$dbh = pdo_connect();
|
||||||
$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 = $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->bindValue(1, '%'.$search.'%', PDO::PARAM_STR);
|
||||||
$sth->execute();
|
$sth->execute();
|
||||||
$list_alias = $sth->fetchAll();
|
$list_alias = $sth->fetchAll();
|
||||||
foreach ($list_alias as $key => $value) {
|
foreach ($list_alias as $key => $value) {
|
||||||
if (!in_array($value['domain'], array_column($list_domains, 'domain'))) {
|
if (!in_array($value['domain'], array_column($list_domains, 'domain'))) {
|
||||||
unset($list_alias[$key]);
|
unset($list_alias[$key]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$sth = $dbh->prepare("SELECT * FROM mailbox WHERE username LIKE ? ORDER BY username");
|
$sth = $dbh->prepare("SELECT * FROM mailbox WHERE username LIKE ? ORDER BY username");
|
||||||
$sth->bindValue(1, '%'.$search.'%', PDO::PARAM_STR);
|
$sth->bindValue(1, '%'.$search.'%', PDO::PARAM_STR);
|
||||||
$sth->execute();
|
$sth->execute();
|
||||||
$list_mailbox = $sth->fetchAll();
|
$list_mailbox = $sth->fetchAll();
|
||||||
foreach ($list_mailbox as $key => $value) {
|
foreach ($list_mailbox as $key => $value) {
|
||||||
if (!in_array($value['domain'], array_column($list_domains, 'domain'))) {
|
if (!in_array($value['domain'], array_column($list_domains, 'domain'))) {
|
||||||
unset($list_mailbox[$key]);
|
unset($list_mailbox[$key]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$list_alias = array();
|
||||||
|
$list_mailbox = array();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$list_alias = array();
|
|
||||||
$list_mailbox = array();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
include './templates/header.tpl';
|
include './templates/header.tpl';
|
||||||
include './templates/menu.tpl';
|
include './templates/menu.tpl';
|
||||||
include './templates/search.tpl';
|
include './templates/search.tpl';
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
// subject
|
// subject
|
||||||
// body
|
// body
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// to
|
// to
|
||||||
// subject
|
// subject
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//
|
//
|
||||||
// -none-
|
// -none-
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// -none-
|
// -none-
|
||||||
//
|
//
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//
|
//
|
||||||
// -none-
|
// -none-
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// -none-
|
// -none-
|
||||||
//
|
//
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//
|
//
|
||||||
// -none-
|
// -none-
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// -none-
|
// -none-
|
||||||
//
|
//
|
||||||
|
@ -27,3 +27,4 @@ include '../templates/header.tpl';
|
||||||
include '../templates/users_menu.tpl';
|
include '../templates/users_menu.tpl';
|
||||||
include '../templates/users_main.tpl';
|
include '../templates/users_main.tpl';
|
||||||
include '../templates/footer.tpl';
|
include '../templates/footer.tpl';
|
||||||
|
?>
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//
|
//
|
||||||
// message
|
// message
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// password_current
|
// password_current
|
||||||
// password1
|
// password1
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
// tSubject
|
// tSubject
|
||||||
// tBody
|
// tBody
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// fSubject
|
// fSubject
|
||||||
// fBody
|
// fBody
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//
|
//
|
||||||
// log
|
// log
|
||||||
//
|
//
|
||||||
// Form POST \ GET Variables:
|
// Form POST / GET Variables:
|
||||||
//
|
//
|
||||||
// domain
|
// domain
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue