* GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) */ namespace Panel\Vmail; class DomainsDelete extends \Panel\Vmail { function beforeRoute($f3) { parent::beforeRoute($f3); /* verify domain exists */ $domain = $f3->get('PARAMS.domain'); $f3->call('\Panel::vGet', "vmail-domains-get.sh -d $domain -c"); } static function get($f3) { $f3->set('confirm', 'true'); echo \Template::instance()->render('vmail/domains-delete.html'); } function post($f3) { /* run delete command here */ $domain = $f3->get('PARAMS.domain'); exec("/usr/local/bin/vmail-domains-del.sh -d $domain", $output, $result_code); $messages[] = "Email domain '$domain' has been deleted."; $f3->set('SESSION.messages', $messages); $f3->reroute("/Email"); } }