|
|
|
|
@@ -1,4 +1,4 @@
|
|
|
|
|
<?php
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This file is part of the Froxlor project.
|
|
|
|
|
@@ -43,7 +43,7 @@ if ($page == 'overview') {
|
|
|
|
|
'm.destination' => $lng['emails']['forwarders']
|
|
|
|
|
);
|
|
|
|
|
$paging = new paging($userinfo, TABLE_MAIL_VIRTUAL, $fields);
|
|
|
|
|
$result_stmt = Database::prepare('SELECT `m`.`id`, `m`.`domainid`, `m`.`email`, `m`.`email_full`, `m`.`iscatchall`, `u`.`quota`, `m`.`destination`, `m`.`popaccountid`, `d`.`domain`, `u`.`mboxsize` FROM `' . TABLE_MAIL_VIRTUAL . '` `m`
|
|
|
|
|
$result_stmt = Database::prepare('SELECT `m`.`id`, `m`.`domainid`, `m`.`email`, `m`.`email_full`, `m`.`iscatchall`, `u`.`quota`, `m`.`destination`, `m`.`popaccountid`,`m`.`disablegreylist`, `d`.`domain`, `u`.`mboxsize` FROM `' . TABLE_MAIL_VIRTUAL . '` `m`
|
|
|
|
|
LEFT JOIN `' . TABLE_PANEL_DOMAINS . '` `d` ON (`m`.`domainid` = `d`.`id`)
|
|
|
|
|
LEFT JOIN `' . TABLE_MAIL_USERS . '` `u` ON (`m`.`popaccountid` = `u`.`id`)
|
|
|
|
|
WHERE `m`.`customerid`= :customerid ' . $paging->getSqlWhere(true) . " " . $paging->getSqlOrderBy() . " " . $paging->getSqlLimit()
|
|
|
|
|
@@ -227,7 +227,7 @@ if ($page == 'overview') {
|
|
|
|
|
standard_error('emailiswrong', $email_full);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$stmt = Database::prepare("SELECT `id`, `email`, `email_full`, `iscatchall`, `destination`, `customerid` FROM `" . TABLE_MAIL_VIRTUAL . "`
|
|
|
|
|
$stmt = Database::prepare("SELECT `id`, `email`, `email_full`, `iscatchall`, `destination`, `customerid`, `disablegreylist` FROM `" . TABLE_MAIL_VIRTUAL . "`
|
|
|
|
|
WHERE (`email` = :email
|
|
|
|
|
OR `email_full` = :emailfull )
|
|
|
|
|
AND `customerid`= :cid"
|
|
|
|
|
@@ -251,15 +251,16 @@ if ($page == 'overview') {
|
|
|
|
|
standard_error('youhavealreadyacatchallforthisdomain');
|
|
|
|
|
} else {
|
|
|
|
|
$stmt = Database::prepare("INSERT INTO `" . TABLE_MAIL_VIRTUAL . "`
|
|
|
|
|
(`customerid`, `email`, `email_full`, `iscatchall`, `domainid`)
|
|
|
|
|
VALUES (:cid, :email, :email_full, :iscatchall, :domainid)"
|
|
|
|
|
(`customerid`, `email`, `email_full`, `iscatchall`, `domainid`, `disablegreylist`)
|
|
|
|
|
VALUES (:cid, :email, :email_full, :iscatchall, :domainid, :disablegreylist)"
|
|
|
|
|
);
|
|
|
|
|
$params = array(
|
|
|
|
|
"cid" => $userinfo['customerid'],
|
|
|
|
|
"email" => $email,
|
|
|
|
|
"email_full" => $email_full,
|
|
|
|
|
"iscatchall" => $iscatchall,
|
|
|
|
|
"domainid" => $domain_check['id']
|
|
|
|
|
"domainid" => $domain_check['id'],
|
|
|
|
|
"disablegreylist" => $disablegreylist,
|
|
|
|
|
);
|
|
|
|
|
Database::pexecute($stmt, $params);
|
|
|
|
|
|
|
|
|
|
@@ -305,7 +306,7 @@ if ($page == 'overview') {
|
|
|
|
|
standard_error('allresourcesused');
|
|
|
|
|
}
|
|
|
|
|
} elseif ($action == 'edit' && $id != 0) {
|
|
|
|
|
$stmt = Database::prepare("SELECT `v`.`id`, `v`.`email`, `v`.`email_full`, `v`.`iscatchall`, `v`.`destination`, `v`.`customerid`, `v`.`popaccountid`, `u`.`quota`
|
|
|
|
|
$stmt = Database::prepare("SELECT `v`.`id`, `v`.`email`, `v`.`email_full`, `v`.`iscatchall`, `v`.`destination`, `v`.`customerid`, `v`.`popaccountid`, `v`.`disablegreylist`, u`.`quota`
|
|
|
|
|
FROM `" . TABLE_MAIL_VIRTUAL . "` `v`
|
|
|
|
|
LEFT JOIN `" . TABLE_MAIL_USERS . "` `u`
|
|
|
|
|
ON(`v`.`popaccountid` = `u`.`id`)
|
|
|
|
|
@@ -402,6 +403,32 @@ if ($page == 'overview') {
|
|
|
|
|
} else {
|
|
|
|
|
standard_error(array('operationnotpermitted', 'featureisdisabled'), 'Catchall');
|
|
|
|
|
}
|
|
|
|
|
} elseif ($action == 'togglegreylist' && $id != 0) {
|
|
|
|
|
//if (Settings::Get('catchall.catchall_enabled') == '1') {
|
|
|
|
|
$stmt = Database::prepare("SELECT `id`, `email`, `email_full`, `destination`, `customerid`, `popaccountid`, `disablegreylist` FROM `" . TABLE_MAIL_VIRTUAL . "`
|
|
|
|
|
WHERE `customerid`= :cid
|
|
|
|
|
AND `id`= :id"
|
|
|
|
|
);
|
|
|
|
|
$result = Database::pexecute_first($stmt, array("cid" => $userinfo['customerid'], "id" => $id));
|
|
|
|
|
$gr_val = $result['disablegreylist'] == 0 ? 1 : 0;
|
|
|
|
|
if (isset($result['email']) && $result['email'] != '') {
|
|
|
|
|
$stmt = Database::prepare("UPDATE `" . TABLE_MAIL_VIRTUAL . "`
|
|
|
|
|
SET `email` = :email, `disablegreylist` = :gr_val
|
|
|
|
|
WHERE `customerid`= :cid
|
|
|
|
|
AND `id`= :id"
|
|
|
|
|
);
|
|
|
|
|
$params = array(
|
|
|
|
|
"email" => $result['email_full'],
|
|
|
|
|
"cid" => $userinfo['customerid'],
|
|
|
|
|
"id" => $id,
|
|
|
|
|
"gr_val" => $gr_val,
|
|
|
|
|
);
|
|
|
|
|
Database::pexecute($stmt, $params);
|
|
|
|
|
redirectTo($filename, array('page' => $page, 'action' => 'edit', 'id' => $id, 's' => $s));
|
|
|
|
|
}
|
|
|
|
|
// } else {
|
|
|
|
|
// standard_error(array('operationnotpermitted', 'featureisdisabled'), 'Greylisting');
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
} elseif ($page == 'accounts') {
|
|
|
|
|
if ($action == 'add' && $id != 0) {
|
|
|
|
|
|