diff --git a/data/web/edit.php b/data/web/edit.php index 971622e7..188f2cb9 100644 --- a/data/web/edit.php +++ b/data/web/edit.php @@ -413,7 +413,15 @@ if (isset($_SESSION['mailcow_cc_role'])) {
- +
diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php index 06d20b93..1da326a6 100644 --- a/data/web/inc/functions.mailbox.inc.php +++ b/data/web/inc/functions.mailbox.inc.php @@ -621,6 +621,14 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { $alias_domains = array_map('trim', preg_split( "/( |,|;|\n)/", $_data['alias_domain'])); $alias_domains = array_filter($alias_domains); $target_domain = idn_to_ascii(strtolower(trim($_data['target_domain']))); + if (!isset($_SESSION['acl']['alias_domains']) || $_SESSION['acl']['alias_domains'] != "1" ) { + $_SESSION['return'][] = array( + 'type' => 'danger', + 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr), + 'msg' => 'access_denied' + ); + return false; + } if (!is_valid_domain_name($target_domain)) { $_SESSION['return'][] = array( 'type' => 'danger', @@ -698,6 +706,9 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { ); return false; } + if (!empty(intval($_data['rl_value']))) { + ratelimit('edit', 'domain', array('rl_value' => $_data['rl_value'], 'rl_frame' => $_data['rl_frame'], 'object' => $alias_domain)); + } $_SESSION['return'][] = array( 'type' => 'success', 'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr), diff --git a/data/web/inc/init_db.inc.php b/data/web/inc/init_db.inc.php index 5baaa77b..a43ec709 100644 --- a/data/web/inc/init_db.inc.php +++ b/data/web/inc/init_db.inc.php @@ -3,7 +3,7 @@ function init_db_schema() { try { global $pdo; - $db_version = "03112018_1117"; + $db_version = "14112018_0717"; $stmt = $pdo->query("SHOW TABLES LIKE 'versions'"); $num_results = count($stmt->fetchAll(PDO::FETCH_ASSOC)); @@ -436,6 +436,7 @@ function init_db_schema() { "filters" => "TINYINT(1) NOT NULL DEFAULT '1'", "ratelimit" => "TINYINT(1) NOT NULL DEFAULT '1'", "spam_policy" => "TINYINT(1) NOT NULL DEFAULT '1'", + "alias_domains" => "TINYINT(1) NOT NULL DEFAULT '0'", ), "keys" => array( "primary" => array( diff --git a/data/web/js/mailcow.js b/data/web/js/mailcow.js index 89cfabf5..6dd7e4d8 100644 --- a/data/web/js/mailcow.js +++ b/data/web/js/mailcow.js @@ -109,7 +109,11 @@ $(document).ready(function() { }); // Disable disallowed inputs - $('[data-acl="0"]').each(function(){ + $('[data-acl="0"]').each(function(event){ + if ($(this).is("a")) { + $(this).removeAttr("data-toggle"); + $(this).removeAttr("data-target"); + } if ($(this).hasClass('btn-group')) { $(this).find('a').each(function(){ $(this).removeClass('dropdown-toggle') diff --git a/data/web/lang/lang.de.php b/data/web/lang/lang.de.php index 01301df2..1598b841 100644 --- a/data/web/lang/lang.de.php +++ b/data/web/lang/lang.de.php @@ -378,6 +378,7 @@ $lang['acl']['syncjobs'] = 'Sync Jobs'; $lang['acl']['eas_reset'] = 'EAS-Cache zurücksetzen'; $lang['acl']['sogo_profile_reset'] = 'SOGo Profil zurücksetzen'; $lang['acl']['quarantine'] = 'Quarantäne'; +$lang['acl']['alias_domains'] = 'Alias-Domains hinzufügen'; $lang['acl']['login_as'] = 'Einloggen als Mailbox-Benutzer'; $lang['acl']['bcc_maps'] = 'BCC Maps'; $lang['acl']['filters'] = 'Filter'; diff --git a/data/web/lang/lang.en.php b/data/web/lang/lang.en.php index d12c7d5f..bc37ce41 100644 --- a/data/web/lang/lang.en.php +++ b/data/web/lang/lang.en.php @@ -389,6 +389,7 @@ $lang['acl']['syncjobs'] = 'Sync jobs'; $lang['acl']['eas_reset'] = 'Reset EAS devices'; $lang['acl']['sogo_profile_reset'] = 'Reset SOGo profile'; $lang['acl']['quarantine'] = 'Quarantine'; +$lang['acl']['alias_domains'] = 'Add alias domains'; $lang['acl']['login_as'] = 'Login as mailbox user'; $lang['acl']['bcc_maps'] = 'BCC maps'; $lang['acl']['filters'] = 'Filters'; diff --git a/data/web/mailbox.php b/data/web/mailbox.php index f6473356..f2a08b15 100644 --- a/data/web/mailbox.php +++ b/data/web/mailbox.php @@ -139,7 +139,7 @@ $_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
  • - +
    diff --git a/data/web/modals/mailbox.php b/data/web/modals/mailbox.php index 7327959b..048393fe 100644 --- a/data/web/modals/mailbox.php +++ b/data/web/modals/mailbox.php @@ -131,7 +131,7 @@ if (!isset($_SESSION['mailcow_cc_role'])) {
    - +
    @@ -326,6 +326,20 @@ if (!isset($_SESSION['mailcow_cc_role'])) {
    +
    +
    + +
    + +
    +
    + +
    +