major refactoring of almost all files
This commit is contained in:
@@ -2,20 +2,27 @@
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* For the full copyright and license information, please view the COPYING
|
||||
* file that was distributed with this source code. You can also view the
|
||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* @copyright (c) the authors
|
||||
* @author Florian Lippert <flo@syscp.org> (2003-2009)
|
||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||
* @package Panel
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you can also view it online at
|
||||
* https://files.froxlor.org/misc/COPYING.txt
|
||||
*
|
||||
* @copyright the authors
|
||||
* @author Froxlor team <team@froxlor.org>
|
||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||
*/
|
||||
|
||||
const AREA = 'customer';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
@@ -23,27 +30,34 @@ use Froxlor\Api\Commands\EmailAccounts as EmailAccounts;
|
||||
use Froxlor\Api\Commands\EmailForwarders as EmailForwarders;
|
||||
use Froxlor\Api\Commands\Emails as Emails;
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\PhpHelper;
|
||||
use Froxlor\Settings;
|
||||
use Froxlor\UI\Collection;
|
||||
use Froxlor\UI\HTML;
|
||||
use Froxlor\UI\Listing;
|
||||
use Froxlor\UI\Panel\UI;
|
||||
use Froxlor\UI\Request;
|
||||
use Froxlor\UI\Response;
|
||||
use Froxlor\Validate\Check;
|
||||
|
||||
// redirect if this customer page is hidden via settings
|
||||
if (Settings::IsInList('panel.customer_hide_options', 'email')) {
|
||||
\Froxlor\UI\Response::redirectTo('customer_index.php');
|
||||
Response::redirectTo('customer_index.php');
|
||||
}
|
||||
|
||||
$id = (int) Request::get('id');
|
||||
$id = (int)Request::get('id');
|
||||
|
||||
if ($page == 'overview' || $page == 'emails') {
|
||||
if ($action == '') {
|
||||
$log->logAction(\Froxlor\FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_email::emails");
|
||||
$log->logAction(FroxlorLogger::USR_ACTION, LOG_NOTICE, "viewed customer_email::emails");
|
||||
|
||||
try {
|
||||
$email_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/customer/tablelisting.emails.php';
|
||||
$collection = (new \Froxlor\UI\Collection(\Froxlor\Api\Commands\Emails::class, $userinfo))
|
||||
$collection = (new Collection(Emails::class, $userinfo))
|
||||
->withPagination($email_list_data['email_list']['columns']);
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
|
||||
$result_stmt = Database::prepare("
|
||||
@@ -51,58 +65,60 @@ if ($page == 'overview' || $page == 'emails') {
|
||||
FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `customerid`= :cid AND `isemaildomain` = '1'
|
||||
");
|
||||
$result2 = Database::pexecute_first($result_stmt, array(
|
||||
$result2 = Database::pexecute_first($result_stmt, [
|
||||
"cid" => $userinfo['customerid']
|
||||
));
|
||||
]);
|
||||
$emaildomains_count = $result2['emaildomains'];
|
||||
|
||||
$actions_links = false;
|
||||
if (($userinfo['emails_used'] < $userinfo['emails'] || $userinfo['emails'] == '-1') && $emaildomains_count != 0) {
|
||||
$actions_links = [[
|
||||
'href' => $linker->getLink(['section' => 'email', 'page' => $page, 'action' => 'add']),
|
||||
'label' => $lng['emails']['emails_add']
|
||||
]];
|
||||
$actions_links = [
|
||||
[
|
||||
'href' => $linker->getLink(['section' => 'email', 'page' => $page, 'action' => 'add']),
|
||||
'label' => lng('emails.emails_add')
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
UI::view('user/table.html.twig', [
|
||||
'listing' => \Froxlor\UI\Listing::format($collection, $email_list_data, 'email_list') ,
|
||||
'listing' => Listing::format($collection, $email_list_data, 'email_list'),
|
||||
'actions_links' => $actions_links,
|
||||
'entity_info' => $lng['emails']['description']
|
||||
'entity_info' => lng('emails.description')
|
||||
]);
|
||||
} elseif ($action == 'delete' && $id != 0) {
|
||||
try {
|
||||
$json_result = Emails::getLocal($userinfo, array(
|
||||
$json_result = Emails::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
))->get();
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
if (isset($result['email']) && $result['email'] != '') {
|
||||
if (isset($_POST['send']) && $_POST['send'] == 'send') {
|
||||
try {
|
||||
Emails::getLocal($userinfo, array(
|
||||
Emails::getLocal($userinfo, [
|
||||
'id' => $id,
|
||||
'delete_userfiles' => ($_POST['delete_userfiles'] ?? 0)
|
||||
))->delete();
|
||||
])->delete();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
\Froxlor\UI\Response::redirectTo($filename, array(
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page
|
||||
));
|
||||
]);
|
||||
} else {
|
||||
if ($result['popaccountid'] != '0') {
|
||||
$show_checkbox = true;
|
||||
} else {
|
||||
$show_checkbox = false;
|
||||
}
|
||||
\Froxlor\UI\HTML::askYesNoWithCheckbox('email_reallydelete', 'admin_customer_alsoremovemail', $filename, array(
|
||||
HTML::askYesNoWithCheckbox('email_reallydelete', 'admin_customer_alsoremovemail', $filename, [
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
), $idna_convert->decode($result['email_full']), $show_checkbox);
|
||||
], $idna_convert->decode($result['email_full']), $show_checkbox);
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'add') {
|
||||
@@ -111,22 +127,22 @@ if ($page == 'overview' || $page == 'emails') {
|
||||
try {
|
||||
$json_result = Emails::getLocal($userinfo, $_POST)->add();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
\Froxlor\UI\Response::redirectTo($filename, array(
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page,
|
||||
'action' => 'edit',
|
||||
'id' => $result['id']
|
||||
));
|
||||
]);
|
||||
} else {
|
||||
$result_stmt = Database::prepare("SELECT `id`, `domain`, `customerid` FROM `" . TABLE_PANEL_DOMAINS . "`
|
||||
WHERE `customerid`= :cid
|
||||
AND `isemaildomain`='1'
|
||||
ORDER BY `domain_ace` ASC");
|
||||
Database::pexecute($result_stmt, array(
|
||||
Database::pexecute($result_stmt, [
|
||||
"cid" => $userinfo['customerid']
|
||||
));
|
||||
]);
|
||||
$domains = [];
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$domains[$row['domain']] = $idna_convert->decode($row['domain']);
|
||||
@@ -139,23 +155,23 @@ if ($page == 'overview' || $page == 'emails') {
|
||||
unset($email_add_data['emails_add']['sections']['section_a']['fields']['iscatchall']);
|
||||
}
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(array('section' => 'email')),
|
||||
'formaction' => $linker->getLink(['section' => 'email']),
|
||||
'formdata' => $email_add_data['emails_add']
|
||||
]);
|
||||
} else {
|
||||
\Froxlor\UI\Response::standard_error('noemaildomainaddedyet');
|
||||
Response::standardError('noemaildomainaddedyet');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
\Froxlor\UI\Response::standard_error('allresourcesused');
|
||||
Response::standardError('allresourcesused');
|
||||
}
|
||||
} elseif ($action == 'edit' && $id != 0) {
|
||||
try {
|
||||
$json_result = Emails::getLocal($userinfo, array(
|
||||
$json_result = Emails::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
))->get();
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
@@ -172,8 +188,14 @@ if ($page == 'overview' || $page == 'emails') {
|
||||
if ($destination != $result['email_full'] && $destination != '') {
|
||||
$forwarders[] = [
|
||||
'item' => $destination,
|
||||
'href' => $linker->getLink(array('section' => 'email', 'page' => 'forwarders', 'action' => 'delete', 'id' => $id, 'forwarderid' => $dest_id)),
|
||||
'label' => $lng['panel']['delete'],
|
||||
'href' => $linker->getLink([
|
||||
'section' => 'email',
|
||||
'page' => 'forwarders',
|
||||
'action' => 'delete',
|
||||
'id' => $id,
|
||||
'forwarderid' => $dest_id
|
||||
]),
|
||||
'label' => lng('panel.delete'),
|
||||
'classes' => 'btn btn-sm btn-danger'
|
||||
];
|
||||
$forwarders_count++;
|
||||
@@ -182,7 +204,7 @@ if ($page == 'overview' || $page == 'emails') {
|
||||
}
|
||||
|
||||
$destinations_count = count($result['destination']);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
$result = PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$email_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_edit.php';
|
||||
|
||||
@@ -191,44 +213,44 @@ if ($page == 'overview' || $page == 'emails') {
|
||||
}
|
||||
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(array('section' => 'email')),
|
||||
'formaction' => $linker->getLink(['section' => 'email']),
|
||||
'formdata' => $email_edit_data['emails_edit'],
|
||||
'editid' => $id
|
||||
]);
|
||||
}
|
||||
} elseif ($action == 'togglecatchall' && $id != 0) {
|
||||
try {
|
||||
$json_result = Emails::getLocal($userinfo, array(
|
||||
$json_result = Emails::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
))->get();
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
try {
|
||||
Emails::getLocal($userinfo, array(
|
||||
Emails::getLocal($userinfo, [
|
||||
'id' => $id,
|
||||
'iscatchall' => ($result['iscatchall'] == '1' ? 0 : 1)
|
||||
))->update();
|
||||
])->update();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
\Froxlor\UI\Response::redirectTo($filename, array(
|
||||
Response::redirectTo($filename, [
|
||||
'page' => $page,
|
||||
'action' => 'edit',
|
||||
'id' => $id
|
||||
));
|
||||
]);
|
||||
}
|
||||
} elseif ($page == 'accounts') {
|
||||
if ($action == 'add' && $id != 0) {
|
||||
if ($userinfo['email_accounts'] == '-1' || ($userinfo['email_accounts_used'] < $userinfo['email_accounts'])) {
|
||||
try {
|
||||
$json_result = Emails::getLocal($userinfo, array(
|
||||
$json_result = Emails::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
))->get();
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
@@ -236,45 +258,44 @@ if ($page == 'overview' || $page == 'emails') {
|
||||
try {
|
||||
EmailAccounts::getLocal($userinfo, $_POST)->add();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
\Froxlor\UI\Response::redirectTo($filename, array(
|
||||
Response::redirectTo($filename, [
|
||||
'page' => 'emails',
|
||||
'action' => 'edit',
|
||||
'id' => $id
|
||||
));
|
||||
]);
|
||||
} else {
|
||||
|
||||
if (\Froxlor\Validate\Check::checkMailAccDeletionState($result['email_full'])) {
|
||||
\Froxlor\UI\Response::standard_error(array(
|
||||
if (Check::checkMailAccDeletionState($result['email_full'])) {
|
||||
Response::standardError([
|
||||
'mailaccistobedeleted'
|
||||
), $result['email_full']);
|
||||
], $result['email_full']);
|
||||
}
|
||||
|
||||
$result['email_full'] = $idna_convert->decode($result['email_full']);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
$result = PhpHelper::htmlentitiesArray($result);
|
||||
$quota = Settings::Get('system.mail_quota');
|
||||
|
||||
$account_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_addaccount.php';
|
||||
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(array('section' => 'email', 'id' => $id)),
|
||||
'formaction' => $linker->getLink(['section' => 'email', 'id' => $id]),
|
||||
'formdata' => $account_add_data['emails_addaccount']
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
\Froxlor\UI\Response::standard_error(array(
|
||||
Response::standardError([
|
||||
'allresourcesused',
|
||||
'allocatetoomuchquota'
|
||||
), $quota);
|
||||
], $quota);
|
||||
}
|
||||
} elseif ($action == 'changepw' && $id != 0) {
|
||||
try {
|
||||
$json_result = Emails::getLocal($userinfo, array(
|
||||
$json_result = Emails::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
))->get();
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
@@ -283,32 +304,32 @@ if ($page == 'overview' || $page == 'emails') {
|
||||
try {
|
||||
EmailAccounts::getLocal($userinfo, $_POST)->update();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
\Froxlor\UI\Response::redirectTo($filename, array(
|
||||
Response::redirectTo($filename, [
|
||||
'page' => 'emails',
|
||||
'action' => 'edit',
|
||||
'id' => $id
|
||||
));
|
||||
]);
|
||||
} else {
|
||||
$result['email_full'] = $idna_convert->decode($result['email_full']);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
$result = PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$account_changepw_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php';
|
||||
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(array('section' => 'email', 'id' => $id)),
|
||||
'formaction' => $linker->getLink(['section' => 'email', 'id' => $id]),
|
||||
'formdata' => $account_changepw_data['emails_accountchangepasswd']
|
||||
]);
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'changequota' && Settings::Get('system.mail_quota_enabled') == '1' && $id != 0) {
|
||||
try {
|
||||
$json_result = Emails::getLocal($userinfo, array(
|
||||
$json_result = Emails::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
))->get();
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
@@ -317,32 +338,32 @@ if ($page == 'overview' || $page == 'emails') {
|
||||
try {
|
||||
EmailAccounts::getLocal($userinfo, $_POST)->update();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
\Froxlor\UI\Response::redirectTo($filename, array(
|
||||
Response::redirectTo($filename, [
|
||||
'page' => 'emails',
|
||||
'action' => 'edit',
|
||||
'id' => $id
|
||||
));
|
||||
]);
|
||||
} else {
|
||||
$result['email_full'] = $idna_convert->decode($result['email_full']);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
$result = PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$quota_edit_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_accountchangequota.php';
|
||||
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(array('section' => 'email', 'id' => $id)),
|
||||
'formaction' => $linker->getLink(['section' => 'email', 'id' => $id]),
|
||||
'formdata' => $quota_edit_data['emails_accountchangequota']
|
||||
]);
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'delete' && $id != 0) {
|
||||
try {
|
||||
$json_result = Emails::getLocal($userinfo, array(
|
||||
$json_result = Emails::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
))->get();
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
@@ -351,19 +372,19 @@ if ($page == 'overview' || $page == 'emails') {
|
||||
try {
|
||||
EmailAccounts::getLocal($userinfo, $_POST)->delete();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
\Froxlor\UI\Response::redirectTo($filename, array(
|
||||
Response::redirectTo($filename, [
|
||||
'page' => 'emails',
|
||||
'action' => 'edit',
|
||||
'id' => $id
|
||||
));
|
||||
]);
|
||||
} else {
|
||||
\Froxlor\UI\HTML::askYesNoWithCheckbox('email_reallydelete_account', 'admin_customer_alsoremovemail', $filename, array(
|
||||
HTML::askYesNoWithCheckbox('email_reallydelete_account', 'admin_customer_alsoremovemail', $filename, [
|
||||
'id' => $id,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
), $idna_convert->decode($result['email_full']));
|
||||
], $idna_convert->decode($result['email_full']));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -371,11 +392,11 @@ if ($page == 'overview' || $page == 'emails') {
|
||||
if ($action == 'add' && $id != 0) {
|
||||
if ($userinfo['email_forwarders_used'] < $userinfo['email_forwarders'] || $userinfo['email_forwarders'] == '-1') {
|
||||
try {
|
||||
$json_result = Emails::getLocal($userinfo, array(
|
||||
$json_result = Emails::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
))->get();
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
@@ -384,35 +405,35 @@ if ($page == 'overview' || $page == 'emails') {
|
||||
try {
|
||||
EmailForwarders::getLocal($userinfo, $_POST)->add();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
\Froxlor\UI\Response::redirectTo($filename, array(
|
||||
Response::redirectTo($filename, [
|
||||
'page' => 'emails',
|
||||
'action' => 'edit',
|
||||
'id' => $id
|
||||
));
|
||||
]);
|
||||
} else {
|
||||
$result['email_full'] = $idna_convert->decode($result['email_full']);
|
||||
$result = \Froxlor\PhpHelper::htmlentitiesArray($result);
|
||||
$result = PhpHelper::htmlentitiesArray($result);
|
||||
|
||||
$forwarder_add_data = include_once dirname(__FILE__) . '/lib/formfields/customer/email/formfield.emails_addforwarder.php';
|
||||
|
||||
UI::view('user/form.html.twig', [
|
||||
'formaction' => $linker->getLink(array('section' => 'email', 'id' => $id)),
|
||||
'formaction' => $linker->getLink(['section' => 'email', 'id' => $id]),
|
||||
'formdata' => $forwarder_add_data['emails_addforwarder']
|
||||
]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
\Froxlor\UI\Response::standard_error('allresourcesused');
|
||||
Response::standardError('allresourcesused');
|
||||
}
|
||||
} elseif ($action == 'delete' && $id != 0) {
|
||||
try {
|
||||
$json_result = Emails::getLocal($userinfo, array(
|
||||
$json_result = Emails::getLocal($userinfo, [
|
||||
'id' => $id
|
||||
))->get();
|
||||
])->get();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
$result = json_decode($json_result, true)['data'];
|
||||
|
||||
@@ -434,20 +455,20 @@ if ($page == 'overview' || $page == 'emails') {
|
||||
try {
|
||||
EmailForwarders::getLocal($userinfo, $_POST)->delete();
|
||||
} catch (Exception $e) {
|
||||
\Froxlor\UI\Response::dynamic_error($e->getMessage());
|
||||
Response::dynamicError($e->getMessage());
|
||||
}
|
||||
\Froxlor\UI\Response::redirectTo($filename, array(
|
||||
Response::redirectTo($filename, [
|
||||
'page' => 'emails',
|
||||
'action' => 'edit',
|
||||
'id' => $id
|
||||
));
|
||||
]);
|
||||
} else {
|
||||
\Froxlor\UI\HTML::askYesNo('email_reallydelete_forwarder', $filename, array(
|
||||
HTML::askYesNo('email_reallydelete_forwarder', $filename, [
|
||||
'id' => $id,
|
||||
'forwarderid' => $forwarderid,
|
||||
'page' => $page,
|
||||
'action' => $action
|
||||
), $idna_convert->decode($result['email_full']) . ' -> ' . $idna_convert->decode($forwarder));
|
||||
], $idna_convert->decode($result['email_full']) . ' -> ' . $idna_convert->decode($forwarder));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user