tbrehm
2009-05-05 24854cb22b746425ebad00aacd4af7e677666c03
Merged the following revisions from Trunk:

1153-1156
1176-1185
1187-1196

updated version number to 3.0.1.2
48 files modified
4 files added
762 ■■■■■ changed files
TODO.txt 2 ●●●●● patch | view | raw | blame | history
install/dist/lib/fedora.lib.php 4 ●●● patch | view | raw | blame | history
install/dist/lib/opensuse.lib.php 4 ●●● patch | view | raw | blame | history
install/lib/install.lib.php 47 ●●●● patch | view | raw | blame | history
install/lib/installer_base.lib.php 4 ●●● patch | view | raw | blame | history
install/sql/ispconfig3.sql 4 ●●● patch | view | raw | blame | history
install/tpl/apache_ispconfig.conf.master 2 ●●● patch | view | raw | blame | history
install/tpl/config.inc.php.master 4 ●●●● patch | view | raw | blame | history
install/tpl/pureftpd_mysql.conf.master 10 ●●●● patch | view | raw | blame | history
install/update.php 1 ●●●● patch | view | raw | blame | history
interface/lib/classes/tform.inc.php 6 ●●●● patch | view | raw | blame | history
interface/web/client/templates/client_edit_limits.htm 2 ●●● patch | view | raw | blame | history
interface/web/dns/dns_a_edit.php 5 ●●●●● patch | view | raw | blame | history
interface/web/dns/dns_aaaa_edit.php 139 ●●●●● patch | view | raw | blame | history
interface/web/dns/dns_alias_edit.php 5 ●●●●● patch | view | raw | blame | history
interface/web/dns/dns_cname_edit.php 5 ●●●●● patch | view | raw | blame | history
interface/web/dns/dns_hinfo_edit.php 5 ●●●●● patch | view | raw | blame | history
interface/web/dns/dns_mx_edit.php 5 ●●●●● patch | view | raw | blame | history
interface/web/dns/dns_ns_edit.php 5 ●●●●● patch | view | raw | blame | history
interface/web/dns/dns_ptr_edit.php 5 ●●●●● patch | view | raw | blame | history
interface/web/dns/dns_rp_edit.php 5 ●●●●● patch | view | raw | blame | history
interface/web/dns/dns_soa_edit.php 12 ●●●●● patch | view | raw | blame | history
interface/web/dns/dns_srv_edit.php 5 ●●●●● patch | view | raw | blame | history
interface/web/dns/dns_txt_edit.php 5 ●●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_a.tform.php 16 ●●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_aaaa.tform.php 159 ●●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_alias.tform.php 16 ●●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_cname.tform.php 18 ●●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_hinfo.tform.php 16 ●●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_mx.tform.php 16 ●●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_ns.tform.php 16 ●●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_ptr.tform.php 16 ●●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_rp.tform.php 16 ●●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_srv.tform.php 16 ●●●●● patch | view | raw | blame | history
interface/web/dns/form/dns_txt.tform.php 16 ●●●●● patch | view | raw | blame | history
interface/web/dns/lib/lang/en_dns_aaaa.lng 15 ●●●●● patch | view | raw | blame | history
interface/web/dns/list/dns_a.list.php 2 ●●● patch | view | raw | blame | history
interface/web/dns/templates/dns_a_list.htm 3 ●●●●● patch | view | raw | blame | history
interface/web/dns/templates/dns_aaaa_edit.htm 39 ●●●●● patch | view | raw | blame | history
interface/web/mail/mail_domain_catchall_edit.php 2 ●●● patch | view | raw | blame | history
interface/web/mail/mail_user_edit.php 2 ●●● patch | view | raw | blame | history
interface/web/sites/templates/web_domain_edit.htm 2 ●●● patch | view | raw | blame | history
server/conf/apache_ispconfig.conf.master 2 ●●● patch | view | raw | blame | history
server/conf/vhost.conf.master 8 ●●●● patch | view | raw | blame | history
server/lib/classes/modules.inc.php 25 ●●●● patch | view | raw | blame | history
server/mods-available/monitor_core_module.inc.php 5 ●●●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php 19 ●●●●● patch | view | raw | blame | history
server/plugins-available/maildrop_plugin.inc.php 4 ●●●● patch | view | raw | blame | history
server/plugins-available/shelluser_base_plugin.inc.php 15 ●●●● patch | view | raw | blame | history
server/plugins-available/shelluser_jailkit_plugin.inc.php 3 ●●●●● patch | view | raw | blame | history
server/scripts/create_jailkit_user.sh 2 ●●● patch | view | raw | blame | history
server/server.php 2 ●●● patch | view | raw | blame | history
TODO.txt
@@ -6,7 +6,6 @@
Please feel free to edit this file, add new tasks,
remove done tasks or assign yourself to a task.
Installer
--------------------------------------
@@ -71,7 +70,6 @@
Remoting framework
--------------------------------------
Interface
install/dist/lib/fedora.lib.php
@@ -83,7 +83,7 @@
        $postconf_commands = array (
            'myhostname = '.$conf['hostname'],
            'mydestination = '.$conf['hostname'].', localhost, localhost.localdomain',
            'mynetworks = 127.0.0.0/8',
            'mynetworks = 127.0.0.0/8 [::1]/128',
            'virtual_alias_domains =',
            'virtual_alias_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_forwardings.cf, mysql:'.$config_dir.'/mysql-virtual_email2email.cf',
            'virtual_mailbox_domains = proxy:mysql:'.$config_dir.'/mysql-virtual_domains.cf',
@@ -554,6 +554,8 @@
        $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content);
        
        $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content);
        $content = str_replace('{language}', $conf['language'], $content);
        wf("$install_dir/interface/lib/$configfile", $content);
        
        //* Create the config file for ISPConfig server
