51 lines
1.2 KiB
PHP
51 lines
1.2 KiB
PHP
|
<?php
|
||
|
|
||
|
/**
|
||
|
* vpanel-stack
|
||
|
* https://git.stack-source.com/msb/vpanel-stack
|
||
|
* Copyright (c) 2022 Matthew Saunders Brown <matthewsaundersbrown@gmail.com>
|
||
|
* GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||
|
*/
|
||
|
|
||
|
namespace Panel\Vmail;
|
||
|
|
||
|
class AutorespondersDelete extends \Panel\Vmail {
|
||
|
|
||
|
function beforeRoute($f3) {
|
||
|
|
||
|
parent::beforeRoute($f3);
|
||
|
|
||
|
}
|
||
|
|
||
|
static function get($f3) {
|
||
|
|
||
|
$f3->set('confirm', 'true');
|
||
|
echo \Template::instance()->render('vmail/autoresponders-delete.html');
|
||
|
|
||
|
}
|
||
|
|
||
|
function post($f3) {
|
||
|
|
||
|
/* run delete command here */
|
||
|
$domain = $f3->get('PARAMS.domain');
|
||
|
$mbox = $f3->get('PARAMS.mbox');
|
||
|
$messages = array();
|
||
|
exec("/usr/local/bin/vmail-autoresponders-del.sh -e $mbox@$domain", $output, $result_code);
|
||
|
$result_code = 0;
|
||
|
if ($result_code == 0) {
|
||
|
$messages[] = "Autoresponder for email account '$mbox@$domain' has been deleted.";
|
||
|
} else {
|
||
|
$messages[] = "Error deleting autoresponder for email account '$mbox@$domain'.";
|
||
|
}
|
||
|
$f3->set('SESSION.messages', $messages);
|
||
|
$mapping = $f3->get('NAV.mapping');
|
||
|
if ($mapping == 'vmail') {
|
||
|
$f3->reroute("/Accounts/$mbox");
|
||
|
} else {
|
||
|
$f3->reroute("/Email/$domain/Accounts/$mbox");
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|