Marius Cramer
2014-02-25 3faab0ca9e097627420aec19c01ad8336fe79c22
Merge remote-tracking branch 'origin/stable-3.0.5'

Conflicts:
interface/web/sites/lib/lang/de_web_folder.lng
interface/web/sites/lib/lang/de_web_folder_user.lng
interface/web/sites/lib/lang/de_web_vhost_domain.lng
interface/web/sites/lib/lang/en_web_domain.lng
server/lib/classes/db_mysql.inc.php
1 files added
40 files modified
208 ■■■■■ changed files
install/sql/incremental/upd_0070.sql 1 ●●●● patch | view | raw | blame | history
install/sql/ispconfig3.sql 1 ●●●● patch | view | raw | blame | history
install/tpl/debian6_dovecot-sql.conf.master 2 ●●● patch | view | raw | blame | history
install/tpl/fedora_dovecot-sql.conf.master 2 ●●● patch | view | raw | blame | history
install/tpl/opensuse_dovecot-sql.conf.master 2 ●●● patch | view | raw | blame | history
interface/web/client/form/client.tform.php 2 ●●● patch | view | raw | blame | history
interface/web/dns/form/dns_a.tform.php 4 ●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_aaaa.tform.php 4 ●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_alias.tform.php 4 ●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_cname.tform.php 4 ●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_hinfo.tform.php 4 ●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_mx.tform.php 4 ●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_ns.tform.php 4 ●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_ptr.tform.php 4 ●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_rp.tform.php 4 ●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_srv.tform.php 4 ●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_txt.tform.php 4 ●●●● patch | view | raw | blame | history
interface/web/dns/lib/lang/en_dns_a.lng 1 ●●●● patch | view | raw | blame | history
interface/web/dns/lib/lang/en_dns_aaaa.lng 1 ●●●● patch | view | raw | blame | history
interface/web/dns/lib/lang/en_dns_alias.lng 1 ●●●● patch | view | raw | blame | history
interface/web/dns/lib/lang/en_dns_cname.lng 1 ●●●● patch | view | raw | blame | history
interface/web/dns/lib/lang/en_dns_hinfo.lng 1 ●●●● patch | view | raw | blame | history
interface/web/dns/lib/lang/en_dns_mx.lng 1 ●●●● patch | view | raw | blame | history
interface/web/dns/lib/lang/en_dns_ns.lng 1 ●●●● patch | view | raw | blame | history
interface/web/dns/lib/lang/en_dns_ptr.lng 1 ●●●● patch | view | raw | blame | history
interface/web/dns/lib/lang/en_dns_rp.lng 1 ●●●● patch | view | raw | blame | history
interface/web/dns/lib/lang/en_dns_srv.lng 1 ●●●● patch | view | raw | blame | history
interface/web/dns/lib/lang/en_dns_txt.lng 1 ●●●● patch | view | raw | blame | history
interface/web/mail/mail_user_edit.php 2 ●●● patch | view | raw | blame | history
interface/web/monitor/show_sys_state.php 3 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/de_web_folder.lng 1 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/de_web_folder_user.lng 1 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/de_web_vhost_domain.lng 2 ●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_web_folder.lng 1 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_web_folder_user.lng 1 ●●●● patch | view | raw | blame | history
interface/web/sites/web_folder_edit.php 36 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_folder_user_edit.php 36 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_vhost_domain_edit.php 29 ●●●●● patch | view | raw | blame | history
server/lib/classes/aps_installer.inc.php 15 ●●●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php 8 ●●●●● patch | view | raw | blame | history
server/plugins-available/nginx_plugin.inc.php 8 ●●●●● patch | view | raw | blame | history
install/sql/incremental/upd_0070.sql
New file
@@ -0,0 +1 @@
ALTER TABLE `mail_user` ADD `disablesieve-filter` ENUM( 'y', 'n' ) NOT NULL DEFAULT 'n' AFTER `disablesieve`;
install/sql/ispconfig3.sql
@@ -910,6 +910,7 @@
  `disabledeliver` enum('n','y') NOT NULL default 'n',
  `disablesmtp` enum('n','y') NOT NULL default 'n',
  `disablesieve` enum('n','y') NOT NULL default 'n',
  `disablesieve-filter` enum('n','y') NOT NULL default 'n',
  `disablelda` enum('n','y') NOT NULL default 'n',
  `disablelmtp` enum('n','y') NOT NULL default 'n',
  `disabledoveadm` enum('n','y') NOT NULL default 'n',
