32 lines
821 B
PHP
32 lines
821 B
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;
|
||
|
|
||
|
class Vmail extends \Panel {
|
||
|
|
||
|
function beforeRoute($f3) {
|
||
|
|
||
|
parent::beforeRoute($f3);
|
||
|
|
||
|
if ($f3->exists('SESSION.domain')) {
|
||
|
$f3->set('PARAMS.domain', $f3->get('SESSION.domain'));
|
||
|
}
|
||
|
|
||
|
/* set base path for vmail links */
|
||
|
if ($f3->get('NAV.mapping') == 'vmail') {
|
||
|
$f3->set('NAV.vmailbase', preg_replace('/\/$/', '', $f3->get('BASE')));
|
||
|
} elseif ($f3->get('NAV.mapping') == 'vpanel') {
|
||
|
$f3->set('NAV.vmailbase', preg_replace('/\/$/', '', $f3->get('BASE') . '/Email/' . $f3->get('PARAMS.domain')));
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|