Marius Cramer
2014-12-19 62e25488daa4f857f717d2687e820091ffaa8a13
Merge remote-tracking branch 'ispc/master' into new-layout-3.1

Conflicts:
interface/web/themes/default/templates/main.tpl.htm
42 files modified
6 files added
456 ■■■■■ changed files
install/sql/incremental/upd_0079.sql 2 ●●●●● patch | view | raw | blame | history
install/sql/incremental/upd_0080.sql 1 ●●●● patch | view | raw | blame | history
install/sql/ispconfig3.sql 3 ●●●●● patch | view | raw | blame | history
install/tpl/server.ini.master 1 ●●●● patch | view | raw | blame | history
interface/lib/classes/db_mysql.inc.php 2 ●●● patch | view | raw | blame | history
interface/lib/classes/plugin_directive_snippets.inc.php 72 ●●●●● patch | view | raw | blame | history
interface/lib/classes/validate_client.inc.php 78 ●●●●● patch | view | raw | blame | history
interface/lib/lang/en.lng 2 ●●● patch | view | raw | blame | history
interface/web/admin/form/directive_snippets.tform.php 6 ●●●●● patch | view | raw | blame | history
interface/web/admin/form/server_config.tform.php 11 ●●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/de_directive_snippets.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/de_server_config.lng 7 ●●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/en_directive_snippets.lng 1 ●●●● patch | view | raw | blame | history
interface/web/admin/lib/lang/en_server_config.lng 6 ●●●● patch | view | raw | blame | history
interface/web/admin/templates/directive_snippets_edit.htm 17 ●●●●● patch | view | raw | blame | history
interface/web/admin/templates/server_config_web_edit.htm 10 ●●●●● patch | view | raw | blame | history
interface/web/client/form/client.tform.php 7 ●●●● patch | view | raw | blame | history
interface/web/client/form/reseller.tform.php 7 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/de_client.lng 28 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/de_reseller.lng 3 ●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/en_client.lng 25 ●●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/en_reseller.lng 1 ●●●● patch | view | raw | blame | history
interface/web/client/templates/client_edit_limits.htm 4 ●●●● patch | view | raw | blame | history
interface/web/js/scrigo.js.php 4 ●●●● patch | view | raw | blame | history
interface/web/login/password_reset.php 2 ●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/de_mail_forward.lng 1 ●●●● patch | view | raw | blame | history
interface/web/mail/lib/lang/en_mail_forward.lng 1 ●●●● patch | view | raw | blame | history
interface/web/sites/ajax_get_json.php 11 ●●●●● patch | view | raw | blame | history
interface/web/sites/form/web_vhost_domain.tform.php 17 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/de_web_directive_snippets.lng 3 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/de_web_vhost_domain.lng 3 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_web_directive_snippets.lng 3 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_web_vhost_domain.lng 3 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_directive_snippets.htm 14 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_vhost_domain_advanced.htm 2 ●●● patch | view | raw | blame | history
interface/web/sites/templates/web_vhost_domain_edit.htm 23 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_vhost_domain_ssl.htm 10 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_vhost_domain_edit.php 12 ●●●●● patch | view | raw | blame | history
interface/web/themes/default/templates/main.tpl.htm 1 ●●●● patch | view | raw | blame | history
server/conf/apache_apps.vhost.master 10 ●●●● patch | view | raw | blame | history
server/conf/nginx_vhost.conf.master 6 ●●●● patch | view | raw | blame | history
server/conf/php-cgi-starter.master 4 ●●●● patch | view | raw | blame | history
server/conf/php-fcgi-starter.master 3 ●●●●● patch | view | raw | blame | history
server/conf/php_fpm_pool.conf.master 4 ●●●● patch | view | raw | blame | history
server/conf/vhost.conf.master 3 ●●●●● patch | view | raw | blame | history
server/lib/classes/db_mysql.inc.php 4 ●●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php 6 ●●●●● patch | view | raw | blame | history
server/plugins-available/nginx_plugin.inc.php 11 ●●●●● patch | view | raw | blame | history
install/sql/incremental/upd_0079.sql
New file
@@ -0,0 +1,2 @@
ALTER TABLE `directive_snippets` ADD `customer_viewable` ENUM('n','y') NOT NULL DEFAULT 'n' AFTER `snippet`;
ALTER TABLE `web_domain` ADD `directive_snippets_id` int(11) unsigned NOT NULL default '0';
install/sql/incremental/upd_0080.sql
New file
@@ -0,0 +1 @@
ALTER TABLE `web_domain` ADD COLUMN `enable_spdy` ENUM('y','n') NULL DEFAULT 'n' AFTER `proxy_directives`;
install/sql/ispconfig3.sql
@@ -429,6 +429,7 @@
  `name` varchar(255) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `snippet` mediumtext,
  `customer_viewable` ENUM('n','y') NOT NULL DEFAULT 'n',
  `active` enum('n','y') NOT NULL DEFAULT 'y',
  PRIMARY KEY (`directive_snippets_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -1876,10 +1877,12 @@
  `traffic_quota_lock` enum('n','y') NOT NULL default 'n',
  `fastcgi_php_version` varchar(255) DEFAULT NULL,
  `proxy_directives` mediumtext,
  `enable_spdy` ENUM('y','n') NULL DEFAULT 'n',
  `last_quota_notification` date NULL default NULL,
  `rewrite_rules` mediumtext,
  `added_date` date NOT NULL DEFAULT '0000-00-00',
  `added_by` varchar(255) DEFAULT NULL,
  `directive_snippets_id` int(11) unsigned NOT NULL default '0',
  PRIMARY KEY  (`domain_id`),
  UNIQUE KEY `serverdomain` (  `server_id` , `ip_address`,  `domain` )
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
install/tpl/server.ini.master
@@ -85,6 +85,7 @@
php_ini_path_cgi=/etc/php5/cgi/php.ini
check_apache_config=y
enable_sni=y
enable_spdy=n
enable_ip_wildcard=y
overtraffic_notify_admin=y
overtraffic_notify_client=y
interface/lib/classes/db_mysql.inc.php
@@ -86,7 +86,7 @@
            $this->_sqlerror('Zugriff auf Datenbankserver fehlgeschlagen! / Database server not accessible!');
            return false;
        }
        if(!((bool)mysqli_query( $this->_iConnId, "USE $this->dbName"))) {
        if(!((bool)mysqli_query( $this->_iConnId, 'USE `' . $this->dbName . '`'))) {
            $this->close();
            $this->_sqlerror('Datenbank nicht gefunden / Database not found');
            return false;
interface/lib/classes/plugin_directive_snippets.inc.php
New file
@@ -0,0 +1,72 @@
<?php
class plugin_directive_snippets extends plugin_base
{
    var $module;
    var $form;
    var $tab;
    var $record_id;
    var $formdef;
    var $options;
    public function onShow()
    {
        global $app;
        $listTpl = new tpl;
        $listTpl->newTemplate('templates/web_directive_snippets.htm');
        //* Loading language file
        $lng_file = "lib/lang/".$_SESSION["s"]["language"]."_web_directive_snippets.lng";
        include $lng_file;
        $listTpl->setVar($wb);
        $message = '';
        $error   = '';
        $server_type = $app->getconf->get_server_config($this->form->dataRecord['server_id'], 'web');
        $server_type = $server_type['server_type'];
        $records = $app->db->queryAllRecords("SELECT directive_snippets_id, name FROM directive_snippets WHERE customer_viewable = 'y' AND type = ? ORDER BY name ASC", $server_type);
        for ($i = 0, $c = count($records); $i < $c; $i++)
        {
            $records[$i]['is_selected'] = false;
            if ($this->form->dataRecord['directive_snippets_id'] === $records[$i]['directive_snippets_id'])
                $records[$i]['is_selected'] = true;
        }
        $listTpl->setLoop('records', $records);
        $list_name = 'directive_snippets_list';
        $_SESSION["s"]["list"][$list_name]["parent_id"] = $this->form->id;
        $_SESSION["s"]["list"][$list_name]["parent_name"] = $app->tform->formDef["name"];
        $_SESSION["s"]["list"][$list_name]["parent_tab"] = $_SESSION["s"]["form"]["tab"];
        $_SESSION["s"]["list"][$list_name]["parent_script"] = $app->tform->formDef["action"];
        $_SESSION["s"]["form"]["return_to"] = $list_name;
        return $listTpl->grab();
    }
    public function onUpdate()
    {
        global $app, $conf;
        if (isset($this->form->dataRecord['directive_snippets_id']) && $this->form->oldDataRecord['directive_snippets_id'] !== $this->form->dataRecord['directive_snippets_id']) {
            $app->db->query('UPDATE web_domain SET directive_snippets_id = ? WHERE domain_id = ?', $this->form->dataRecord['directive_snippets_id'], $this->form->id);
        }
    }
    public function onInsert()
    {
        global $app, $conf;
        if (isset($this->form->dataRecord['directive_snippets_id'])) {
            $app->db->query('UPDATE web_domain SET directive_snippets_id = ? WHERE domain_id = ?', $this->form->dataRecord['directive_snippets_id'], $this->form->id);
        }
    }
}
?>
interface/lib/classes/validate_client.inc.php
@@ -136,7 +136,85 @@
        }
    }
    function check_vat_id ($field_name, $field_value, $validator){
        global $app, $page;
        $vatid = trim($field_value);
        if(isset($app->remoting_lib->primary_id)) {
            $country = $app->remoting_lib->dataRecord['country'];
        } else {
            $country = $page->dataRecord['country'];
        }
        // check if country is member of EU
        $country_details = $app->db->queryOneRecord("SELECT * FROM country WHERE iso = '".$country."'");
        if($country_details['eu'] == 'y' && $vatid != ''){
            $vatid = preg_replace('/\s+/', '', $vatid);
            $vatid = str_replace(array('.', '-', ','), '', $vatid);
            $cc = substr($vatid, 0, 2);
            $vn = substr($vatid, 2);
            // Test if the country of the VAT-ID matches the country of the customer
            if($country != ''){
                if(strtoupper($cc) != $country){
                    $errmsg = $validator['errmsg'];
                    if(isset($app->tform->wordbook[$errmsg])) {
                        return $app->tform->wordbook[$errmsg]."<br>\r\n";
                    } else {
                        return $errmsg."<br>\r\n";
                    }
                }
            }
            $client = new SoapClient("http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl");
            if($client){
                $params = array('countryCode' => $cc, 'vatNumber' => $vn);
                try{
                    $r = $client->checkVat($params);
                    if($r->valid == true){
                    } else {
                        $errmsg = $validator['errmsg'];
                            if(isset($app->tform->wordbook[$errmsg])) {
                                return $app->tform->wordbook[$errmsg]."<br>\r\n";
                            } else {
                                return $errmsg."<br>\r\n";
                            }
                    }
                    // This foreach shows every single line of the returned information
                    /*
                    foreach($r as $k=>$prop){
                        echo $k . ': ' . $prop;
                    }
                    */
                } catch(SoapFault $e) {
                    //echo 'Error, see message: '.$e->faultstring;
                    switch ($e->faultstring) {
                        case 'INVALID_INPUT':
                            $errmsg = $validator['errmsg'];
                            if(isset($app->tform->wordbook[$errmsg])) {
                                return $app->tform->wordbook[$errmsg]."<br>\r\n";
                            } else {
                                return $errmsg."<br>\r\n";
                            }
                            break;
                        // the following cases shouldn't be the user's fault, so we return no error
                        case 'SERVICE_UNAVAILABLE':
                        case 'MS_UNAVAILABLE':
                        case 'TIMEOUT':
                        case 'SERVER_BUSY':
                            break;
                    }
                }
            } else {
                // Connection to host not possible, europe.eu down?
                // this shouldn't be the user's fault, so we return no error
            }
        }
    }
}
interface/lib/lang/en.lng
@@ -26,7 +26,7 @@
$wb['filter_txt'] = "Filter";
$wb['add_new_record_txt'] = "Add new record";
$wb['btn_save_txt'] = "Save";
$wb['btn_cancel_txt'] = "Back";
$wb['btn_cancel_txt'] = "Cancel";
$wb['top_menu_system'] = 'System';
$wb['top_menu_client'] = 'Client';
$wb['top_menu_email'] = 'Email';
interface/web/admin/form/directive_snippets.tform.php
@@ -93,6 +93,12 @@
            'maxlength' => '255',
            'searchable' => 2
        ),
        'customer_viewable' => array (
            'datatype' => 'VARCHAR',
            'formtype' => 'CHECKBOX',
            'default' => 'n',
            'value'  => array(0 => 'n', 1 => 'y')
        ),
        'active' => array (
            'datatype' => 'VARCHAR',
            'formtype' => 'CHECKBOX',
interface/web/admin/form/server_config.tform.php
@@ -993,7 +993,7 @@
            'datatype' => 'VARCHAR',
            'formtype' => 'SELECT',
            'default' => 'fast-cgi',
            'value' => array('no' => 'disabled_txt', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP', 'php-fpm' => 'PHP-FPM'),
            'value' => array('no' => 'disabled_txt', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP', 'php-fpm' => 'PHP-FPM', 'hhvm' => 'HHVM'),
            'searchable' => 2
        ),
        'nginx_cgi_socket' => array(
@@ -1021,6 +1021,15 @@
            'width' => '40',
            'maxlength' => '255'
        ),
        'enable_spdy' => array (
            'datatype' => 'VARCHAR',
            'formtype' => 'CHECKBOX',
            'default'  => 'n',
            'value' => array (
                0 => 'n',
                1 => 'y'
            )
        ),
        'apps_vhost_port' => array(
            'datatype' => 'VARCHAR',
            'formtype' => 'TEXT',
interface/web/admin/lib/lang/de_directive_snippets.lng
@@ -7,4 +7,5 @@
$wb['directive_snippets_name_empty'] = 'Bitte geben Sie einen Namen für den Schnipsel an.';
$wb['directive_snippets_name_error_unique'] = 'Es existiert schon ein Direktiven-Schnipsel mit diesem Namen.';
$wb['variables_txt'] = 'Variablen';
$wb['customer_viewable_txt'] = 'Sichtbar für Kunden';
?>
interface/web/admin/lib/lang/de_server_config.lng
@@ -256,4 +256,11 @@
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Netzwerk-Dateisystem';
$wb['overquota_db_notify_admin_txt'] = 'Datenbank-Quota-Warnungen an den Administrator senden';
$wb['overquota_db_notify_client_txt'] = 'Datenbank-Quota-Warnungen an den Kunden senden';
$wb['php_ini_check_minutes_txt'] = 'Prüfe php.ini alle X Minuten auf Ã„nderungen';
$wb['php_ini_check_minutes_error_empty'] = 'Bitte geben Sie einen Wert an, wie oft die php.ini auf Ã„nderungen geprüft werden soll.';
$wb['php_ini_check_minutes_info_txt'] = '0 = keine Prüfung';
$wb['php_handler_txt'] = 'Standard-PHP-Handler';
$wb['enable_spdy_txt'] = 'Stellt SPDY zur Verfügung';
?>
interface/web/admin/lib/lang/en_directive_snippets.lng
@@ -7,4 +7,5 @@
$wb["directive_snippets_name_empty"] = 'Please specify a name for the snippet.';
$wb["directive_snippets_name_error_unique"] = 'There is already a directive snippet with this name.';
$wb['variables_txt'] = 'Variables';
$wb['customer_viewable_txt'] = 'Customer viewable';
?>
interface/web/admin/lib/lang/en_server_config.lng
@@ -205,7 +205,7 @@
$wb["overquota_db_notify_admin_txt"] = 'Send DB quota warnings to admin';
$wb["overquota_db_notify_client_txt"] = 'Send DB quota warnings to client';
$wb['monitor_system_updates_txt'] = 'Check for Linux updates';
$wb['php_handler_txt'] = "PHP Handler";
$wb['php_handler_txt'] = "Default PHP Handler";
$wb['disabled_txt'] = 'Disabled';
$wb['dkim_strength_txt'] = 'DKIM strength';
$wb['monitor_system_updates_txt'] = 'Check for Linux updates';
@@ -260,4 +260,8 @@
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
$wb['php_ini_check_minutes_txt'] = 'Check php.ini every X minutes for changes';
$wb['php_ini_check_minutes_error_empty'] = 'Please specify a value how often php.ini should be checked for changes.';
$wb['php_ini_check_minutes_info_txt'] = '0 = no check';
$wb['enable_spdy_txt'] = 'Makes SPDY available';
?>
interface/web/admin/templates/directive_snippets_edit.htm
@@ -19,6 +19,12 @@
                <label for="snippet">{tmpl_var name='snippet_txt'}</label>
                <textarea name="snippet" id="snippet" rows='10' cols='50' style="width:400px;">{tmpl_var name='snippet'}</textarea><span class="nginx"> &nbsp; {tmpl_var name='variables_txt'}: </span><a href="javascript:void(0);" class="addPlaceholder nginx">{DOCROOT}</a><span class="nginx">, </span><a href="javascript:void(0);" class="addPlaceholder nginx">{FASTCGIPASS}</a>
            </div>
            <div class="ctrlHolder">
                <p class="label">{tmpl_var name='customer_viewable_txt'}</p>
                <div class="multiField">
                    {tmpl_var name='customer_viewable'}
                </div>
            </div>
            <div class="ctrlHolder">
                <p class="label">{tmpl_var name='active_txt'}</p>
                <div class="multiField">
@@ -43,8 +49,19 @@
    } else {
        jQuery('.nginx:visible').hide();
    }
    if (jQuery('#type').val() != 'nginx' && jQuery('#type').val() != 'apache') {
        jQuery('#customer_viewable').closest('div.ctrlHolder:visible').hide();
    }else {
        jQuery('#customer_viewable').closest('div.ctrlHolder:hidden').show();
    }
    
    jQuery('#type').change(function(){
        if (jQuery(this).val() != 'nginx' && jQuery(this).val() != 'apache') {
            jQuery('#customer_viewable').closest('div.ctrlHolder:visible').hide();
        } else {
            jQuery('#customer_viewable').closest('div.ctrlHolder:hidden').show();
        }
        if(jQuery(this).val() == 'nginx'){
            jQuery('.nginx:hidden').show();
        } else {
interface/web/admin/templates/server_config_web_edit.htm
@@ -161,6 +161,14 @@
                        {tmpl_var name='enable_sni'}
                    </div>
                </div>
                <div class="ctrlHolder">
                    <p class="label">
                        <tmpl_var name="enable_spdy_txt">
                    </p>
                    <div class="multiField">
                        <tmpl_var name="enable_spdy">
                    </div>
                </div>
                <div class="ctrlHolder">
                    <label for="CA_path">{tmpl_var name='CA_path_txt'}</label>
                    <input name="CA_path" id="CA_path" value="{tmpl_var name='CA_path'}" size="40" maxlength="255" type="text" autocomplete="off" class="textInput" />
@@ -237,7 +245,7 @@
                </div>
                <div class="ctrlHolder">
                    <label for="php_ini_check_minutes">{tmpl_var name='php_ini_check_minutes_txt'}</label>
                    <input name="php_ini_check_minutes" id="php_ini_check_minutes" value="{tmpl_var name='php_ini_check_minutes'}" size="40" type="text" class="textInput" /> {tmpl_var name='php_ini_check_minutes_info_txt'}
                    <input name="php_ini_check_minutes" id="php_ini_check_minutes" value="{tmpl_var name='php_ini_check_minutes'}" size="40" type="text" class="textInput" /> &nbsp;{tmpl_var name='php_ini_check_minutes_info_txt'}
                </div>
                <div class="ctrlHolder">
                    <label for="php_handler">{tmpl_var name='php_handler_txt'}</label>
interface/web/client/form/client.tform.php
@@ -367,7 +367,12 @@
            'width'  => '30',
            'maxlength' => '255',
            'rows'  => '',
            'cols'  => ''
            'cols'  => '',
            'validators' => array (  0 => array ( 'type' => 'CUSTOM',
                    'class' => 'validate_client',
                    'function' => 'check_vat_id',
                    'errmsg'=> 'invalid_vat_id'),
                ),
        ),
        'company_id' => array (
            'datatype' => 'VARCHAR',
interface/web/client/form/reseller.tform.php
@@ -364,7 +364,12 @@
            'width'  => '30',
            'maxlength' => '255',
            'rows'  => '',
            'cols'  => ''
            'cols'  => '',
            'validators' => array (  0 => array ( 'type' => 'CUSTOM',
                    'class' => 'validate_client',
                    'function' => 'check_vat_id',
                    'errmsg'=> 'invalid_vat_id'),
                ),
        ),
        'company_id' => array (
            'datatype' => 'VARCHAR',
interface/web/client/lib/lang/de_client.lng
@@ -110,7 +110,7 @@
$wb['limit_backup_txt'] = 'Backupfunktion verfügbar';
$wb['limit_dns_slave_zone_error_notint'] = 'Das Secondary DNS Zonen Limit muss eine Zahl sein.';
$wb['customer_no_txt'] = 'Kundennummer';
$wb['vat_id_txt'] = 'USt-ID';
$wb['vat_id_txt'] = 'USt.-ID';
$wb['required_fields_txt'] = '* Benötigte Felder';
$wb['limit_mailmailinglist_txt'] = 'Max. Anzahl an Mailinglisten';
$wb['limit_mailmailinglist_error_notint'] = 'Das Mailinglisten Limit muss eine Zahl sein.';
@@ -151,8 +151,30 @@
$wb['gender_txt'] = 'Anrede';
$wb['gender_m_txt'] = 'Herr';
$wb['gender_f_txt'] = 'Frau';
$wb["web_servers_txt"] = 'Webserver';
$wb["web_servers_placeholder"] = 'Webserver auswählen';
$wb['no_web_server_error'] = 'Bitte wählen Sie mind. einen Webserver aus.';
$wb['web_servers_used'] = 'Der Server, den Sie entfernen möchten, wird als Webserver verwendet. Bitte stellen Sie sicher, daß dieser Server nicht von diesem Kunden benutzt wird, bevor Sie ihn entfernen.';
$wb["dns_servers_txt"] = 'DNS-Server';
$wb["dns_servers_placeholder"] = 'DNS-Server wählen';
$wb['no_dns_server_error'] = 'Bitte wählen Sie mind. einen DNS-Server aus.';
$wb['dns_servers_used'] = 'Der Server, den Sie entfernen möchten, wird als DNS-Server verwendet. Bitte stellen Sie sicher, daß dieser Server nicht von diesem Kunden benutzt wird, bevor Sie ihn entfernen.';
$wb["db_servers_txt"] = 'Datenbank-Server';
$wb["db_servers_placeholder"] = 'Datenbank-Server wählen';
$wb['no_db_server_error'] = 'Bitte wählen Sie mind. einen Datenbank-Server aus.';
$wb['db_servers_used'] = 'Der Server, den Sie entfernen möchten, wird als Datenbank-Server verwendet. Bitte stellen Sie sicher, daß dieser Server nicht von diesem Kunden benutzt wird, bevor Sie ihn entfernen.';
$wb["mail_servers_txt"] = 'Mailserver';
$wb["mail_servers_placeholder"] = 'Mailserver wählen';
$wb['no_mail_server_error'] = 'Bitte wählen Sie mind. einen Mailserver aus.';
$wb['mail_servers_used'] = 'Der Server, den Sie entfernen möchten, wird als Mailserver verwendet. Bitte stellen Sie sicher, daß dieser Server nicht von diesem Kunden benutzt wird, bevor Sie ihn entfernen.';
$wb['added_by_txt'] = 'Added by';
$wb['added_date_txt'] = 'Added date';
$wb['parent_client_id_txt'] = 'Client of reseller';
$wb['none_txt'] = 'none';
$wb['parent_client_id_txt'] = 'Kunde von Reseller';
$wb['none_txt'] = 'keiner';
$wb['limit_database_quota_txt'] = 'Datenbank-Quota';
$wb['limit_database_quota_error_notint'] = 'Das Datenbank-quota muß eine Nummer sein.';
$wb['reseller_txt'] = 'Reseller';
$wb['btn_save_txt'] = 'Speichern';
$wb['btn_cancel_txt'] = 'Abbrechen';
$wb['invalid_vat_id'] = 'Die USt.-ID ist ungültig.';
?>
interface/web/client/lib/lang/de_reseller.lng
@@ -106,7 +106,7 @@
$wb['limit_dns_slave_zone_error_notint'] = 'Das Secondary DNS Zonen Limit muss eine Zahl sein.';
$wb['limit_dns_record_error_notint'] = 'Das DNS Eintrag Limit muss eine Zahl sein.';
$wb['customer_no_txt'] = 'Kundennummer';
$wb['vat_id_txt'] = 'USt-ID';
$wb['vat_id_txt'] = 'USt.-ID';
$wb['required_fields_txt'] = '* Benötigte Felder';
$wb['limit_webdav_user_txt'] = 'Max. Anzahl an WebDAV Benutzern';
$wb['limit_webdav_user_error_notint'] = 'Das WebDAV Benutzer Limit muss eine Zahl sein.';
@@ -160,4 +160,5 @@
$wb['limit_domainmodule_txt'] = 'Domainmodule Limit';
$wb['client_limits_txt'] = 'Client Limits';
$wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than \\"custom\\" is selected.';
$wb['invalid_vat_id'] = 'Die USt.-ID ist ungültig.';
?>
interface/web/client/lib/lang/en_client.lng
@@ -155,21 +155,21 @@
$wb['gender_m_txt'] = 'Mr.';
$wb['gender_f_txt'] = 'Ms.';
$wb["web_servers_txt"] = 'Webservers';
$wb["web_servers_placeholder"] = 'Select Webservers';
$wb["web_servers_placeholder"] = 'Select webservers';
$wb['no_web_server_error'] = 'At least one webserver must be selected.';
$wb['web_servers_used'] = 'The server you are trying to remove from this client is used as a webserver. Be sure that this server is not used by this client before to remove it.';
$wb["dns_servers_txt"] = 'DNS Server';
$wb["dns_servers_placeholder"] = 'Select DNS Servers';
$wb['web_servers_used'] = 'The server you are trying to remove from this client is used as a webserver. Be sure that this server is not used by this client before you remove it.';
$wb["dns_servers_txt"] = 'DNS servers';
$wb["dns_servers_placeholder"] = 'Select DNS servers';
$wb['no_dns_server_error'] = 'At least one DNS server must be selected.';
$wb['dns_servers_used'] = 'The server you are trying to remove from this client is used as a DNS server. Be sure that this server is not used by this client before to remove it.';
$wb["db_servers_txt"] = 'Database Server';
$wb["db_servers_placeholder"] = 'Select Database Servers';
$wb['dns_servers_used'] = 'The server you are trying to remove from this client is used as a DNS server. Be sure that this server is not used by this client before you remove it.';
$wb["db_servers_txt"] = 'Database servers';
$wb["db_servers_placeholder"] = 'Select database servers';
$wb['no_db_server_error'] = 'At least one Database server must be selected.';
$wb['db_servers_used'] = 'The server you are trying to remove from this client is used as a Database server. Be sure that this server is not used by this client before to remove it.';
$wb['db_servers_used'] = 'The server you are trying to remove from this client is used as a Database server. Be sure that this server is not used by this client before you remove it.';
$wb["mail_servers_txt"] = 'Mailservers';
$wb["mail_servers_placeholder"] = 'Select Mailservers';
$wb['no_mail_server_error'] = 'At least one Mailserver must be selected.';
$wb['mail_servers_used'] = 'The server you are trying to remove from this client is used as a Mailserver. Be sure that this server is not used by this client before to remove it.';
$wb["mail_servers_placeholder"] = 'Select mailservers';
$wb['no_mail_server_error'] = 'At least one mailserver must be selected.';
$wb['mail_servers_used'] = 'The server you are trying to remove from this client is used as a Mailserver. Be sure that this server is not used by this client before you remove it.';
$wb['added_by_txt'] = 'Added by';
$wb['added_date_txt'] = 'Added date';
$wb['parent_client_id_txt'] = 'Client of reseller';
@@ -177,4 +177,7 @@
$wb['limit_database_quota_txt'] = 'Database quota';
$wb['limit_database_quota_error_notint'] = 'The database quota limit must be a number.';
$wb['reseller_txt'] = 'Reseller';
$wb['btn_save_txt'] = "Save";
$wb['btn_cancel_txt'] = "Cancel";
$wb['invalid_vat_id'] = 'The VAT ID is invalid.';
?>
interface/web/client/lib/lang/en_reseller.lng
@@ -178,4 +178,5 @@
$wb['limit_domainmodule_txt'] = 'Domainmodule Limit';
$wb['client_limits_txt'] = 'Client Limits';
$wb['err_msg_master_tpl_set'] = 'All custom limit settings are ignored if any master template other than "custom" is selected.';
$wb['invalid_vat_id'] = 'The VAT ID is invalid.';
?>
interface/web/client/templates/client_edit_limits.htm
@@ -326,10 +326,6 @@
    return ($('#template_master').val() == '0' ? true : false);
}
$('.subsectiontoggle').on("click", function(){
    $(this).children().toggleClass('showing').end().next().slideToggle();
});
$('#template_additional_list').find('li > a').click(function(e) {
    e.preventDefault();
    delAdditionalTemplate($(this).parent().attr('rel'));
interface/web/js/scrigo.js.php
@@ -855,13 +855,13 @@
    return Math.floor(Math.random() * (max - min + 1)) + min;
}
jQuery('.addPlaceholder').on("click", function(){
jQuery(document).on("click", ".addPlaceholder", function(){
    var placeholderText = jQuery(this).text();
    var template = jQuery(this).siblings(':input');
    template.insertAtCaret(placeholderText);
});
jQuery('.addPlaceholderContent').on("click", function(){
jQuery(document).on("click", ".addPlaceholderContent", function(){
    var placeholderContentText = jQuery(this).find('.addPlaceholderContent').text();
    var template2 = jQuery(this).siblings(':input');
    template2.insertAtCaret(placeholderContentText);
interface/web/login/password_reset.php
@@ -54,7 +54,7 @@
    $username = $app->db->quote($_POST['username']);
    $email = $app->db->quote($_POST['email']);
    $client = $app->db->queryOneRecord("SELECT client.*, sys_user.lost_password_function FROM client,sys_user WHERE client.username = '$username' AND client.email = '$email' AND client.client_id = sys_user.client_id");
    $client = $app->db->queryOneRecord("SELECT client.*, sys_user.lost_password_function FROM client,sys_user WHERE client.username = ? AND client.email = ? AND client.client_id = sys_user.client_id", $username, $email);
    if($client['lost_password_function'] == 0) {
        $app->tpl->setVar("error", $wb['lost_password_function_disabled_txt']);
interface/web/mail/lib/lang/de_mail_forward.lng
@@ -6,4 +6,5 @@
$wb['duplicate_mailbox_txt'] = 'Es existiert bereits ein E-Mail Konto mit dieser Adresse.';
$wb['domain_txt'] = 'Domain';
$wb['source_txt'] = 'Quell E-Mail Adresse';
$wb['email_error_isemail'] = 'Bitte geben Sie eine gültige E-Mail Adresse an.';
?>
interface/web/mail/lib/lang/en_mail_forward.lng
@@ -6,4 +6,5 @@
$wb["duplicate_mailbox_txt"] = 'There is already a mailbox with this email address';
$wb['domain_txt'] = 'Domain';
$wb["source_txt"] = 'Source Email';
$wb['email_error_isemail'] = 'Please enter a valid email address.';
?>
interface/web/sites/ajax_get_json.php
@@ -190,6 +190,17 @@
    $json .= '"}';
}
if ($type == 'getdirectivesnippet') {
    $server_type = 'apache';
    $web_config = $app->getconf->get_server_config($server_id, 'web');
    if (!empty($web_config['server_type']))
        $server_type = $web_config['server_type'];
    $snippets = $app->db->queryAllRecords("SELECT directive_snippets_id, name FROM directive_snippets WHERE customer_viewable = 'y' AND type = ? ORDER BY name ASC", $server_type);
    $json = json_encode($snippets);
}
//}
header('Content-type: application/json');
interface/web/sites/form/web_vhost_domain.tform.php
@@ -282,7 +282,13 @@
        //#################################
        // ENDE Datatable fields
        //#################################
    )
    ),
    'plugins' => array (
        // needs serverId for web.server_type
        'directive_snippets_id' => array (
            'class' => 'plugin_directive_snippets'
        ),
     )
);
// add type-specific field attributes
@@ -517,6 +523,15 @@
                'default' => '',
                'value'  => array('' => 'none_txt', 'save' => 'save_certificate_txt', 'create' => 'create_certificate_txt', 'del' => 'delete_certificate_txt')
            ),
            'enable_spdy' => array (
                'datatype' => 'VARCHAR',
                'formtype' => 'CHECKBOX',
                'default'  => 'n',
                'value' => array (
                    0 => 'n',
                    1 => 'y'
                )
            ),
            //#################################
            // ENDE Datatable fields
            //#################################
interface/web/sites/lib/lang/de_web_directive_snippets.lng
New file
@@ -0,0 +1,3 @@
<?php
$wb['directive_snippets_id_txt'] = 'Gewünschte Konfiguration';
?>
interface/web/sites/lib/lang/de_web_vhost_domain.lng
@@ -134,4 +134,7 @@
$wb['invalid_custom_php_ini_settings_txt'] = 'Unzulässige php.ini-Einstellungen';
$wb['invalid_system_user_or_group_txt'] = 'Invalid system user or group';
$wb['apache_directive_blocked_error'] = 'Die Apache Direktive wurde durch die Sicherheitsrichtline blockiert:';
$wb['btn_save_txt'] = 'Speichern';
$wb['btn_cancel_txt'] = 'Abbrechen';
$wb['enable_spdy_txt'] = 'Aktiviere SPDY';
?>
interface/web/sites/lib/lang/en_web_directive_snippets.lng
New file
@@ -0,0 +1,3 @@
<?php
$wb['directive_snippets_id_txt'] = 'Desired configuration';
?>
interface/web/sites/lib/lang/en_web_vhost_domain.lng
@@ -137,4 +137,7 @@
$wb['backup_excludes_note_txt'] = '(Separate multiple directories with commas. Example: web/cache/*,web/backup)';
$wb['backup_excludes_error_regex'] = 'The excluded directories contain invalid characters.';
$wb['subdomain_error_empty'] = 'The subdommain field is empty or contains invalid characters.';
$wb['btn_save_txt'] = "Save";
$wb['btn_cancel_txt'] = "Cancel";
$wb['enable_spdy_txt'] = 'Enable SPDY';
?>
interface/web/sites/templates/web_directive_snippets.htm
New file
@@ -0,0 +1,14 @@
<div class="ctrlHolder">
    <label for="directive_snippets_id">
        {tmpl_var name='directive_snippets_id_txt'}
    </label>
    <select name="directive_snippets_id" id="directive_snippets_id" class="selectInput formLengthHalf">
        <option value="0"></option>
        <tmpl_loop name="records">
        <option {tmpl_if name='is_selected' op='==' value='true'}selected="selected" {/tmpl_if}value="{tmpl_var name='directive_snippets_id'}">
            {tmpl_var name='name'}
        </option>
        </tmpl_loop>
    </select>
</div>
interface/web/sites/templates/web_vhost_domain_advanced.htm
@@ -176,4 +176,4 @@
        });
    }
            
</script>
</script>
interface/web/sites/templates/web_vhost_domain_edit.htm
@@ -219,6 +219,7 @@
                    {tmpl_var name='fastcgi_php_version'}
                </select>
            </div>
            {tmpl_var name="directive_snippets_id"}
            <div class="ctrlHolder">
                <p class="label">{tmpl_var name='active_txt'}</p>
                <div class="multiField">
@@ -249,6 +250,7 @@
            adjustForm();
            reloadWebIP();
            reloadFastcgiPHPVersions();
            reloadDirectiveSnippets();
        });
    }
    adjustForm(true);
@@ -316,6 +318,23 @@
            }
        });
    }
    function reloadDirectiveSnippets() {
        jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {server_id : serverId, type : "getdirectivesnippet"}, function(data) {
            var options = '<option value="0"></option>';
            for (var i = 0, len = data.length; i < len; i++) {
                var isSelected = '';
                 if ($('#directive_snippets_id').val() == i + 1) {
                     isSelected = 'selected="selected"';
                 }
                 options += '<option ' + isSelected + ' value="' + data[i]['directive_snippets_id'] + '">' + data[i]['name'] + '</option>';
            }
            $('#directive_snippets_id').html(options).change();
        });
    }
        
    function reloadWebIP() {
        loadOptionInto('ip_address','sites/ajax_get_ip.php?ip_type=IPv4&server_id='+serverId+'&client_group_id='+clientGroupId);
@@ -340,9 +359,9 @@
    }
    
    <tmpl_if name="readonly_tab">
        jQuery('div.panel_web_domain').find('fieldset').find('input,select,button').bind('click mousedown', function(e) { e.preventDefault(); }).focus(function() { $(this).blur(); });
        jQuery('div.panel_web_domain').find('fieldset').find('input,select,button').not('#directive_snippets_id').bind('click mousedown', function(e) { e.preventDefault(); }).focus(function() { $(this).blur(); });
        jQuery('#dom-edit-submit').click(function() {
               submitForm('pageForm','sites/web_vhost_domain_edit.php');
            submitForm('pageForm','sites/web_vhost_domain_edit.php');
        });
    <tmpl_else>
        jQuery('#dom-edit-submit').click(function() {
interface/web/sites/templates/web_vhost_domain_ssl.htm
@@ -64,6 +64,14 @@
                    {tmpl_var name='ssl_action'}
                </select>
            </div>
            {tmpl_if name="is_spdy_enabled"}
            <div class="ctrlHolder">
                <p class="label">{tmpl_var name='enable_spdy_txt'}</p>
                <div class="multiField">
                    {tmpl_var name="enable_spdy"}
                </div>
            </div>
            {/tmpl_if}
        </fieldset>
        <input type="hidden" name="id" value="{tmpl_var name='id'}">
@@ -74,4 +82,4 @@
        </div>
    </div>
</div>
</div>
interface/web/sites/web_vhost_domain_edit.php
@@ -121,6 +121,10 @@
            $server_id = intval($settings['default_webserver']);
            $app->tform->formDef['tabs']['domain']['fields']['server_id']['default'] = $server_id;
        }
        if(!$server_id){
            $default_web_server = $app->db->queryOneRecord("SELECT server_id FROM server WHERE web_server = ? ORDER BY server_id LIMIT 0,1", 1);
            $server_id = $default_web_server['server_id'];
        }
        $web_config = $app->getconf->get_server_config($server_id, 'web');
        $app->tform->formDef['tabs']['domain']['fields']['php']['default'] = $web_config['php_handler'];
        $app->tform->formDef['tabs']['domain']['readonly'] = false;
@@ -187,7 +191,7 @@
            if($app->functions->intval($this->dataRecord["server_id"]) > 0) {
                // check if server is in client's servers or add it.
                $chk_sid = explode(',', $client['web_servers']);
                if(in_array($this->dataRecord["server_id"], $client['web_servers']) == false) {
                if(in_array($this->dataRecord["server_id"], explode(',', $client['web_servers'])) == false) {
                    if($client['web_servers'] != '') $client['web_servers'] .= ',';
                    $client['web_servers'] .= $app->functions->intval($this->dataRecord["server_id"]);
                }
@@ -695,6 +699,8 @@
        
        $app->tpl->setVar('vhostdomain_type', $this->_vhostdomain_type);
        $app->tpl->setVar('is_spdy_enabled', ($web_config['enable_spdy'] === 'y'));
        parent::onShowEnd();
    }
@@ -1064,6 +1070,10 @@
            }
        }
        if($web_config['enable_spdy'] === 'n') {
            unset($app->tform->formDef["tabs"]['ssl']['fields']['enable_spdy']);
        }
        parent::onSubmit();
    }
interface/web/themes/default/templates/main.tpl.htm
@@ -1,6 +1,5 @@
<!DOCTYPE html>
<html lang='en'>
<head>
  <meta charset='utf-8' />
server/conf/apache_apps.vhost.master
@@ -10,11 +10,17 @@
<VirtualHost {tmpl_var name='apps_vhost_ip'}:{tmpl_var name='apps_vhost_port'}>
  ServerAdmin webmaster@localhost
  {tmpl_var name='apps_vhost_servername'}
  <FilesMatch "\.ph(p3?|tml)$">
    SetHandler None
  </FilesMatch>
  {tmpl_if name="enable_spdy" op="==" value="y"}
  <IfModule spdy_module>
    SpdyEnabled on
  </IfModule>
  {/tmpl_if}
  <IfModule mod_php5.c>
    DocumentRoot {tmpl_var name='apps_vhost_dir'}
    AddType application/x-httpd-php .php
server/conf/nginx_vhost.conf.master
@@ -5,10 +5,10 @@
</tmpl_if>
        
<tmpl_if name='ssl_enabled'>
        listen <tmpl_var name='ip_address'>:443 ssl;
        listen <tmpl_var name='ip_address'>:443 ssl{tmpl_if name='enable_spdy' op='==' value='y'} spdy{/tmpl_if};
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
<tmpl_if name='ipv6_enabled'>
        listen [<tmpl_var name='ipv6_address'>]:443 ssl;
        listen [<tmpl_var name='ipv6_address'>]:443 ssl{tmpl_if name='enable_spdy' op='==' value='y'} spdy{/tmpl_if};;
</tmpl_if>
        ssl_certificate <tmpl_var name='document_root'>/ssl/<tmpl_var name='ssl_domain'>.crt;
        ssl_certificate_key <tmpl_var name='document_root'>/ssl/<tmpl_var name='ssl_domain'>.key;
@@ -242,4 +242,4 @@
        }
</tmpl_if>
}
</tmpl_loop>
</tmpl_loop>
server/conf/php-cgi-starter.master
@@ -4,6 +4,10 @@
export PHPRC="<tmpl_var name='php_ini_path'>"
</tmpl_if>
export TMP=<tmpl_var name='document_root'>/tmp
export TMPDIR=<tmpl_var name='document_root'>/tmp
export TEMP=<tmpl_var name='document_root'>/tmp
exec <tmpl_var name='php_cgi_bin'> \
-d open_basedir=<tmpl_var name='open_basedir'> \
-d upload_tmp_dir=<tmpl_var name='document_root'>/tmp \
server/conf/php-fcgi-starter.master
@@ -9,6 +9,9 @@
# export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=<tmpl_var name='php_fcgi_max_requests'>
export PHP_FCGI_MAX_REQUESTS
export TMP=<tmpl_var name='document_root'>/tmp
export TMPDIR=<tmpl_var name='document_root'>/tmp
export TEMP=<tmpl_var name='document_root'>/tmp
exec <tmpl_var name='php_fcgi_bin'> \
<tmpl_if name="security_level" op="==" value="20"> -d open_basedir="<tmpl_var name='open_basedir'>" \
-d disable_functions="" \
server/conf/php_fpm_pool.conf.master
@@ -28,6 +28,10 @@
chdir = /
env[TMP] = <tmpl_var name='document_root'>/tmp
env[TMPDIR] = <tmpl_var name='document_root'>/tmp
env[TEMP] = <tmpl_var name='document_root'>/tmp
<tmpl_if name='security_level' op='==' value='20'>
<tmpl_var name='enable_php_open_basedir'>php_admin_value[open_basedir] = <tmpl_var name='php_open_basedir'>
php_admin_value[session.save_path] = <tmpl_var name='document_root'>/tmp
server/conf/vhost.conf.master
@@ -204,6 +204,9 @@
<tmpl_if name='php' op='==' value='mod'>
        # mod_php enabled
        AddType application/x-httpd-php .php .php3 .php4 .php5
        SetEnv TMP <tmpl_var name='document_root'>/tmp
        SetEnv TMPDIR <tmpl_var name='document_root'>/tmp
        SetEnv TEMP <tmpl_var name='document_root'>/tmp
        php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -fwebmaster@<tmpl_var name='domain'>"
        php_admin_value upload_tmp_dir <tmpl_var name='document_root'>/tmp
        php_admin_value session.save_path <tmpl_var name='document_root'>/tmp
server/lib/classes/db_mysql.inc.php
@@ -86,7 +86,7 @@
            $this->_sqlerror('Zugriff auf Datenbankserver fehlgeschlagen! / Database server not accessible!');
            return false;
        }
        if(!((bool)mysqli_query( $this->_iConnId, "USE $this->dbName"))) {
        if(!((bool)mysqli_query( $this->_iConnId, 'USE `' . $this->dbName . '`'))) {
            $this->close();
            $this->_sqlerror('Datenbank nicht gefunden / Database not found');
            return false;
@@ -176,7 +176,7 @@
    private function _query($sQuery = '') {
        global $app;
        if($this->isConnected == false) return false;
        //if($this->isConnected == false) return false;
        if ($sQuery == '') {
            $this->_sqlerror('Keine Anfrage angegeben / No query given');
            return false;
server/plugins-available/apache2_plugin.inc.php
@@ -1030,6 +1030,12 @@
        $vhost_data['custom_php_ini_dir'] = escapeshellcmd($custom_php_ini_dir);
        // Custom Apache directives
        if(intval($data['new']['directive_snippets_id']) > 0){
            $snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'apache' AND active = 'y' AND customer_viewable = 'y'", intval($data['new']['directive_snippets_id']));
            if(isset($snippet['snippet'])){
                $vhost_data['apache_directives'] = $snippet['snippet'];
            }
        }
        // Make sure we only have Unix linebreaks
        $vhost_data['apache_directives'] = str_replace("\r\n", "\n", $vhost_data['apache_directives']);
        $vhost_data['apache_directives'] = str_replace("\r", "\n", $vhost_data['apache_directives']);
server/plugins-available/nginx_plugin.inc.php
@@ -1089,7 +1089,16 @@
        // Custom nginx directives
        $final_nginx_directives = array();
        $nginx_directives = $data['new']['nginx_directives'];
        if(intval($data['new']['directive_snippets_id']) > 0){
            $snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'nginx' AND active = 'y' AND customer_viewable = 'y'", intval($data['new']['directive_snippets_id']));
            if(isset($snippet['snippet'])){
                $nginx_directives = $snippet['snippet'];
            } else {
                $nginx_directives = $data['new']['nginx_directives'];
            }
        } else {
            $nginx_directives = $data['new']['nginx_directives'];
        }
        // Make sure we only have Unix linebreaks
        $nginx_directives = str_replace("\r\n", "\n", $nginx_directives);
        $nginx_directives = str_replace("\r", "\n", $nginx_directives);