install/tpl/debian6_dovecot-sql.conf.master
@@ -14,7 +14,7 @@
default_pass_scheme = CRYPT
password_query = SELECT password FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n'
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n'
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n'
# The iterate_query is required for the doveadm command only and works only on dovecot 2 servers.
# Do not enable it on Dovecot 1.x servers
install/tpl/fedora_dovecot-sql.conf.master
@@ -134,7 +134,7 @@
default_pass_scheme = CRYPT
password_query = SELECT password FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n'
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n'
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n'
# The iterate_query is required for the doveadm command only and works only on dovecot 2 servers.
# Do not enable it on Dovecot 1.x servers
install/tpl/opensuse_dovecot-sql.conf.master
@@ -134,7 +134,7 @@
default_pass_scheme = CRYPT
password_query = SELECT password FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n'
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n'
user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND `disable%Ls` = 'n'
# The iterate_query is required for the doveadm command only and works only on dovecot 2 servers.
# Do not enable it on Dovecot 1.x servers
interface/web/client/form/client.tform.php
@@ -250,7 +250,7 @@
            'formtype' => 'SELECT',
            'default' => (isset($conf['language']) ? strtoupper($conf['language']) : ''),
            'datasource' => array (  'type'          => 'SQL',
                'querystring'   => 'SELECT iso,printable_name FROM country ORDER BY iso ASC',
                'querystring'   => 'SELECT iso,printable_name FROM country ORDER BY printable_name ASC',
                'keyfield'      => 'iso',
                'valuefield'    => 'printable_name'
            ),