install/dist/lib/opensuse.lib.php
@@ -83,7 +83,7 @@
        $postconf_commands = array (
            'myhostname = '.$conf['hostname'],
            'mydestination = '.$conf['hostname'].', localhost, localhost.localdomain',
            'mynetworks = 127.0.0.0/8',
            'mynetworks = 127.0.0.0/8 [::1]/128',
            'virtual_alias_domains =',
            'virtual_alias_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_forwardings.cf, mysql:'.$config_dir.'/mysql-virtual_email2email.cf',
            'virtual_mailbox_domains = proxy:mysql:'.$config_dir.'/mysql-virtual_domains.cf',
@@ -577,6 +577,8 @@
        $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content);
        
        $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content);
        $content = str_replace('{language}', $conf['language'], $content);
        wf("$install_dir/interface/lib/$configfile", $content);
        
        //* Create the config file for ISPConfig server
install/lib/install.lib.php
@@ -59,6 +59,9 @@
function get_distname() {
    
    $distname = '';
    $distver = '';
    $distid = '';
    $distbaseid = '';
    
    //** Debian or Ubuntu
    if(file_exists('/etc/debian_version')) {
@@ -69,13 +72,18 @@
            $distid = 'debian40';
            $distbaseid = 'debian';
            swriteln("Operating System: Debian 4.0 or compatible\n");
        }
        if(trim(file_get_contents('/etc/debian_version')) == '5.0' || trim(file_get_contents('/etc/debian_version')) == 'lenny/sid') {
        } elseif(strstr(trim(file_get_contents('/etc/debian_version')),'5.0') || trim(file_get_contents('/etc/debian_version')) == 'lenny/sid') {
            $distname = 'Debian';
            $distver = 'Lenny/Sid';
            $distid = 'debian40';
            $distbaseid = 'debian';
            swriteln("Operating System: Debian Lenny/Sid or compatible\n");
        }  else {
            $distname = 'Debian';
            $distver = 'Unknown';
            $distid = 'debian40';
            $distbaseid = 'debian';
            swriteln("Operating System: Debian or compatible, unknown version.\n");
        }
    }
    
@@ -87,13 +95,24 @@
            $distid = 'opensuse110';
            $distbaseid = 'opensuse';
            swriteln("Operating System: openSUSE 11.0 or compatible\n");
        }
        if(stristr(file_get_contents('/etc/SuSE-release'),'11.1')) {
        } elseif(stristr(file_get_contents('/etc/SuSE-release'),'11.1')) {
            $distname = 'openSUSE';
            $distver = '11.1';
            $distid = 'opensuse110';
            $distbaseid = 'opensuse';
            swriteln("Operating System: openSUSE 11.1 or compatible\n");
        } elseif(stristr(file_get_contents('/etc/SuSE-release'),'11.2')) {
            $distname = 'openSUSE';
            $distver = '11.1';
            $distid = 'opensuse110';
            $distbaseid = 'opensuse';
            swriteln("Operating System: openSUSE 11.2 or compatible\n");
        }  else {
            $distname = 'openSUSE';
            $distver = 'Unknown';
            $distid = 'opensuse110';
            $distbaseid = 'opensuse';
            swriteln("Operating System: openSUSE or compatible, unknown version.\n");
        }
    }
    
@@ -109,22 +128,30 @@
            $distid = 'fedora9';
            $distbaseid = 'fedora';
            swriteln("Operating System: Fedora 9 or compatible\n");
        }
        if(stristr($content,'Fedora release 10 (Cambridge)')) {
        } elseif(stristr($content,'Fedora release 10 (Cambridge)')) {
            $distname = 'Fedora';
            $distver = '10';
            $distid = 'fedora9';
            $distbaseid = 'fedora';
            swriteln("Operating System: Fedora 10 or compatible\n");
        }
        if(stristr($content,'CentOS release 5.2 (Final)')) {
        } elseif(stristr($content,'CentOS release 5.2 (Final)')) {
            $distname = 'CentOS';
            $distver = '5.2';
            $distid = 'centos52';
            $distbaseid = 'fedora';
            swriteln("Operating System: CentOS 5.2 or compatible\n");
        } elseif(stristr($content,'CentOS release 5.3 (Final)')) {
            $distname = 'CentOS';
            $distver = '5.3';
            $distid = 'centos52';
            $distbaseid = 'fedora';
            swriteln("Operating System: CentOS 5.3 or compatible\n");
        } else {
            $distname = 'Redhat';
            $distver = 'Unknown';
            $distid = 'fedora9';
            $distbaseid = 'fedora';
            swriteln("Operating System: Redhat or compatible, unknown version.\n");
        }
        
        
install/lib/installer_base.lib.php
@@ -366,7 +366,7 @@
        $postconf_commands = array (
            'myhostname = '.$conf['hostname'],
            'mydestination = '.$conf['hostname'].', localhost, localhost.localdomain',
            'mynetworks = 127.0.0.0/8',
            'mynetworks = 127.0.0.0/8 [::1]/128',
            'virtual_alias_domains =',
            'virtual_alias_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_forwardings.cf, mysql:'.$config_dir.'/mysql-virtual_email2email.cf',
            'virtual_mailbox_domains = proxy:mysql:'.$config_dir.'/mysql-virtual_domains.cf',
@@ -857,6 +857,8 @@
        $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content);
        
        $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content);
        $content = str_replace('{language}', $conf['language'], $content);
        wf("$install_dir/interface/lib/$configfile", $content);
        
        //* Create the config file for ISPConfig server