interface/web/dns/form/dns_a.tform.php
@@ -129,6 +129,10 @@
        'ttl' => array (
            'datatype' => 'INTEGER',
            'formtype' => 'TEXT',
            'validators' => array (  0 => array ( 'type' => 'RANGE',
                    'range' => '60:',
                    'errmsg'=> 'ttl_range_error'),
            ),
            'default' => '86400',
            'value'  => '',
            'width'  => '10',
interface/web/dns/form/dns_aaaa.tform.php
@@ -122,6 +122,10 @@
        'ttl' => array (
            'datatype' => 'INTEGER',
            'formtype' => 'TEXT',
            'validators' => array (  0 => array ( 'type' => 'RANGE',
                    'range' => '60:',
                    'errmsg'=> 'ttl_range_error'),
            ),
            'default' => '86400',
            'value'  => '',
            'width'  => '10',
interface/web/dns/form/dns_alias.tform.php
@@ -138,6 +138,10 @@
        'ttl' => array (
            'datatype' => 'INTEGER',
            'formtype' => 'TEXT',
            'validators' => array (  0 => array ( 'type' => 'RANGE',
                    'range' => '60:',
                    'errmsg'=> 'ttl_range_error'),
            ),
            'default' => '86400',
            'value'  => '',
            'width'  => '10',
interface/web/dns/form/dns_cname.tform.php
@@ -136,6 +136,10 @@
        'ttl' => array (
            'datatype' => 'INTEGER',
            'formtype' => 'TEXT',
            'validators' => array (  0 => array ( 'type' => 'RANGE',
                    'range' => '60:',
                    'errmsg'=> 'ttl_range_error'),
            ),
            'default' => '86400',
            'value'  => '',
            'width'  => '10',
interface/web/dns/form/dns_hinfo.tform.php
@@ -128,6 +128,10 @@
        'ttl' => array (
            'datatype' => 'INTEGER',
            'formtype' => 'TEXT',
            'validators' => array (  0 => array ( 'type' => 'RANGE',
                    'range' => '60:',
                    'errmsg'=> 'ttl_range_error'),
            ),
            'default' => '86400',
            'value'  => '',
            'width'  => '10',
interface/web/dns/form/dns_mx.tform.php
@@ -137,6 +137,10 @@
        'ttl' => array (
            'datatype' => 'INTEGER',
            'formtype' => 'TEXT',
            'validators' => array (  0 => array ( 'type' => 'RANGE',
                    'range' => '60:',
                    'errmsg'=> 'ttl_range_error'),
            ),
            'default' => '86400',
            'value'  => '',
            'width'  => '10',
interface/web/dns/form/dns_ns.tform.php
@@ -136,6 +136,10 @@
        'ttl' => array (
            'datatype' => 'INTEGER',
            'formtype' => 'TEXT',
            'validators' => array (  0 => array ( 'type' => 'RANGE',
                    'range' => '60:',
                    'errmsg'=> 'ttl_range_error'),
            ),
            'default' => '86400',
            'value'  => '',
            'width'  => '10',
interface/web/dns/form/dns_ptr.tform.php
@@ -136,6 +136,10 @@
        'ttl' => array (
            'datatype' => 'INTEGER',
            'formtype' => 'TEXT',
            'validators' => array (  0 => array ( 'type' => 'RANGE',
                    'range' => '60:',
                    'errmsg'=> 'ttl_range_error'),
            ),
            'default' => '86400',
            'value'  => '',
            'width'  => '10',
interface/web/dns/form/dns_rp.tform.php
@@ -129,6 +129,10 @@
        'ttl' => array (
            'datatype' => 'INTEGER',
            'formtype' => 'TEXT',
            'validators' => array (  0 => array ( 'type' => 'RANGE',
                    'range' => '60:',
                    'errmsg'=> 'ttl_range_error'),
            ),
            'default' => '86400',
            'value'  => '',
            'width'  => '10',
interface/web/dns/form/dns_srv.tform.php
@@ -127,6 +127,10 @@
        'ttl' => array (
            'datatype' => 'INTEGER',
            'formtype' => 'TEXT',
            'validators' => array (  0 => array ( 'type' => 'RANGE',
                    'range' => '60:',
                    'errmsg'=> 'ttl_range_error'),
            ),
            'default' => '86400',
            'value'  => '',
            'width'  => '10',
interface/web/dns/form/dns_txt.tform.php
@@ -126,6 +126,10 @@
        'ttl' => array (
            'datatype' => 'INTEGER',
            'formtype' => 'TEXT',
            'validators' => array (  0 => array ( 'type' => 'RANGE',
                    'range' => '60:',
                    'errmsg'=> 'ttl_range_error'),
            ),
            'default' => '86400',
            'value'  => '',
            'width'  => '10',
interface/web/dns/lib/lang/en_dns_a.lng
@@ -13,4 +13,5 @@
$wb["data_error_empty"] = 'IP-Address empty';
$wb["data_error_regex"] = 'IP-Address format invalid';
$wb["data_error_duplicate"] = 'Duplicate A-Record or CNAME-Record';
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
?>
interface/web/dns/lib/lang/en_dns_aaaa.lng
@@ -12,4 +12,5 @@
$wb["name_error_regex"] = 'The hostname has the wrong format.';
$wb["data_error_empty"] = 'IP-Address empty';
$wb["data_error_regex"] = 'IP-Address format invalid';
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
?>
interface/web/dns/lib/lang/en_dns_alias.lng
@@ -12,4 +12,5 @@
$wb["name_error_regex"] = 'The hostname has the wrong format.';
$wb["data_error_empty"] = 'Target hostname empty';
$wb["data_error_regex"] = 'Target hostname format invalid';
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
?>
interface/web/dns/lib/lang/en_dns_cname.lng
@@ -13,4 +13,5 @@
$wb["data_error_empty"] = 'Target hostname empty';
$wb["data_error_regex"] = 'Target hostname format invalid';
$wb["data_error_duplicate"] = 'Duplicate A-Record or CNAME-Record';
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
?>
interface/web/dns/lib/lang/en_dns_hinfo.lng
@@ -12,4 +12,5 @@
$wb["name_error_regex"] = 'The hostname has the wrong format.';
$wb["data_error_empty"] = 'Host information empty';
$wb["data_error_regex"] = 'Host Information format invalid';
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
?>
interface/web/dns/lib/lang/en_dns_mx.lng
@@ -14,4 +14,5 @@
$wb["data_error_empty"] = 'Mailserver hostname empty';
$wb["data_error_regex"] = 'Mailserver hostname format invalid';
$wb["duplicate_mx_record_txt"] = 'Duplicate MX record.';
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
?>
interface/web/dns/lib/lang/en_dns_ns.lng
@@ -12,4 +12,5 @@
$wb["name_error_regex"] = 'The zone has the wrong format.';
$wb["data_error_empty"] = 'Nameserver empty';
$wb["data_error_regex"] = 'Nameserver format invalid';
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
?>
interface/web/dns/lib/lang/en_dns_ptr.lng
@@ -12,4 +12,5 @@
$wb["name_error_regex"] = 'The name has the wrong format.';
$wb["data_error_empty"] = 'Canonical hostname empty';
$wb["data_error_regex"] = 'Canonical hostname format invalid';
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
?>
interface/web/dns/lib/lang/en_dns_rp.lng
@@ -12,4 +12,5 @@
$wb["name_error_regex"] = 'The hostname has the wrong format.';
$wb["data_error_empty"] = 'Responsible person field empty';
$wb["data_error_regex"] = 'Responsible person field format invalid';
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
?>
interface/web/dns/lib/lang/en_dns_srv.lng
@@ -16,4 +16,5 @@
$wb["data_error_empty"] = 'Server record empty';
$wb["data_error_regex"] = 'Server record format invalid';
$wb["srv_error_regex"] = 'Invalid server record format. The server record must contain 3 text strings separated by spaces.';
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
?>
interface/web/dns/lib/lang/en_dns_txt.lng
@@ -12,4 +12,5 @@
$wb["name_error_regex"] = 'The hostname has the wrong format.';
$wb["data_error_empty"] = 'Text empty';
$wb["data_error_regex"] = 'Text format invalid';
$wb['ttl_range_error'] = 'Min. TTL time is 60 seconds.';
?>
interface/web/mail/mail_user_edit.php
@@ -302,7 +302,7 @@
            $disabledeliver = ($this->dataRecord["postfix"] == 'y')?'n':'y';
            $disablesmtp = ($this->dataRecord["postfix"] == 'y')?'n':'y';
            $sql = "UPDATE mail_user SET disableimap = '$disableimap', disablesieve = '$disableimap', disablepop3 = '$disablepop3', disablesmtp = '$disablesmtp', disabledeliver = '$disabledeliver', disablelda = '$disabledeliver', disabledoveadm = '$disableimap' WHERE mailuser_id = ".$this->id;
            $sql = "UPDATE mail_user SET disableimap = '$disableimap', disablesieve = '$disableimap', `disablesieve-filter` = '$disableimap', disablepop3 = '$disablepop3', disablesmtp = '$disablesmtp', disabledeliver = '$disabledeliver', disablelda = '$disabledeliver', disabledoveadm = '$disableimap' WHERE mailuser_id = ".$this->id;
            $app->db->query($sql);
        }
interface/web/monitor/show_sys_state.php
@@ -223,7 +223,8 @@
    /*
     * Info of a VE inside a OpenVz-Host
    */
    $html_ve  = '<div class="systemmonitor-ve state-' . $serverState . '-ve os-' . $osData['name'] . '">';
    //$html_ve  = '<div class="systemmonitor-ve state-' . $serverState . '-ve os-' . $osData['name'] . '">';
    $html_ve  = '<div class="systemmonitor state-' . $serverState . ' os-' . $osData['name'] . '">';
    if ($osData != null) {
        $html_ve .= '<div class="icoDevice"><p class="status"></p></div>';
    }
interface/web/sites/lib/lang/de_web_folder.lng
@@ -4,4 +4,5 @@
$wb['path_txt'] = 'Pfad';
$wb['active_txt'] = 'Aktiv';
$wb['path_error_regex'] = 'UngĂĽltiger Pfad.';
$wb['error_folder_already_protected_txt'] = 'FĂĽr diesen Ordner existiert schon ein Eintrag.';
?>
interface/web/sites/lib/lang/de_web_folder_user.lng
@@ -10,4 +10,5 @@
$wb['password_mismatch_txt'] = 'Die Passwörter stimmen nicht ĂĽberein.';
$wb['password_match_txt'] = 'Die Passwörter stimmen ĂĽberein.';
$wb['no_folder_perm'] = 'Sie haben keine Berechtigung fĂĽr diesen Ordner.';
$wb['error_user_exists_already_txt'] = 'FĂĽr diesen Benutzer existiert schon ein Eintrag.';
?>
interface/web/sites/lib/lang/de_web_vhost_domain.lng
@@ -131,5 +131,5 @@
$wb['web_folder_unique_txt'] = 'Dieser Ordner wird bereits verwendet, bitte geben Sie einen anderen Basisordner an.';
$wb['host_txt'] = 'Host';
$wb['domain_error_wildcard'] = 'Wildcard-Subdomains sind nicht erlaubt.';
$wb['invalid_custom_php_ini_settings_txt'] = 'Unzulässige php.ini-Einstellungen';
?>
interface/web/sites/lib/lang/en_web_folder.lng
@@ -4,4 +4,5 @@
$wb["path_txt"] = 'Path';
$wb["active_txt"] = 'Active';
$wb["path_error_regex"] = 'Invalid folder path.';
$wb['error_folder_already_protected_txt'] = 'There is already a record for this folder.';
?>
interface/web/sites/lib/lang/en_web_folder_user.lng
@@ -10,4 +10,5 @@
$wb['password_mismatch_txt'] = 'The passwords do not match.';
$wb['password_match_txt'] = 'The passwords do match.';
$wb["no_folder_perm"] = 'You have no permission for this folder.';
$wb['error_user_exists_already_txt'] = 'There is already a record for this user.';
?>
interface/web/sites/web_folder_edit.php
@@ -60,9 +60,45 @@
        // Set a few fixed values
        $this->dataRecord["server_id"] = $parent_domain["server_id"];
        // make sure this folder isn't protected already
        if($this->id > 0){
            $folder = $app->db->queryOneRecord("SELECT * FROM web_folder WHERE parent_domain_id = ".$this->dataRecord['parent_domain_id']." AND path = '".$this->dataRecord['path']."' AND web_folder_id != ".$this->id);
        } else {
            $folder = $app->db->queryOneRecord("SELECT * FROM web_folder WHERE parent_domain_id = ".$this->dataRecord['parent_domain_id']." AND path = '".$this->dataRecord['path']."'");
        }
        if(is_array($folder) && !empty($folder)) $app->tform->errorMessage .= $app->tform->lng('error_folder_already_protected_txt');
        parent::onSubmit();
    }
    function onAfterInsert() {
        global $app, $conf;
        $web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval($this->dataRecord["parent_domain_id"]));
        // The web folder entry shall be owned by the same group as the website
        $sys_groupid = $app->functions->intval($web['sys_groupid']);
        $sql = "UPDATE web_folder SET sys_groupid = '$sys_groupid' WHERE web_folder_id = ".$this->id;
        $app->db->query($sql);
    }
    function onAfterUpdate() {
        global $app, $conf;
        //* When the site of the web folder has been changed
        if(isset($this->dataRecord['parent_domain_id']) && $this->oldDataRecord['parent_domain_id'] != $this->dataRecord['parent_domain_id']) {
            $web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval($this->dataRecord["parent_domain_id"]));
            // The web folder entry shall be owned by the same group as the website
            $sys_groupid = $app->functions->intval($web['sys_groupid']);
            $sql = "UPDATE web_folder SET sys_groupid = '$sys_groupid' WHERE web_folder_id = ".$this->id;
            $app->db->query($sql);
        }
    }
}
interface/web/sites/web_folder_user_edit.php
@@ -60,9 +60,45 @@
        // Set a few fixed values
        $this->dataRecord["server_id"] = $folder["server_id"];
        // make sure this folder/user combination does not exist already
        if($this->id > 0){
            $user = $app->db->queryOneRecord("SELECT * FROM web_folder_user WHERE web_folder_id = ".$this->dataRecord['web_folder_id']." AND username = '".$this->dataRecord['username']."' AND web_folder_user_id != ".$this->id);
        } else {
            $user = $app->db->queryOneRecord("SELECT * FROM web_folder_user WHERE web_folder_id = ".$this->dataRecord['web_folder_id']." AND username = '".$this->dataRecord['username']."'");
        }
        if(is_array($user) && !empty($user)) $app->tform->errorMessage .= $app->tform->lng('error_user_exists_already_txt');
        parent::onSubmit();
    }
    function onAfterInsert() {
        global $app, $conf;
        $folder = $app->db->queryOneRecord("SELECT * FROM web_folder WHERE web_folder_id = ".$app->functions->intval($this->dataRecord["web_folder_id"]));
        // The web folder user entry shall be owned by the same group as the web folder
        $sys_groupid = $app->functions->intval($folder['sys_groupid']);
        $sql = "UPDATE web_folder_user SET sys_groupid = '$sys_groupid' WHERE web_folder_user_id = ".$this->id;
        $app->db->query($sql);
    }
    function onAfterUpdate() {
        global $app, $conf;
        //* When the web folder has been changed
        if(isset($this->dataRecord['web_folder_id']) && $this->oldDataRecord['web_folder_id'] != $this->dataRecord['web_folder_id']) {
            $folder = $app->db->queryOneRecord("SELECT * FROM web_folder WHERE web_folder_id = ".$app->functions->intval($this->dataRecord["web_folder_id"]));
            // The web folder user entry shall be owned by the same group as the web folder
            $sys_groupid = $app->functions->intval($folder['sys_groupid']);
            $sql = "UPDATE web_folder_user SET sys_groupid = '$sys_groupid' WHERE web_folder_user_id = ".$this->id;
            $app->db->query($sql);
        }
    }
}
interface/web/sites/web_vhost_domain_edit.php
@@ -1003,6 +1003,35 @@
                $app->tform->errorMessage .= $app->tform->lng("invalid_rewrite_rules_txt").'<br>';
            }
        }
        // check custom php.ini settings
        if(isset($this->dataRecord['custom_php_ini']) && trim($this->dataRecord['custom_php_ini']) != '') {
            $custom_php_ini_settings = trim($this->dataRecord['custom_php_ini']);
            $custom_php_ini_settings_are_valid = true;
            // Make sure we only have Unix linebreaks
            $custom_php_ini_settings = str_replace("\r\n", "\n", $custom_php_ini_settings);
            $custom_php_ini_settings = str_replace("\r", "\n", $custom_php_ini_settings);
            $custom_php_ini_settings_lines = explode("\n", $custom_php_ini_settings);
            if(is_array($custom_php_ini_settings_lines) && !empty($custom_php_ini_settings_lines)){
                foreach($custom_php_ini_settings_lines as $custom_php_ini_settings_line){
                    if(trim($custom_php_ini_settings_line) == '') continue;
                    if(substr(trim($custom_php_ini_settings_line),0,1) == ';') continue;
                    // empty value
                    if(preg_match('@^\s*;*\s*[a-zA-Z0-9._]*\s*=\s*;*\s*$@', $custom_php_ini_settings_line)) continue;
                    // value inside ""
                    if(preg_match('@^\s*;*\s*[a-zA-Z0-9._]*\s*=\s*".*"\s*;*\s*$@', $custom_php_ini_settings_line)) continue;
                    // value inside ''
                    if(preg_match('@^\s*;*\s*[a-zA-Z0-9._]*\s*=\s*\'.*\'\s*;*\s*$@', $custom_php_ini_settings_line)) continue;
                    // everything else
                    if(preg_match('@^\s*;*\s*[a-zA-Z0-9._]*\s*=\s*[-a-zA-Z0-9~&=_\@/,.#\s]*\s*;*\s*$@', $custom_php_ini_settings_line)) continue;
                    $custom_php_ini_settings_are_valid = false;
                    break;
                }
            }
            if(!$custom_php_ini_settings_are_valid){
                $app->tform->errorMessage .= $app->tform->lng("invalid_custom_php_ini_settings_txt").'<br>';
            }
        }
        parent::onSubmit();
    }
server/lib/classes/aps_installer.inc.php
@@ -371,6 +371,21 @@
        $tmp = $app->db->queryOneRecord("SELECT value FROM aps_instances_settings WHERE name = 'main_database_login' AND instance_id = '".$app->db->quote($task['instance_id'])."';");
        $newdb_login = $tmp['value'];
        /* Test if the new mysql connection is laready working to ensure that db servers in multiserver
           setups get enough time to create the database */
        if($this->handle_type == 'install') {
            for($n = 1; $n < 15; $n++) {
                $link = mysql_connect($newdb_host, $newdb_login, $newdb_pw);
                if (!$link) {
                    unset($link);
                    sleep(5);
                } else {
                    unset($link);
                    break;
                }
            }
        }
        $this->putenv[] = 'DB_'.$db_id.'_TYPE=mysql';
        $this->putenv[] = 'DB_'.$db_id.'_NAME='.$newdb_name;
server/plugins-available/apache2_plugin.inc.php
@@ -564,7 +564,9 @@
            //* Change the log mount
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['old']['domain'].' '.$data['old']['document_root'].'/'.$log_folder.'    none    bind';
            $app->system->removeLine('/etc/fstab', $fstab_line);
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.'    none    bind,nobootwait    0 0';
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['old']['domain'].' '.$data['old']['document_root'].'/'.$log_folder.'    none    bind,nobootwait';
            $app->system->removeLine('/etc/fstab', $fstab_line);
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.'    none    bind,nobootwait,_netdev    0 0';
            $app->system->replaceLine('/etc/fstab', $fstab_line, $fstab_line, 1, 1);
        }
@@ -614,7 +616,7 @@
            $app->system->chmod($data['new']['document_root'].'/'.$log_folder, 0755);
            exec('mount --bind '.escapeshellarg('/var/log/ispconfig/httpd/'.$data['new']['domain']).' '.escapeshellarg($data['new']['document_root'].'/'.$log_folder));
            //* add mountpoint to fstab
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.'    none    bind,nobootwait    0 0';
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.'    none    bind,nobootwait,_netdev    0 0';
            $app->system->replaceLine('/etc/fstab', $fstab_line, $fstab_line, 1, 1);
        }
@@ -2799,7 +2801,7 @@
                    if(substr($ini_setting, 0, 1) == ';') continue;
                    if(substr($ini_setting, 0, 1) == '#') continue;
                    if(substr($ini_setting, 0, 2) == '//') continue;
                    list($key, $value) = explode('=', $ini_setting);
                    list($key, $value) = explode('=', $ini_setting, 2);
                    if($value){
                        $value = trim($value);
                        $key = trim($key);
server/plugins-available/nginx_plugin.inc.php
@@ -479,7 +479,9 @@
            //* Change the log mount
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['old']['domain'].' '.$data['old']['document_root'].'/'.$log_folder.'    none    bind';
            $app->system->removeLine('/etc/fstab', $fstab_line);
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.'    none    bind,nobootwait    0 0';
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['old']['domain'].' '.$data['old']['document_root'].'/'.$log_folder.'    none    bind,nobootwait';
            $app->system->removeLine('/etc/fstab', $fstab_line);
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.'    none    bind,nobootwait,_netdev    0 0';
            $app->system->replaceLine('/etc/fstab', $fstab_line, $fstab_line, 1, 1);
        }
@@ -529,7 +531,7 @@
            $app->system->chmod($data['new']['document_root'].'/'.$log_folder, 0755);
            exec('mount --bind '.escapeshellarg('/var/log/ispconfig/httpd/'.$data['new']['domain']).' '.escapeshellarg($data['new']['document_root'].'/'.$log_folder));
            //* add mountpoint to fstab
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.'    none    bind,nobootwait    0 0';
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.'    none    bind,nobootwait,_netdev    0 0';
            $app->system->replaceLine('/etc/fstab', $fstab_line, $fstab_line, 1, 1);
        }
@@ -2378,7 +2380,7 @@
                    if(substr($ini_setting, 0, 1) == ';') continue;
                    if(substr($ini_setting, 0, 1) == '#') continue;
                    if(substr($ini_setting, 0, 2) == '//') continue;
                    list($key, $value) = explode('=', $ini_setting);
                    list($key, $value) = explode('=', $ini_setting, 2);
                    if($value){
                        $value = trim($value);
                        $key = trim($key);