install/sql/ispconfig3.sql
@@ -165,6 +165,8 @@
  `aux` int(11) unsigned NOT NULL default '0',
  `ttl` int(11) unsigned NOT NULL default '86400',
  `active` enum('N','Y') NOT NULL default 'Y',
  `stamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
  `serial` int(10) unsigned default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `rr` (`zone`,`name`,`type`,`data`)
) ENGINE=MyISAM AUTO_INCREMENT=1;
@@ -1146,7 +1148,7 @@
-- Dumping data for table `sys_config`
--
INSERT INTO sys_config VALUES ('1','db','db_version','3.0.0.9');
INSERT INTO sys_config VALUES ('1','db','db_version','3.0.1.2');
-- --------------------------------------------------------
install/tpl/apache_ispconfig.conf.master
@@ -4,7 +4,7 @@
# ISPConfig Logfile configuration for vlogger
################################################
LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
LogFormat "%v %h %l %u %t \"%r\" %>s %B \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
CustomLog "| /usr/sbin/vlogger -s access.log -t \"%Y%m%d-access.log\" /var/log/ispconfig/httpd" combined_ispconfig
<Directory /var/www/clients>
install/tpl/config.inc.php.master
@@ -57,7 +57,7 @@
//** Application
define('ISPC_APP_TITLE', 'ISPConfig');
define('ISPC_APP_VERSION', '3.0.1.1');
define('ISPC_APP_VERSION', '3.0.1.2');
//** Database
@@ -133,7 +133,7 @@
//** Default Language
$conf["language"] = 'en';
$conf["language"] = '{language}';
//** Misc.
install/tpl/pureftpd_mysql.conf.master
@@ -97,21 +97,21 @@
# The number should be in Megabytes.
# Pure-FTPd must have been compiled with virtual quotas support.
MySQLGetQTASZ  SELECT quota_size FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND quota_files != '-1' AND username="\L"
MySQLGetQTASZ  SELECT quota_size FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND quota_size != '-1' AND username="\L"
# Optional : ratios. The server has to be compiled with ratio support.
MySQLGetRatioUL SELECT ul_ratio FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND quota_files != '-1' AND username="\L"
MySQLGetRatioDL SELECT dl_ratio FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND quota_files != '-1' AND username="\L"
MySQLGetRatioUL SELECT ul_ratio FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND ul_ratio != '-1' AND username="\L"
MySQLGetRatioDL SELECT dl_ratio FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND dl_ratio != '-1' AND username="\L"
# Optional : bandwidth throttling.
# The server has to be compiled with throttling support.
# Values are in KB/s .
MySQLGetBandwidthUL SELECT ul_bandwidth FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND quota_files != '-1' AND username="\L"
MySQLGetBandwidthDL SELECT dl_bandwidth FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND quota_files != '-1' AND username="\L"
MySQLGetBandwidthUL SELECT ul_bandwidth FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND ul_bandwidth != '-1' AND username="\L"
MySQLGetBandwidthDL SELECT dl_bandwidth FROM ftp_user WHERE active = 'y' AND server_id = '{server_id}' AND dl_bandwidth != '-1' AND username="\L"
# Enable ~ expansion. NEVER ENABLE THIS BLINDLY UNLESS :
# 1) You know what you are doing.
install/update.php
@@ -88,6 +88,7 @@
$conf['mysql']['charset'] = 'utf8';
$conf["mysql"]["ispconfig_user"] = $conf_old["db_user"];
$conf["mysql"]["ispconfig_password"] = $conf_old["db_password"];
$conf['language'] = $conf_old['language'];
if(isset($conf_old["dbmaster_host"])) $conf["mysql"]["master_host"] = $conf_old["dbmaster_host"];
if(isset($conf_old["dbmaster_database"])) $conf["mysql"]["master_database"] = $conf_old["dbmaster_database"];
interface/lib/classes/tform.inc.php
@@ -160,11 +160,11 @@
                        foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) {
                                switch ($field['datatype']) {
                                case 'VARCHAR':
                                        $new_record[$key] = stripslashes($record[$key]);
                                        $new_record[$key] = $record[$key];
                                break;
                                case 'TEXT':
                                        $new_record[$key] = stripslashes($record[$key]);
                                        $new_record[$key] = $record[$key];
                                break;
                                case 'DATE':
@@ -186,7 +186,7 @@
                                break;
                                default:
                                        $new_record[$key] = stripslashes($record[$key]);
                                        $new_record[$key] = $record[$key];
                                }
                        }
interface/web/client/templates/client_edit_limits.htm
@@ -75,7 +75,7 @@
            </div>
      <div class="ctrlHolder">
          <label for="limit_mailquota">{tmpl_var name='limit_mailquota_txt'}</label>
        <input name="limit_mailquota" id="limit_mailquota" value="{tmpl_var name='limit_mailquota'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />
        <input name="limit_mailquota" id="limit_mailquota" value="{tmpl_var name='limit_mailquota'}" size="10" maxlength="10" type="text" class="textInput formLengthLimit" />&nbsp;MB
            </div>
      <div class="ctrlHolder">
          <label for="limit_spamfilter_wblist">{tmpl_var name='limit_spamfilter_wblist_txt'}</label>
interface/web/dns/dns_a_edit.php
@@ -100,6 +100,11 @@
        // Set the server ID of the rr record to the same server ID as the parent record.
        $this->dataRecord["server_id"] = $soa["server_id"];
        
        // Update the serial number  and timestamp of the RR record
        $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id);
        $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]);
        $this->dataRecord["stamp"] = date('Y-m-d H:i:s');
        parent::onSubmit();
    }
    
interface/web/dns/dns_aaaa_edit.php
New file
@@ -0,0 +1,139 @@
<?php
/*
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
    * Neither the name of ISPConfig nor the names of its contributors
      may be used to endorse or promote products derived from this software without
      specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/******************************************
* Begin Form configuration
******************************************/
$tform_def_file = "form/dns_aaaa.tform.php";
/******************************************
* End Form configuration
******************************************/
require_once('../../lib/config.inc.php');
require_once('../../lib/app.inc.php');
//* Check permissions for module
$app->auth->check_module_permissions('dns');
// Loading classes
$app->uses('tpl,tform,tform_actions,validate_dns');
$app->load('tform_actions');
class page_action extends tform_actions {
    function onShowNew() {
        global $app, $conf;
        // we will check only users, not admins
        if($_SESSION["s"]["user"]["typ"] == 'user') {
            // Get the limits of the client
            $client_group_id = $_SESSION["s"]["user"]["default_group"];
            $client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
            // Check if the user may add another mailbox.
            if($client["limit_dns_record"] >= 0) {
                $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
                if($tmp["number"] >= $client["limit_dns_record"]) {
                    $app->error($app->tform->wordbook["limit_dns_record_txt"]);
                }
            }
        }
        parent::onShowNew();
    }
    function onSubmit() {
        global $app, $conf;
        // Get the parent soa record of the domain
        $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
        // Check if Domain belongs to user
        if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
        // Check the client limits, if user is not the admin
        if($_SESSION["s"]["user"]["typ"] != 'admin') { // if user is not admin
            // Get the limits of the client
            $client_group_id = $_SESSION["s"]["user"]["default_group"];
            $client = $app->db->queryOneRecord("SELECT limit_dns_record FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
            // Check if the user may add another mailbox.
            if($this->id == 0 && $client["limit_dns_record"] >= 0) {
                $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_rr WHERE sys_groupid = $client_group_id");
                if($tmp["number"] >= $client["limit_dns_record"]) {
                    $app->error($app->tform->wordbook["limit_dns_record_txt"]);
                }
            }
        } // end if user is not admin
        // Set the server ID of the rr record to the same server ID as the parent record.
        $this->dataRecord["server_id"] = $soa["server_id"];
        // Update the serial number  and timestamp of the RR record
        $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id);
        $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]);
        $this->dataRecord["stamp"] = date('Y-m-d H:i:s');
        parent::onSubmit();
    }
    function onAfterInsert() {
        global $app, $conf;
        //* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
        $soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
        $app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id);
        //* Update the serial number of the SOA record
        $soa_id = intval($_POST["zone"]);
        $serial = $app->validate_dns->increase_serial($soa["serial"]);
        $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
    }
    function onAfterUpdate() {
        global $app, $conf;
        //* Update the serial number of the SOA record
        $soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
        $soa_id = intval($_POST["zone"]);
        $serial = $app->validate_dns->increase_serial($soa["serial"]);
        $app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
    }
}
$page = new page_action;
$page->onLoad();
?>
interface/web/dns/dns_alias_edit.php
@@ -100,6 +100,11 @@
        // Set the server ID of the rr record to the same server ID as the parent record.
        $this->dataRecord["server_id"] = $soa["server_id"];
        
        // Update the serial number  and timestamp of the RR record
        $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id);
        $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]);
        $this->dataRecord["stamp"] = date('Y-m-d H:i:s');
        parent::onSubmit();
    }
    
interface/web/dns/dns_cname_edit.php
@@ -100,6 +100,11 @@
        // Set the server ID of the rr record to the same server ID as the parent record.
        $this->dataRecord["server_id"] = $soa["server_id"];
        
        // Update the serial number  and timestamp of the RR record
        $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id);
        $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]);
        $this->dataRecord["stamp"] = date('Y-m-d H:i:s');
        parent::onSubmit();
    }
    
interface/web/dns/dns_hinfo_edit.php
@@ -100,6 +100,11 @@
        // Set the server ID of the rr record to the same server ID as the parent record.
        $this->dataRecord["server_id"] = $soa["server_id"];
        
        // Update the serial number  and timestamp of the RR record
        $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id);
        $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]);
        $this->dataRecord["stamp"] = date('Y-m-d H:i:s');
        parent::onSubmit();
    }
    
interface/web/dns/dns_mx_edit.php
@@ -100,6 +100,11 @@
        // Set the server ID of the rr record to the same server ID as the parent record.
        $this->dataRecord["server_id"] = $soa["server_id"];
        
        // Update the serial number  and timestamp of the RR record
        $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id);
        $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]);
        $this->dataRecord["stamp"] = date('Y-m-d H:i:s');
        parent::onSubmit();
    }
    
interface/web/dns/dns_ns_edit.php
@@ -100,6 +100,11 @@
        // Set the server ID of the rr record to the same server ID as the parent record.
        $this->dataRecord["server_id"] = $soa["server_id"];
        
        // Update the serial number  and timestamp of the RR record
        $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id);
        $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]);
        $this->dataRecord["stamp"] = date('Y-m-d H:i:s');
        parent::onSubmit();
    }
    
interface/web/dns/dns_ptr_edit.php
@@ -100,6 +100,11 @@
        // Set the server ID of the rr record to the same server ID as the parent record.
        $this->dataRecord["server_id"] = $soa["server_id"];
        
        // Update the serial number  and timestamp of the RR record
        $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id);
        $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]);
        $this->dataRecord["stamp"] = date('Y-m-d H:i:s');
        parent::onSubmit();
    }
    
interface/web/dns/dns_rp_edit.php
@@ -100,6 +100,11 @@
        // Set the server ID of the rr record to the same server ID as the parent record.
        $this->dataRecord["server_id"] = $soa["server_id"];
        
        // Update the serial number  and timestamp of the RR record
        $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id);
        $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]);
        $this->dataRecord["stamp"] = date('Y-m-d H:i:s');
        parent::onSubmit();
    }
    
interface/web/dns/dns_soa_edit.php
@@ -175,6 +175,18 @@
            // And we want to update all rr records too, that belong to this record
            $app->db->query("UPDATE dns_rr SET sys_groupid = $client_group_id WHERE zone = ".$this->id);
        }
        //** When the client group has changed, change also the owner of the record if the owner is not the admin user
        if($this->oldDataRecord["client_group_id"] != $this->dataRecord["client_group_id"] && $this->dataRecord["sys_userid"] != 1) {
            $client_group_id = intval($this->dataRecord["client_group_id"]);
            $tmp = $app->db->queryOneREcord("SELECT userid FROM sys_user WHERE default_group = ".$client_group_id);
            if($tmp["userid"] > 0) {
                $app->db->query("UPDATE dns_soa SET sys_userid = ".$tmp["userid"]." WHERE id = ".$this->id);
                $app->db->query("UPDATE dns_rr SET sys_userid = ".$tmp["userid"]." WHERE zone = ".$this->id);
            }
        }
    }
    
}
interface/web/dns/dns_srv_edit.php
@@ -100,6 +100,11 @@
        // Set the server ID of the rr record to the same server ID as the parent record.
        $this->dataRecord["server_id"] = $soa["server_id"];
        
        // Update the serial number  and timestamp of the RR record
        $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id);
        $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]);
        $this->dataRecord["stamp"] = date('Y-m-d H:i:s');
        parent::onSubmit();
    }
    
interface/web/dns/dns_txt_edit.php
@@ -100,6 +100,11 @@
        // Set the server ID of the rr record to the same server ID as the parent record.
        $this->dataRecord["server_id"] = $soa["server_id"];
        
        // Update the serial number  and timestamp of the RR record
        $soa = $app->db->queryOneRecord("SELECT serial FROM dns_rr WHERE id = ".$this->id);
        $this->dataRecord["serial"] = $app->validate_dns->increase_serial($soa["serial"]);
        $this->dataRecord["stamp"] = date('Y-m-d H:i:s');
        parent::onSubmit();
    }
    
interface/web/dns/form/dns_a.tform.php
@@ -132,6 +132,22 @@
            'default'    => 'Y',
            'value'        => array(0 => 'N',1 => 'Y')
        ),
        'stamp' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'serial' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '10',
            'maxlength'    => '10'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
interface/web/dns/form/dns_aaaa.tform.php
New file
@@ -0,0 +1,159 @@
<?php
/*
    Form Definition
    Tabledefinition
    Datatypes:
    - INTEGER (Forces the input to Int)
    - DOUBLE
    - CURRENCY (Formats the values to currency notation)
    - VARCHAR (no format check, maxlength: 255)
    - TEXT (no format check)
    - DATE (Dateformat, automatic conversion to timestamps)
    Formtype:
    - TEXT (Textfield)
    - TEXTAREA (Textarea)
    - PASSWORD (Password textfield, input is not shown when edited)
    - SELECT (Select option field)
    - RADIO
    - CHECKBOX
    - CHECKBOXARRAY
    - FILE
    VALUE:
    - Wert oder Array
    Hint:
    The ID field of the database table is not part of the datafield definition.
    The ID field must be always auto incement (int or bigint).
*/
$form["title"]             = "DNS AAAA";
$form["description"]     = "";
$form["name"]             = "dns_aaaa";
$form["action"]            = "dns_aaaa_edit.php";
$form["db_table"]        = "dns_rr";
$form["db_table_idx"]    = "id";
$form["db_history"]        = "yes";
$form["tab_default"]    = "dns";
$form["list_default"]    = "dns_a_list.php";
$form["auth"]            = 'yes'; // yes / no
$form["auth_preset"]["userid"]  = 0; // 0 = id of the user, > 0 id must match with id of current user
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
$form["tabs"]['dns'] = array (
    'title'     => "DNS AAAA",
    'width'     => 100,
    'template'     => "templates/dns_aaaa_edit.htm",
    'fields'     => array (
    ##################################
    # Begin Datatable fields
    ##################################
        'server_id' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'SELECT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'zone' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'default'    => @intval($_REQUEST["zone"]),
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'name' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'REGEX',
                                                        'regex' => '/^[\w\.\-\*]{0,64}$/',
                                                        'errmsg'=> 'name_error_regex'),
                                    ),
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'type' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => 'AAAA',
            'value'        => '',
            'width'        => '5',
            'maxlength'    => '5'
        ),
        'data' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
                                                        'errmsg'=> 'data_error_empty'),
                                        1 => array (    'type'    => 'REGEX',
                                                        'regex' => '/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})))(%.+)?\s*$/',
                                                        'errmsg'=> 'data_error_regex'),
                                    ),
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        /*
        'aux' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'default'    => '0',
            'value'        => '',
            'width'        => '10',
            'maxlength'    => '10'
        ),
        */
        'ttl' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'default'    => '86400',
            'value'        => '',
            'width'        => '10',
            'maxlength'    => '10'
        ),
        'active' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'CHECKBOX',
            'default'    => 'Y',
            'value'        => array(0 => 'N',1 => 'Y')
        ),
        'stamp' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'serial' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '10',
            'maxlength'    => '10'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
    )
);
?>
interface/web/dns/form/dns_alias.tform.php
@@ -134,6 +134,22 @@
            'default'    => 'Y',
            'value'        => array(0 => 'N',1 => 'Y')
        ),
        'stamp' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'serial' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '10',
            'maxlength'    => '10'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
interface/web/dns/form/dns_cname.tform.php
@@ -78,7 +78,7 @@
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'validators'    => array (     0 => array (    'type'    => 'REGEX',
                                                        'regex' => '/^[\w\.\-]{0,64}$/',
                                                        'regex' => '/^[\w\.\-\*]{0,64}$/',
                                                        'errmsg'=> 'name_error_regex'),
                                    ),
            'default'    => '',
@@ -132,6 +132,22 @@
            'default'    => 'Y',
            'value'        => array(0 => 'N',1 => 'Y')
        ),
        'stamp' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'serial' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '10',
            'maxlength'    => '10'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
interface/web/dns/form/dns_hinfo.tform.php
@@ -131,6 +131,22 @@
            'default'    => 'Y',
            'value'        => array(0 => 'N',1 => 'Y')
        ),
        'stamp' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'serial' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '10',
            'maxlength'    => '10'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
interface/web/dns/form/dns_mx.tform.php
@@ -132,6 +132,22 @@
            'default'    => 'Y',
            'value'        => array(0 => 'N',1 => 'Y')
        ),
        'stamp' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'serial' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '10',
            'maxlength'    => '10'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
interface/web/dns/form/dns_ns.tform.php
@@ -132,6 +132,22 @@
            'default'    => 'Y',
            'value'        => array(0 => 'N',1 => 'Y')
        ),
        'stamp' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'serial' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '10',
            'maxlength'    => '10'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
interface/web/dns/form/dns_ptr.tform.php
@@ -134,6 +134,22 @@
            'default'    => 'Y',
            'value'        => array(0 => 'N',1 => 'Y')
        ),
        'stamp' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'serial' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '10',
            'maxlength'    => '10'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
interface/web/dns/form/dns_rp.tform.php
@@ -132,6 +132,22 @@
            'default'    => 'Y',
            'value'        => array(0 => 'N',1 => 'Y')
        ),
        'stamp' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'serial' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '10',
            'maxlength'    => '10'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
interface/web/dns/form/dns_srv.tform.php
@@ -129,6 +129,22 @@
            'default'    => 'Y',
            'value'        => array(0 => 'N',1 => 'Y')
        ),
        'stamp' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'serial' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '10',
            'maxlength'    => '10'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
interface/web/dns/form/dns_txt.tform.php
@@ -129,6 +129,22 @@
            'default'    => 'Y',
            'value'        => array(0 => 'N',1 => 'Y')
        ),
        'stamp' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
        'serial' => array (
            'datatype'    => 'INTEGER',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '10',
            'maxlength'    => '10'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
interface/web/dns/lib/lang/en_dns_aaaa.lng
New file
@@ -0,0 +1,15 @@
<?php
$wb["server_id_txt"] = 'Server';
$wb["zone_txt"] = 'Zone';
$wb["name_txt"] = 'Hostname';
$wb["type_txt"] = 'type';
$wb["data_txt"] = 'IPv6-Address';
$wb["ttl_txt"] = 'TTL';
$wb["active_txt"] = 'Active';
$wb["limit_dns_record_txt"] = 'The max. number of DNS records for your account is reached.';
$wb["no_zone_perm"] = 'You do not have the permission to add a record to this DNS zone.';
$wb["name_error_empty"] = 'The hostname is empty.';
$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';
?>
interface/web/dns/list/dns_a.list.php
@@ -121,7 +121,7 @@
                            'prefix'    => "",
                            'suffix'    => "",
                            'width'        => "",
                            'value'        => array('A'=>'A','ALIAS'=>'ALIAS','CNAME'=>'CNAME','HINFO'=>'HINFO','MX'=>'MX','NS'=>'NS','PTR'=>'PTR','RP'=>'RP','SRV'=>'SRV','TXT'=>'TXT'));
                            'value'        => array('A'=>'A','AAAA' => 'AAAA','ALIAS'=>'ALIAS','CNAME'=>'CNAME','HINFO'=>'HINFO','MX'=>'MX','NS'=>'NS','PTR'=>'PTR','RP'=>'RP','SRV'=>'SRV','TXT'=>'TXT'));
?>
interface/web/dns/templates/dns_a_list.htm
@@ -4,6 +4,9 @@
        <button class="iconstxt icoAdd" type="button" onClick="loadContent('dns/dns_a_edit.php?zone={tmpl_var name='parent_id'}');">
          <span>A</span>
        </button>
        <button class="iconstxt icoAdd" type="button" onClick="loadContent('dns/dns_aaaa_edit.php?zone={tmpl_var name='parent_id'}');">
          <span>AAAA</span>
        </button>
        <button class="iconstxt icoAdd" type="button" onClick="loadContent('dns/dns_alias_edit.php?zone={tmpl_var name='parent_id'}');">
          <span>ALIAS</span>
        </button>
interface/web/dns/templates/dns_aaaa_edit.htm
New file
@@ -0,0 +1,39 @@
<h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p>
<div class="panel panel_dns_aaaa">
  <div class="pnl_formsarea">
    <fieldset class="inlineLabels">
      <div class="ctrlHolder">
          <label for="name">{tmpl_var name='name_txt'}</label>
        <input name="name" id="name" value="{tmpl_var name='name'}" size="30" maxlength="255" type="text" class="textInput" />
                <p class="formHint">{tmpl_var name='name_hint_txt'}</p>
            </div>
      <div class="ctrlHolder">
          <label for="data">{tmpl_var name='data_txt'}</label>
        <input name="data" id="data" value="{tmpl_var name='data'}" size="30" maxlength="255" type="text" class="textInput formLengthIPv4" />
            </div>
      <div class="ctrlHolder">
          <label for="ttl">{tmpl_var name='ttl_txt'}</label>
        <input name="ttl" id="ttl" value="{tmpl_var name='ttl'}" size="10" maxlength="10" type="text" class="textInput" />
            </div>
      <div class="ctrlHolder">
                <p class="label">{tmpl_var name='active_txt'}</p>
                    <div class="multiField">
                        {tmpl_var name='active'}
                    </div>
            </div>
    </fieldset>
    <input type="hidden" name="id" value="{tmpl_var name='id'}">
    <input type="hidden" name="zone" value="{tmpl_var name='zone'}">
    <input type="hidden" name="type" value="{tmpl_var name='type'}">
    <div class="buttonHolder buttons">
      <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','dns/dns_aaaa_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button>
      <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('dns/dns_soa_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
    </div>
  </div>
</div>
interface/web/mail/mail_domain_catchall_edit.php
@@ -61,7 +61,7 @@
            $client = $app->db->queryOneRecord("SELECT limit_mailcatchall FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
            
            // Check if the user may add another mailbox.
            if($client["limit_mailforward"] >= 0) {
            if($client["limit_mailcatchall"] >= 0) {
                $tmp = $app->db->queryOneRecord("SELECT count(forwarding_id) as number FROM mail_forwarding WHERE sys_groupid = $client_group_id and type = 'catchall'");
                if($tmp["number"] >= $client["limit_mailcatchall"]) {
                    $app->error($app->tform->wordbook["limit_mailcatchall_txt"]);
interface/web/mail/mail_user_edit.php
@@ -254,7 +254,7 @@
            if($policy_id > 0) {
                if($tmp_user["id"] > 0) {
                    // There is already a record that we will update
                    $app->db->datalogUpdate('spamfilter_users', "policy_id = $ploicy_id", 'id', $tmp_user["id"]);
                    $app->db->datalogUpdate('spamfilter_users', "policy_id = $policy_id", 'id', $tmp_user["id"]);
                } else {
                    // We create a new record
                    $insert_data = "(`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_id`, `priority`, `policy_id`, `email`, `fullname`, `local`) 
interface/web/sites/templates/web_domain_edit.htm
@@ -47,7 +47,7 @@
            </div>
      <div class="ctrlHolder">
          <label for="hd_quota">{tmpl_var name='hd_quota_txt'}</label>
        <input name="hd_quota" id="hd_quota" value="{tmpl_var name='hd_quota'}" size="7" maxlength="7" type="text" class="textInput formLengthLimit" />
        <input name="hd_quota" id="hd_quota" value="{tmpl_var name='hd_quota'}" size="7" maxlength="7" type="text" class="textInput formLengthLimit" />&nbsp;MB
            </div>
<!--
      <div class="ctrlHolder">
server/conf/apache_ispconfig.conf.master
@@ -3,7 +3,7 @@
# ISPConfig Logfile configuration for vlogger
################################################
LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
LogFormat "%v %h %l %u %t \"%r\" %>s %B \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
CustomLog "| /usr/sbin/vlogger -s access.log -t \"%Y%m%d-access.log\" /var/log/ispconfig/httpd" combined_ispconfig
<Directory /var/www/clients>
server/conf/vhost.conf.master
@@ -36,7 +36,7 @@
    
    <Directory {tmpl_var name='web_document_root_www'}>
        Options FollowSymLinks
        AllowOverride Indexes AuthConfig Limit
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
<tmpl_if name='ssi' op='==' value='y'>
@@ -56,7 +56,7 @@
    </Directory>
    <Directory {tmpl_var name='web_document_root'}>
        Options FollowSymLinks
        AllowOverride Indexes AuthConfig Limit
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
<tmpl_if name='ssi' op='==' value='y'>
@@ -185,7 +185,7 @@
    
    <Directory {tmpl_var name='web_document_root_www'}>
        Options FollowSymLinks
        AllowOverride Indexes AuthConfig Limit
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
<tmpl_if name='ssi' op='==' value='y'>
@@ -205,7 +205,7 @@
    </Directory>
    <Directory {tmpl_var name='web_document_root'}>
        Options FollowSymLinks
        AllowOverride Indexes AuthConfig Limit
        AllowOverride Indexes AuthConfig Limit FileInfo
        Order allow,deny
        Allow from all
<tmpl_if name='ssi' op='==' value='y'>
server/lib/classes/modules.inc.php
@@ -1,7 +1,7 @@
<?php
/*
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
Copyright (c) 2007 - 2009, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
@@ -88,9 +88,18 @@
            $records = $app->dbmaster->queryAllRecords($sql);
            foreach($records as $d) {
                
                if(!$data = unserialize(stripslashes($d["data"]))) {
                    $data = unserialize($d["data"]);
                //** encode data to utf-8 and unserialize it
                if(!$data = unserialize(utf8_encode(stripslashes($d["data"])))) {
                    $data = unserialize(utf8_encode($d["data"]));
                }
                //** Decode data back to locale
                foreach($data['old'] as $key => $val) {
                    $data['old'][$key] = utf8_decode($val);
                }
                foreach($data['new'] as $key => $val) {
                    $data['new'][$key] = utf8_decode($val);
                }
                $replication_error = false;
                
                $this->current_datalog_id = $d["datalog_id"];
@@ -170,9 +179,19 @@
            $sql = "SELECT * FROM sys_datalog WHERE datalog_id > ".$conf['last_datalog_id']." AND (server_id = ".$conf["server_id"]." OR server_id = 0) ORDER BY datalog_id";
            $records = $app->db->queryAllRecords($sql);
            foreach($records as $d) {
                //** encode data to utf-8 to be able to unserialize it and then unserialize it
                if(!$data = unserialize(utf8_encode(stripslashes($d["data"])))) {
                    $data = unserialize(utf8_encode($d["data"]));
                }
                //** decode data back to current locale
                foreach($data['old'] as $key => $val) {
                    $data['old'][$key] = utf8_decode($val);
                }
                foreach($data['new'] as $key => $val) {
                    $data['new'][$key] = utf8_decode($val);
                }
                $this->current_datalog_id = $d["datalog_id"];
                $this->raiseTableHook($d["dbtable"],$d["action"],$data);
                //$app->db->query("DELETE FROM sys_datalog WHERE datalog_id = ".$rec["datalog_id"]);
server/mods-available/monitor_core_module.inc.php
@@ -221,7 +221,7 @@
                $usePercent = floatval($data[$i]['percent']);
                
                //* We dont want to check the cdrom drive as a cd / dvd is always 100% full
                if($data[$i]['type'] != 'iso9660') {
                if($data[$i]['type'] != 'iso9660' && $data[$i]['type'] != 'cramfs') {
                    if ($usePercent > 75) $state = $this->_setState($state, 'info');
                    if ($usePercent > 80) $state = $this->_setState($state, 'warning');
                    if ($usePercent > 90) $state = $this->_setState($state, 'critical');
@@ -701,7 +701,8 @@
         *  This monitoring is expensive, so do it only once a hour
         */
        $min = date('i');
        if ($min != 0) return;
        $hour = date('H');
        if ($min != 0 && $hour != 23) return;
        global $app;
        global $conf;
server/plugins-available/apache2_plugin.inc.php
@@ -1,7 +1,7 @@
<?php
/*
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
Copyright (c) 2007 - 2009, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
@@ -395,7 +395,24 @@
                }
            }
            exec("chmod -R a+r ".escapeshellcmd($data["new"]["document_root"])."/web/");
        //** Copy the error documents on update when the error document checkbox has been activated and was deactivated before
        } elseif ($this->action == 'update' && $data["new"]["type"] == 'vhost' && $data["old"]["errordocs"] == 0 && $data["new"]["errordocs"] == 1) {
            $error_page_path = escapeshellcmd($data["new"]["document_root"])."/web/error/";
            if (file_exists("/usr/local/ispconfig/server/conf-custom/error/".substr(escapeshellcmd($conf["language"]),0,2))){
                exec("cp /usr/local/ispconfig/server/conf-custom/error/".substr(escapeshellcmd($conf["language"]),0,2)."/* ".$error_page_path);
        }
            else {
                if (file_exists("/usr/local/ispconfig/server/conf-custom/error/400.html")){
                    exec("cp /usr/local/ispconfig/server/conf-custom/error/*.html ".$error_page_path);
                }
                else {
                    exec("cp /usr/local/ispconfig/server/conf/error/".substr(escapeshellcmd($conf["language"]),0,2)."/* ".$error_page_path);
                }
            }
            exec("chmod -R a+r ".$error_page_path);
        }  // end copy error docs
        
        // Create group and user, if not exist
        $app->uses("system");
server/plugins-available/maildrop_plugin.inc.php
@@ -116,6 +116,10 @@
            if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file",LOGLEVEL_WARN);
            $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.vacation.lst';
            if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file",LOGLEVEL_WARN);
            $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.vacation.lst.gdbm';
            if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file",LOGLEVEL_WARN);
            $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.vacation.lst.lock';
            if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file",LOGLEVEL_WARN);
            $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.vacation.msg';
            if(is_file($file)) unlink($file) or $app->log("Unable to delete file: $file",LOGLEVEL_WARN);
            $file = $this->mailfilter_config_dir.'/'.$email_parts[1].'/'.$email_parts[0].'/.autoresponder';
server/plugins-available/shelluser_base_plugin.inc.php
@@ -77,15 +77,16 @@
            $uid = intval($app->system->getuid($data['new']['puser']));
            if($uid > $this->min_uid) {
                $command = 'useradd';
                $command .= ' --home '.escapeshellcmd($data['new']['dir']);
                $command .= ' --gid '.escapeshellcmd($data['new']['pgroup']);
                $command .= ' --non-unique ';
                $command .= ' --password '.escapeshellcmd($data['new']['password']);
                $command .= ' --shell '.escapeshellcmd($data['new']['shell']);
                $command .= ' --uid '.escapeshellcmd($uid);
                $command .= ' -d '.escapeshellcmd($data['new']['dir']);
                $command .= ' -g '.escapeshellcmd($data['new']['pgroup']);
                $command .= ' -o '; // non unique
                if($data['new']['password'] != '') $command .= ' -p '.escapeshellcmd($data['new']['password']);
                $command .= ' -s '.escapeshellcmd($data['new']['shell']);
                $command .= ' -u '.escapeshellcmd($uid);
                $command .= ' '.escapeshellcmd($data['new']['username']);
            
                exec($command);
                $app->log("Executed command: ".$command,LOGLEVEL_DEBUG);
                $app->log("Added shelluser: ".$data['new']['username'],LOGLEVEL_DEBUG);
                
                //* Disable shell user temporarily if we use jailkit
@@ -125,7 +126,7 @@
                    $command .= ' '.escapeshellcmd($data['old']['username']);
            
                    exec($command);
                    // $app->log("Updated shelluser: $command ",LOGLEVEL_DEBUG);
                    $app->log("Executed command: $command ",LOGLEVEL_DEBUG);
                    $app->log("Updated shelluser: ".$data['old']['username'],LOGLEVEL_DEBUG);
                } else {
                    // The user does not exist, so we insert it now
server/plugins-available/shelluser_jailkit_plugin.inc.php
@@ -234,6 +234,9 @@
            $jailkit_chroot_userhome = $this->_get_home_dir($this->data['new']['username']);
            $jailkit_chroot_puserhome = $this->_get_home_dir($this->data['new']['puser']);
            
            if(!is_dir($this->data['new']['dir'].'/etc')) mkdir($this->data['new']['dir'].'/etc');
            if(!is_file($this->data['new']['dir'].'/etc/passwd')) exec('touch '.$this->data['new']['dir'].'/etc/passwd');
            // IMPORTANT!
            // ALWAYS create the user. Even if the user was created before
            // if we check if the user exists, then a update (no shell -> jailkit) will not work
server/scripts/create_jailkit_user.sh
@@ -22,7 +22,7 @@
CHROOT_P_USER_HOMEDIR=$6
### Add the chroot user ###
jk_jailuser  -s $CHROOT_SHELL -j $CHROOT_HOMEDIR $CHROOT_USERNAME
jk_jailuser -n -s $CHROOT_SHELL -j $CHROOT_HOMEDIR $CHROOT_USERNAME
### Reconfigure the chroot home directory for the user ###
usermod --home=$CHROOT_HOMEDIR/.$CHROOT_USERHOMEDIR $CHROOT_USERNAME
server/server.php
@@ -54,7 +54,7 @@
// Check if another process is running
if(is_file($conf["temppath"].$conf["fs_div"].".ispconfig_lock")){
  clearstatcache();
  for($i=0;$i<120;$i++){ // Wait max. 1200 sec, then proceed
  for($i=0;$i<1200;$i++){ // Wait max. 1200 sec, then proceed
    if(is_file($conf["temppath"].$conf["fs_div"].".ispconfig_lock")){
      $app->log("There is already a lockfile set. Waiting another 10 seconds...", LOGLEVEL_DEBUG);
      sleep(10);