ftimme
2012-11-07 11ec799aa4839a0a82fa2d51b303ff70d980d321
- Added Proxy Directives field for nginx if you select redirect type "proxy".
- Added PayPal email address field to client and reseller form.
- Added missing bank details fields to reseller form.
3 files added
31 files modified
535 ■■■■■ changed files
install/sql/incremental/upd_0044.sql 4 ●●●● patch | view | raw | blame | history
install/sql/ispconfig3.sql 2 ●●●●● patch | view | raw | blame | history
interface/web/admin/form/directive_snippets.tform.php 2 ●●● patch | view | raw | blame | history
interface/web/admin/list/directive_snippets.list.php 2 ●●● patch | view | raw | blame | history
interface/web/client/form/client.tform.php 23 ●●●●● patch | view | raw | blame | history
interface/web/client/form/reseller.tform.php 100 ●●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/de_client.lng 4 ●●● patch | view | raw | blame | history
interface/web/client/lib/lang/de_reseller.lng 9 ●●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/en_client.lng 2 ●●●●● patch | view | raw | blame | history
interface/web/client/lib/lang/en_reseller.lng 9 ●●●●● patch | view | raw | blame | history
interface/web/client/templates/client_edit_address.htm 4 ●●●● patch | view | raw | blame | history
interface/web/client/templates/reseller_edit_address.htm 32 ●●●●● patch | view | raw | blame | history
interface/web/sites/ajax_get_json.php 9 ●●●●● patch | view | raw | blame | history
interface/web/sites/form/web_aliasdomain.tform.php 27 ●●●●● patch | view | raw | blame | history
interface/web/sites/form/web_domain.tform.php 10 ●●●●● patch | view | raw | blame | history
interface/web/sites/form/web_subdomain.tform.php 27 ●●●●● patch | view | raw | blame | history
interface/web/sites/form/web_vhost_subdomain.tform.php 12 ●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/de_web_domain.lng 2 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/de_web_subdomain.lng 2 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/de_web_vhost_subdomain.lng 5 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_web_domain.lng 2 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_web_subdomain.lng 2 ●●●●● patch | view | raw | blame | history
interface/web/sites/lib/lang/en_web_vhost_subdomain.lng 5 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_aliasdomain_advanced.htm 37 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_domain_advanced.htm 11 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_subdomain_advanced.htm 37 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_vhost_subdomain_advanced.htm 17 ●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_vhost_subdomain_redirect.htm 4 ●●● patch | view | raw | blame | history
interface/web/sites/web_aliasdomain_edit.php 13 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_domain_edit.php 10 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_subdomain_edit.php 13 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_vhost_subdomain_edit.php 45 ●●●●● patch | view | raw | blame | history
server/conf/nginx_vhost.conf.master 10 ●●●● patch | view | raw | blame | history
server/plugins-available/nginx_plugin.inc.php 42 ●●●●● patch | view | raw | blame | history
install/sql/incremental/upd_0044.sql
New file
@@ -0,0 +1,4 @@
ALTER TABLE `client` ADD `paypal_email` VARCHAR( 255 ) NULL DEFAULT NULL AFTER `bank_account_swift` ;
ALTER TABLE `web_domain` ADD `proxy_directives` MEDIUMTEXT NULL DEFAULT NULL ;
install/sql/ispconfig3.sql
@@ -166,6 +166,7 @@
  `bank_name` varchar(255) DEFAULT NULL,
  `bank_account_iban` varchar(255) DEFAULT NULL,
  `bank_account_swift` varchar(255) DEFAULT NULL,
  `paypal_email` varchar(255) DEFAULT NULL,
  `default_mailserver` int(11) unsigned NOT NULL DEFAULT '1',
  `limit_maildomain` int(11) NOT NULL DEFAULT '-1',
  `limit_mailbox` int(11) NOT NULL DEFAULT '-1',
@@ -1750,6 +1751,7 @@
  `active` enum('n','y') NOT NULL default 'y',
  `traffic_quota_lock` enum('n','y') NOT NULL default 'n',
  `fastcgi_php_version` varchar(255) DEFAULT NULL,
  `proxy_directives` mediumtext,
  PRIMARY KEY  (`domain_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
interface/web/admin/form/directive_snippets.tform.php
@@ -81,7 +81,7 @@
            'datatype'    => 'VARCHAR',
            'formtype'    => 'SELECT',
            'default'    => '',
            'value'        => array('apache' => 'Apache','nginx' => 'nginx','php' => 'PHP'),
            'value'        => array('apache' => 'Apache','nginx' => 'nginx','php' => 'PHP','proxy' => 'Proxy'),
            'searchable' => 2
        ),
        'snippet' => array (
interface/web/admin/list/directive_snippets.list.php
@@ -73,6 +73,6 @@
                            'prefix'    => "",
                            'suffix'    => "",
                            'width'        => "",
                            'value'        => array('apache' => 'Apache', 'nginx' => 'nginx', 'php' => 'PHP'));
                            'value'        => array('apache' => 'Apache', 'nginx' => 'nginx', 'php' => 'PHP', 'proxy' => 'Proxy'));
?>
interface/web/client/form/client.tform.php
@@ -431,6 +431,29 @@
            'rows'        => '10',
            'cols'        => '30'
        ),
        'paypal_email' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'filters'   => array( 0 => array( 'event' => 'SAVE',
                                              'type' => 'IDNTOASCII'),
                                  1 => array( 'event' => 'SHOW',
                                              'type' => 'IDNTOUTF8'),
                                  2 => array( 'event' => 'SAVE',
                                              'type' => 'TOLOWER')
                                ),
            'validators'    => array (     0 => array (    'type'    => 'REGEX',
                                                        'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}$/i',
                                                        'errmsg'=> 'paypal_email_error_isemail'),
                                    ),
            'default'    => '',
            'value'        => '',
            'separator'    => '',
            'width'        => '30',
            'maxlength'    => '255',
            'rows'        => '',
            'cols'        => '',
            'searchable' => 2
        ),
    ##################################
    # END Datatable fields
    ##################################
interface/web/client/form/reseller.tform.php
@@ -340,6 +340,83 @@
            'rows'        => '',
            'cols'        => ''
        ),
        'company_id' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'separator'    => '',
            'width'        => '30',
            'maxlength'    => '20',
            'rows'        => '',
            'cols'        => ''
        ),
        'bank_account_owner' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'separator'    => '',
            'width'        => '30',
            'maxlength'    => '255',
            'rows'        => '',
            'cols'        => ''
        ),
        'bank_account_number' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'separator'    => '',
            'width'        => '30',
            'maxlength'    => '255',
            'rows'        => '',
            'cols'        => ''
        ),
        'bank_code' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'separator'    => '',
            'width'        => '30',
            'maxlength'    => '255',
            'rows'        => '',
            'cols'        => ''
        ),
        'bank_name' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'separator'    => '',
            'width'        => '30',
            'maxlength'    => '255',
            'rows'        => '',
            'cols'        => ''
        ),
        'bank_account_iban' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'separator'    => '',
            'width'        => '30',
            'maxlength'    => '255',
            'rows'        => '',
            'cols'        => ''
        ),
        'bank_account_swift' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'separator'    => '',
            'width'        => '30',
            'maxlength'    => '255',
            'rows'        => '',
            'cols'        => ''
        ),
        'notes' => array (
            'datatype'    => 'TEXT',
            'formtype'    => 'TEXTAREA',
@@ -351,6 +428,29 @@
            'rows'        => '10',
            'cols'        => '30'
        ),
        'paypal_email' => array (
            'datatype'    => 'VARCHAR',
            'formtype'    => 'TEXT',
            'filters'   => array( 0 => array( 'event' => 'SAVE',
                                              'type' => 'IDNTOASCII'),
                                  1 => array( 'event' => 'SHOW',
                                              'type' => 'IDNTOUTF8'),
                                  2 => array( 'event' => 'SAVE',
                                              'type' => 'TOLOWER')
                                ),
            'validators'    => array (     0 => array (    'type'    => 'REGEX',
                                                        'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}$/i',
                                                        'errmsg'=> 'paypal_email_error_isemail'),
                                    ),
            'default'    => '',
            'value'        => '',
            'separator'    => '',
            'width'        => '30',
            'maxlength'    => '255',
            'rows'        => '',
            'cols'        => '',
            'searchable' => 2
        ),
    ##################################
    # END Datatable fields
    ##################################
interface/web/client/lib/lang/de_client.lng
@@ -136,5 +136,7 @@
$wb['password_mismatch_txt'] = 'Die Passwörter stimmen nicht Ã¼berein.';
$wb['password_match_txt'] = 'Die Passwörter stimmen Ã¼berein.';
$wb['customer_no_error_unique'] = 'Die Kundennummer muß einzigartig sein (oder leer).';
$wb['email_error_isemail'] = 'Please enter a valid email address.';
$wb['email_error_isemail'] = 'Bitte geben Sie eine gültige Email-Adresse an.';
$wb['paypal_email_error_isemail'] = 'Bitte geben Sie eine gültige PayPal-E-Mail-Adresse an.';
$wb['paypal_email_txt'] = 'PayPal-E-Mail';
?>
interface/web/client/lib/lang/de_reseller.lng
@@ -130,4 +130,13 @@
$wb['password_match_txt'] = 'Die Passwörter stimmen Ã¼berein.';
$wb['customer_no_error_unique'] = 'Die Kundennummer muß einzigartig sein (oder leer).';
$wb['email_error_isemail'] = 'Please enter a valid email address.';
$wb['paypal_email_error_isemail'] = 'Bitte geben Sie eine gültige PayPal-E-Mail-Adresse an.';
$wb['paypal_email_txt'] = 'PayPal-E-Mail';
$wb['company_id_txt'] = 'Firmen/Entrepreneur ID';
$wb['bank_account_number_txt'] = 'Kontonummer';
$wb['bank_account_owner_txt'] = 'Kontoinhaber';
$wb['bank_code_txt'] = 'BLZ';
$wb['bank_name_txt'] = 'Bank';
$wb['bank_account_iban_txt'] = 'IBAN';
$wb['bank_account_swift_txt'] = 'BIC';
?>
interface/web/client/lib/lang/en_client.lng
@@ -140,4 +140,6 @@
$wb['password_match_txt'] = 'The passwords do match.';
$wb['email_error_isemail'] = 'Please enter a valid email address.';
$wb["customer_no_error_unique"] = 'The customer no. must be unique (or empty).';
$wb['paypal_email_error_isemail'] = 'Please enter a valid PayPal email address.';
$wb['paypal_email_txt'] = 'PayPal Email';
?>
interface/web/client/lib/lang/en_reseller.lng
@@ -132,4 +132,13 @@
$wb['password_match_txt'] = 'The passwords do match.';
$wb['email_error_isemail'] = 'Please enter a valid email address.';
$wb["customer_no_error_unique"] = 'The customer no. must be unique (or empty).';
$wb['paypal_email_error_isemail'] = 'Please enter a valid PayPal email address.';
$wb['paypal_email_txt'] = 'PayPal Email';
$wb['company_id_txt'] = 'Company/Entrepreneur ID';
$wb["bank_account_number_txt"] = 'Bank account no.';
$wb["bank_account_owner_txt"] = 'Bank account owner';
$wb["bank_code_txt"] = 'Bank code';
$wb["bank_name_txt"] = 'Bank name';
$wb["bank_account_iban_txt"] = 'IBAN';
$wb["bank_account_swift_txt"] = 'BIC / Swift';
?>
interface/web/client/templates/client_edit_address.htm
@@ -126,6 +126,10 @@
                <label for="bank_account_swift">{tmpl_var name='bank_account_swift_txt'}</label>
                <input name="bank_account_swift" id="bank_account_swift" value="{tmpl_var name='bank_account_swift'}" size="30" maxlength="255" type="text" class="textInput" />
            </div>
            <div class="ctrlHolder">
                <label for="paypal_email">{tmpl_var name='paypal_email_txt'}</label>
                <input name="paypal_email" id="paypal_email" value="{tmpl_var name='paypal_email'}" size="30" maxlength="255" type="text" class="textInput" />
            </div>
            <div class="ctrlHolder">
                <label for="notes">{tmpl_var name='notes_txt'}</label>
                <textarea name="notes" id="notes" rows='10' cols='30'>{tmpl_var name='notes'}</textarea>
interface/web/client/templates/reseller_edit_address.htm
@@ -98,6 +98,38 @@
                <label for="vat_id">{tmpl_var name='vat_id_txt'}</label>
                <input name="vat_id" id="vat_id" value="{tmpl_var name='vat_id'}" size="30" maxlength="255" type="text" class="textInput" />
            </div>
            <div class="ctrlHolder">
                <label for="company_id">{tmpl_var name='company_id_txt'}</label>
                <input name="company_id" id="company_id" value="{tmpl_var name='company_id'}" size="30" maxlength="255" type="text" class="textInput" />
            </div>
            <div class="ctrlHolder">
                <label for="bank_account_owner">{tmpl_var name='bank_account_owner_txt'}</label>
                <input name="bank_account_owner" id="bank_account_owner" value="{tmpl_var name='bank_account_owner'}" size="30" maxlength="255" type="text" class="textInput" />
            </div>
            <div class="ctrlHolder">
                <label for="bank_account_number">{tmpl_var name='bank_account_number_txt'}</label>
                <input name="bank_account_number" id="bank_account_number" value="{tmpl_var name='bank_account_number'}" size="30" maxlength="255" type="text" class="textInput" />
            </div>
            <div class="ctrlHolder">
                <label for="bank_code">{tmpl_var name='bank_code_txt'}</label>
                <input name="bank_code" id="bank_code" value="{tmpl_var name='bank_code'}" size="30" maxlength="255" type="text" class="textInput" />
            </div>
            <div class="ctrlHolder">
                <label for="bank_name">{tmpl_var name='bank_name_txt'}</label>
                <input name="bank_name" id="bank_name" value="{tmpl_var name='bank_name'}" size="30" maxlength="255" type="text" class="textInput" />
            </div>
            <div class="ctrlHolder">
                <label for="bank_account_iban">{tmpl_var name='bank_account_iban_txt'}</label>
                <input name="bank_account_iban" id="bank_account_iban" value="{tmpl_var name='bank_account_iban'}" size="30" maxlength="255" type="text" class="textInput" />
            </div>
            <div class="ctrlHolder">
                <label for="bank_account_swift">{tmpl_var name='bank_account_swift_txt'}</label>
                <input name="bank_account_swift" id="bank_account_swift" value="{tmpl_var name='bank_account_swift'}" size="30" maxlength="255" type="text" class="textInput" />
            </div>
            <div class="ctrlHolder">
                <label for="paypal_email">{tmpl_var name='paypal_email_txt'}</label>
                <input name="paypal_email" id="paypal_email" value="{tmpl_var name='paypal_email'}" size="30" maxlength="255" type="text" class="textInput" />
            </div>
            <div class="ctrlHolder">
                <label for="notes">{tmpl_var name='notes_txt'}</label>
                <textarea name="notes" id="notes" rows='10' cols='30'>{tmpl_var name='notes'}</textarea>
interface/web/sites/ajax_get_json.php
@@ -100,6 +100,15 @@
        $json .= '"}';
    }
    
    if($type == 'getredirecttype'){
        $json = '{"redirecttype":"';
        $sql = "SELECT redirect_type FROM web_domain WHERE domain_id = $web_id";
        $redirect = $app->db->queryOneRecord($sql);
        $json .= $redirect['redirect_type'];
        unset($redirect);
        $json .= '"}';
    }
    if($type == 'get_ipv4'){        
        $result = array();
        
interface/web/sites/form/web_aliasdomain.tform.php
@@ -153,5 +153,32 @@
    )
);
if($_SESSION["s"]["user"]["typ"] == 'admin') {
$form["tabs"]['advanced'] = array (
    'title'     => "Options",
    'width'     => 100,
    'template'     => "templates/web_aliasdomain_advanced.htm",
    'readonly'    => false,
    'fields'     => array (
    ##################################
    # Begin Datatable fields
    ##################################
        'proxy_directives' => array (
            'datatype'    => 'TEXT',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
    )
);
}
?>
interface/web/sites/form/web_domain.tform.php
@@ -697,7 +697,15 @@
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        )
        ),
        'proxy_directives' => array (
            'datatype'    => 'TEXT',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
interface/web/sites/form/web_subdomain.tform.php
@@ -143,5 +143,32 @@
    )
);
if($_SESSION["s"]["user"]["typ"] == 'admin') {
$form["tabs"]['advanced'] = array (
    'title'     => "Options",
    'width'     => 100,
    'template'     => "templates/web_subdomain_advanced.htm",
    'readonly'    => false,
    'fields'     => array (
    ##################################
    # Begin Datatable fields
    ##################################
        'proxy_directives' => array (
            'datatype'    => 'TEXT',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
    )
);
}
?>
interface/web/sites/form/web_vhost_subdomain.tform.php
@@ -291,7 +291,7 @@
            'datatype'    => 'VARCHAR',
            'formtype'    => 'SELECT',
            'default'    => '',
            'value'        => array('' => 'no_redirect_txt', 'no' => 'no_flag_txt', 'R' => 'R', 'L' => 'L', 'R,L' => 'R,L', 'R=301,L' => 'R=301,L', 'last' => 'last', 'break' => 'break', 'redirect' => 'redirect', 'permanent' => 'permanent')
            'value'        => array('' => 'no_redirect_txt', 'no' => 'no_flag_txt', 'R' => 'R', 'L' => 'L', 'R,L' => 'R,L', 'R=301,L' => 'R=301,L', 'last' => 'last', 'break' => 'break', 'redirect' => 'redirect', 'permanent' => 'permanent', 'proxy' => 'proxy')
        ),
        'redirect_path' => array (
            'datatype'    => 'VARCHAR',
@@ -696,7 +696,15 @@
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        )
        ),
        'proxy_directives' => array (
            'datatype'    => 'TEXT',
            'formtype'    => 'TEXT',
            'default'    => '',
            'value'        => '',
            'width'        => '30',
            'maxlength'    => '255'
        ),
    ##################################
    # ENDE Datatable fields
    ##################################
interface/web/sites/lib/lang/de_web_domain.lng
@@ -109,4 +109,6 @@
$wb['available_php_directive_snippets_txt'] = 'Verfügbare PHP Direktiven Schnipsel:';
$wb['available_apache_directive_snippets_txt'] = 'Verfügbare Apache Direktiven Schnipsel:';
$wb['available_nginx_directive_snippets_txt'] = 'Verfügbare nginx Direktiven Schnipsel:';
$wb['proxy_directives_txt'] = 'Proxy Direktiven';
$wb['available_proxy_directive_snippets_txt'] = 'Verfügbare Proxy Direktiven Schnipsel:';
?>
interface/web/sites/lib/lang/de_web_subdomain.lng
@@ -40,4 +40,6 @@
$wb['redirect_error_regex'] = 'Ungültiger redirect Pfad. Gültige Pfade sind beispielsweise: /test/ oder http://www.domain.tld/test/';
$wb['no_redirect_txt'] = 'Kein Redirect';
$wb['no_flag_txt'] = 'Kein Flag';
$wb['proxy_directives_txt'] = 'Proxy Direktiven';
$wb['available_proxy_directive_snippets_txt'] = 'Verfügbare Proxy Direktiven Schnipsel:';
?>
interface/web/sites/lib/lang/de_web_vhost_subdomain.lng
@@ -110,4 +110,9 @@
$wb['repeat_password_txt'] = 'Passwort wiederholen';
$wb['password_mismatch_txt'] = 'Die Passwörter stimmen nicht Ã¼berein.';
$wb['password_match_txt'] = 'Die Passwörter stimmen Ã¼berein.';
$wb['available_php_directive_snippets_txt'] = 'Verfügbare PHP Direktiven Schnipsel:';
$wb['available_apache_directive_snippets_txt'] = 'Verfügbare Apache Direktiven Schnipsel:';
$wb['available_nginx_directive_snippets_txt'] = 'Verfügbare nginx Direktiven Schnipsel:';
$wb['proxy_directives_txt'] = 'Proxy Direktiven';
$wb['available_proxy_directive_snippets_txt'] = 'Verfügbare Proxy Direktiven Schnipsel:';
?>
interface/web/sites/lib/lang/en_web_domain.lng
@@ -109,4 +109,6 @@
$wb['available_php_directive_snippets_txt'] = 'Available PHP Directive Snippets:';
$wb['available_apache_directive_snippets_txt'] = 'Available Apache Directive Snippets:';
$wb['available_nginx_directive_snippets_txt'] = 'Available nginx Directive Snippets:';
$wb['proxy_directives_txt'] = 'Proxy Directives';
$wb['available_proxy_directive_snippets_txt'] = 'Available Proxy Directive Snippets:';
?>
interface/web/sites/lib/lang/en_web_subdomain.lng
@@ -40,4 +40,6 @@
$wb["redirect_error_regex"] = 'Invalid redirect path. Valid redirects are for example: /test/ or http://www.domain.tld/test/';
$wb['no_redirect_txt'] = 'No redirect';
$wb['no_flag_txt'] = 'No flag';
$wb['proxy_directives_txt'] = 'Proxy Directives';
$wb['available_proxy_directive_snippets_txt'] = 'Available Proxy Directive Snippets:';
?>
interface/web/sites/lib/lang/en_web_vhost_subdomain.lng
@@ -111,4 +111,9 @@
$wb['repeat_password_txt'] = 'Repeat Password';
$wb['password_mismatch_txt'] = 'The passwords do not match.';
$wb['password_match_txt'] = 'The passwords do match.';
$wb['available_php_directive_snippets_txt'] = 'Available PHP Directive Snippets:';
$wb['available_apache_directive_snippets_txt'] = 'Available Apache Directive Snippets:';
$wb['available_nginx_directive_snippets_txt'] = 'Available nginx Directive Snippets:';
$wb['proxy_directives_txt'] = 'Proxy Directives';
$wb['available_proxy_directive_snippets_txt'] = 'Available Proxy Directive Snippets:';
?>
interface/web/sites/templates/web_aliasdomain_advanced.htm
New file
@@ -0,0 +1,37 @@
<h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p>
<div class="panel panel_web_domain">
  <div class="pnl_formsarea">
    <fieldset class="inlineLabels"><legend>Options</legend>
      <div class="ctrlHolder proxy">
                <label for="proxy_directives">{tmpl_var name='proxy_directives_txt'}</label>
                <textarea name="proxy_directives" id="proxy_directives" rows='10' cols='50' style="width:400px;">{tmpl_var name='proxy_directives'}</textarea>&nbsp;<b>{tmpl_var name="available_proxy_directive_snippets_txt"}</b><br><br>&nbsp;{tmpl_var name="proxy_directive_snippets_txt"}
            </div>
    </fieldset>
    <input type="hidden" name="id" value="{tmpl_var name='id'}">
    <div class="buttonHolder buttons">
      <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onclick="submitForm('pageForm','sites/web_aliasdomain_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('sites/web_aliasdomain_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
    </div>
  </div>
</div>
<script language="JavaScript" type="text/javascript">
    var webId = jQuery('input[name="id"]').val();
    adjustForm();
    function adjustForm(){
        jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {web_id : webId, type : "getredirecttype"}, function(data) {
            if(data.redirecttype == "proxy"){
                jQuery('.proxy').show();
            } else {
                jQuery('.proxy').hide();
            }
        });
    }
</script>
interface/web/sites/templates/web_domain_advanced.htm
@@ -77,6 +77,10 @@
                <label for="nginx_directives">{tmpl_var name='nginx_directives_txt'}</label>
                <textarea name="nginx_directives" id="nginx_directives" rows='10' cols='50' style="width:400px;">{tmpl_var name='nginx_directives'}</textarea>&nbsp;<b>{tmpl_var name="available_nginx_directive_snippets_txt"}</b><br><br>&nbsp;{tmpl_var name="nginx_directive_snippets_txt"}
            </div>
            <div class="ctrlHolder proxy">
                <label for="proxy_directives">{tmpl_var name='proxy_directives_txt'}</label>
                <textarea name="proxy_directives" id="proxy_directives" rows='10' cols='50' style="width:400px;">{tmpl_var name='proxy_directives'}</textarea>&nbsp;<b>{tmpl_var name="available_proxy_directive_snippets_txt"}</b><br><br>&nbsp;{tmpl_var name="proxy_directive_snippets_txt"}
            </div>
        </fieldset>
        <input type="hidden" name="id" value="{tmpl_var name='id'}">
@@ -141,6 +145,13 @@
                jQuery('.phpfpm').hide();
            }
        });
        jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {web_id : webId, type : "getredirecttype"}, function(data) {
            if(data.redirecttype == "proxy"){
                jQuery('.proxy').show();
            } else {
                jQuery('.proxy').hide();
            }
        });
    }
            
</script>
interface/web/sites/templates/web_subdomain_advanced.htm
New file
@@ -0,0 +1,37 @@
<h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p>
<div class="panel panel_web_subdomain">
  <div class="pnl_formsarea">
    <fieldset class="inlineLabels"><legend>Options</legend>
      <div class="ctrlHolder proxy">
                <label for="proxy_directives">{tmpl_var name='proxy_directives_txt'}</label>
                <textarea name="proxy_directives" id="proxy_directives" rows='10' cols='50' style="width:400px;">{tmpl_var name='proxy_directives'}</textarea>&nbsp;<b>{tmpl_var name="available_proxy_directive_snippets_txt"}</b><br><br>&nbsp;{tmpl_var name="proxy_directive_snippets_txt"}
            </div>
    </fieldset>
    <input type="hidden" name="id" value="{tmpl_var name='id'}">
    <div class="buttonHolder buttons">
      <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onclick="submitForm('pageForm','sites/web_subdomain_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('sites/web_subdomain_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
    </div>
  </div>
</div>
<script language="JavaScript" type="text/javascript">
    var webId = jQuery('input[name="id"]').val();
    adjustForm();
    function adjustForm(){
        jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {web_id : webId, type : "getredirecttype"}, function(data) {
            if(data.redirecttype == "proxy"){
                jQuery('.proxy').show();
            } else {
                jQuery('.proxy').hide();
            }
        });
    }
</script>
interface/web/sites/templates/web_vhost_subdomain_advanced.htm
@@ -67,15 +67,19 @@
            </div>
            <div class="ctrlHolder">
                <label for="custom_php_ini">{tmpl_var name='custom_php_ini_txt'}</label>
                <textarea name="custom_php_ini" id="custom_php_ini" rows='10' cols='50' style="width:400px;">{tmpl_var name='custom_php_ini'}</textarea>
                <textarea name="custom_php_ini" id="custom_php_ini" rows='10' cols='50' style="width:400px;">{tmpl_var name='custom_php_ini'}</textarea>&nbsp;<b>{tmpl_var name="available_php_directive_snippets_txt"}</b><br><br>&nbsp;{tmpl_var name="php_directive_snippets_txt"}
            </div>
            <div class="ctrlHolder apache">
                <label for="apache_directives">{tmpl_var name='apache_directives_txt'}</label>
                <textarea name="apache_directives" id="apache_directives" rows='10' cols='50' style="width:400px;">{tmpl_var name='apache_directives'}</textarea>
                <textarea name="apache_directives" id="apache_directives" rows='10' cols='50' style="width:400px;">{tmpl_var name='apache_directives'}</textarea>&nbsp;<b>{tmpl_var name="available_apache_directive_snippets_txt"}</b><br><br>&nbsp;{tmpl_var name="apache_directive_snippets_txt"}
            </div>
            <div class="ctrlHolder nginx">
                <label for="nginx_directives">{tmpl_var name='nginx_directives_txt'}</label>
                <textarea name="nginx_directives" id="nginx_directives" rows='10' cols='50' style="width:400px;">{tmpl_var name='nginx_directives'}</textarea>
                <textarea name="nginx_directives" id="nginx_directives" rows='10' cols='50' style="width:400px;">{tmpl_var name='nginx_directives'}</textarea>&nbsp;<b>{tmpl_var name="available_nginx_directive_snippets_txt"}</b><br><br>&nbsp;{tmpl_var name="nginx_directive_snippets_txt"}
            </div>
            <div class="ctrlHolder proxy">
                <label for="proxy_directives">{tmpl_var name='proxy_directives_txt'}</label>
                <textarea name="proxy_directives" id="proxy_directives" rows='10' cols='50' style="width:400px;">{tmpl_var name='proxy_directives'}</textarea>&nbsp;<b>{tmpl_var name="available_proxy_directive_snippets_txt"}</b><br><br>&nbsp;{tmpl_var name="proxy_directive_snippets_txt"}
            </div>
        </fieldset>
@@ -141,6 +145,13 @@
                jQuery('.phpfpm').hide();
            }
        });
        jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {web_id : webId, type : "getredirecttype"}, function(data) {
            if(data.redirecttype == "proxy"){
                jQuery('.proxy').show();
            } else {
                jQuery('.proxy').hide();
            }
        });
    }
            
</script>
interface/web/sites/templates/web_vhost_subdomain_redirect.htm
@@ -57,17 +57,19 @@
                jQuery('#redirect_type option[value="L"]').hide();
                jQuery('#redirect_type option[value="R,L"]').hide();
                jQuery('#redirect_type option[value="R=301,L"]').hide();
                if(selected != "no" && selected != "" && selected != "last"  && selected != "break"  && selected != "redirect"  && selected != "permanent") jQuery('#redirect_type option[value="no"]').attr('selected', 'selected');
                if(selected != "no" && selected != "" && selected != "last" && selected != "break" && selected != "redirect" && selected != "permanent" && selected != "proxy") jQuery('#redirect_type option[value="no"]').attr('selected', 'selected');
            } else {
                jQuery('#redirect_type option[value="last"]').attr('disabled','disabled');
                jQuery('#redirect_type option[value="break"]').attr('disabled','disabled');
                jQuery('#redirect_type option[value="redirect"]').attr('disabled','disabled');
                jQuery('#redirect_type option[value="permanent"]').attr('disabled','disabled');
                jQuery('#redirect_type option[value="proxy"]').attr('disabled','disabled');
                    
                jQuery('#redirect_type option[value="last"]').hide();
                jQuery('#redirect_type option[value="break"]').hide();
                jQuery('#redirect_type option[value="redirect"]').hide();
                jQuery('#redirect_type option[value="permanent"]').hide();
                jQuery('#redirect_type option[value="proxy"]').hide();
                if(selected != "no" && selected != "" && selected != "R"  && selected != "L"  && selected != "R,L" && selected != "R=301,L") jQuery('#redirect_type option[value="no"]').attr('selected', 'selected');
            }
        });
interface/web/sites/web_aliasdomain_edit.php
@@ -113,6 +113,19 @@
            $app->tpl->setVar("domain_option",$domain_select);
        }
        if($_SESSION["s"]["user"]["typ"] == 'admin') {
            // Directive Snippets
            $proxy_directive_snippets = $app->db->queryAllRecords("SELECT * FROM directive_snippets WHERE type = 'proxy' AND active = 'y'");
            $proxy_directive_snippets_txt = '';
            if(is_array($proxy_directive_snippets) && !empty($proxy_directive_snippets)){
                foreach($proxy_directive_snippets as $proxy_directive_snippet){
                    $proxy_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$proxy_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.$proxy_directive_snippet['snippet'].'</pre></a> ';
                }
            }
            if($proxy_directive_snippets_txt == '') $proxy_directive_snippets_txt = '------';
            $app->tpl->setVar("proxy_directive_snippets_txt",$proxy_directive_snippets_txt);
        }
        parent::onShowEnd();
        
    }
interface/web/sites/web_domain_edit.php
@@ -379,6 +379,16 @@
                if($nginx_directive_snippets_txt == '') $nginx_directive_snippets_txt = '------';
                $app->tpl->setVar("nginx_directive_snippets_txt",$nginx_directive_snippets_txt);
            }
            $proxy_directive_snippets = $app->db->queryAllRecords("SELECT * FROM directive_snippets WHERE type = 'proxy' AND active = 'y'");
            $proxy_directive_snippets_txt = '';
            if(is_array($proxy_directive_snippets) && !empty($proxy_directive_snippets)){
                    foreach($proxy_directive_snippets as $proxy_directive_snippet){
                        $proxy_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$proxy_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.$proxy_directive_snippet['snippet'].'</pre></a> ';
                    }
            }
            if($proxy_directive_snippets_txt == '') $proxy_directive_snippets_txt = '------';
            $app->tpl->setVar("proxy_directive_snippets_txt",$proxy_directive_snippets_txt);
        }
        $ssl_domain_select = '';
interface/web/sites/web_subdomain_edit.php
@@ -120,6 +120,19 @@
        }
        $app->tpl->setVar("domain",$this->dataRecord["domain"]);
        
        if($_SESSION["s"]["user"]["typ"] == 'admin') {
            // Directive Snippets
            $proxy_directive_snippets = $app->db->queryAllRecords("SELECT * FROM directive_snippets WHERE type = 'proxy' AND active = 'y'");
            $proxy_directive_snippets_txt = '';
            if(is_array($proxy_directive_snippets) && !empty($proxy_directive_snippets)){
                foreach($proxy_directive_snippets as $proxy_directive_snippet){
                    $proxy_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$proxy_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.$proxy_directive_snippet['snippet'].'</pre></a> ';
                }
            }
            if($proxy_directive_snippets_txt == '') $proxy_directive_snippets_txt = '------';
            $app->tpl->setVar("proxy_directive_snippets_txt",$proxy_directive_snippets_txt);
        }
        parent::onShowEnd();
        
    }
interface/web/sites/web_vhost_subdomain_edit.php
@@ -197,6 +197,51 @@
            unset($php_records);
            foreach($read_limits as $limit) $app->tpl->setVar($limit, ($limit == 'force_suexec' ? 'n' : 'y'));
            // Directive Snippets
            $php_directive_snippets = $app->db->queryAllRecords("SELECT * FROM directive_snippets WHERE type = 'php' AND active = 'y'");
            $php_directive_snippets_txt = '';
            if(is_array($php_directive_snippets) && !empty($php_directive_snippets)){
                    foreach($php_directive_snippets as $php_directive_snippet){
                        $php_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$php_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.$php_directive_snippet['snippet'].'</pre></a> ';
                    }
            }
            if($php_directive_snippets_txt == '') $php_directive_snippets_txt = '------';
            $app->tpl->setVar("php_directive_snippets_txt",$php_directive_snippets_txt);
            if($server_type == 'apache'){
                $apache_directive_snippets = $app->db->queryAllRecords("SELECT * FROM directive_snippets WHERE type = 'apache' AND active = 'y'");
                $apache_directive_snippets_txt = '';
                if(is_array($apache_directive_snippets) && !empty($apache_directive_snippets)){
                        foreach($apache_directive_snippets as $apache_directive_snippet){
                            $apache_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$apache_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.$apache_directive_snippet['snippet'].'</pre></a> ';
                        }
                }
                if($apache_directive_snippets_txt == '') $apache_directive_snippets_txt = '------';
                $app->tpl->setVar("apache_directive_snippets_txt",$apache_directive_snippets_txt);
            }
            if($server_type == 'nginx'){
                $nginx_directive_snippets = $app->db->queryAllRecords("SELECT * FROM directive_snippets WHERE type = 'nginx' AND active = 'y'");
                $nginx_directive_snippets_txt = '';
                if(is_array($nginx_directive_snippets) && !empty($nginx_directive_snippets)){
                        foreach($nginx_directive_snippets as $nginx_directive_snippet){
                            $nginx_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$nginx_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.$nginx_directive_snippet['snippet'].'</pre></a> ';
                        }
                }
                if($nginx_directive_snippets_txt == '') $nginx_directive_snippets_txt = '------';
                $app->tpl->setVar("nginx_directive_snippets_txt",$nginx_directive_snippets_txt);
            }
            $proxy_directive_snippets = $app->db->queryAllRecords("SELECT * FROM directive_snippets WHERE type = 'proxy' AND active = 'y'");
            $proxy_directive_snippets_txt = '';
            if(is_array($proxy_directive_snippets) && !empty($proxy_directive_snippets)){
                    foreach($proxy_directive_snippets as $proxy_directive_snippet){
                        $proxy_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$proxy_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.$proxy_directive_snippet['snippet'].'</pre></a> ';
                    }
            }
            if($proxy_directive_snippets_txt == '') $proxy_directive_snippets_txt = '------';
            $app->tpl->setVar("proxy_directive_snippets_txt",$proxy_directive_snippets_txt);
        }
        $ssl_domain_select = '';
server/conf/nginx_vhost.conf.master
@@ -30,7 +30,10 @@
<tmpl_if name='use_proxy'>
        location / {
            proxy_pass <tmpl_var name='rewrite_target'>;
            rewrite ^/\b<tmpl_var name='rewrite_subdir'>\b(.*) $1;
            rewrite ^/<tmpl_var name='rewrite_subdir'>/(.*) /$1;
<tmpl_loop name="proxy_directives">
        <tmpl_var name='proxy_directive'>
</tmpl_loop>
        }
</tmpl_if>
</tmpl_loop>
@@ -197,7 +200,10 @@
<tmpl_if name='use_proxy'>
        location / {
            proxy_pass <tmpl_var name='rewrite_target'>;
            rewrite ^/\b<tmpl_var name='rewrite_subdir'>\b(.*) $1;
            rewrite ^/<tmpl_var name='rewrite_subdir'>/(.*) /$1;
<tmpl_loop name="proxy_directives">
        <tmpl_var name='proxy_directive'>
</tmpl_loop>
        }
</tmpl_if>
}
server/plugins-available/nginx_plugin.inc.php
@@ -949,6 +949,23 @@
                }
            }
            // Custom proxy directives
            if($data['new']['redirect_type'] == 'proxy' && trim($data['new']['proxy_directives'] != '')){
                $final_proxy_directives = array();
                $proxy_directives = $data['new']['proxy_directives'];
                // Make sure we only have Unix linebreaks
                $proxy_directives = str_replace("\r\n", "\n", $proxy_directives);
                $proxy_directives = str_replace("\r", "\n", $proxy_directives);
                $proxy_directive_lines = explode("\n", $proxy_directives);
                if(is_array($proxy_directive_lines) && !empty($proxy_directive_lines)){
                    foreach($proxy_directive_lines as $proxy_directive_line){
                        $final_proxy_directives[] = array('proxy_directive' => $proxy_directive_line);
                    }
                }
            } else {
                $final_proxy_directives = false;
            }
            switch($data['new']['subdomain']) {
                case 'www':
                    if(substr($data['new']['redirect_path'],0,1) == '/'){ // relative path
@@ -992,6 +1009,7 @@
                        'rewrite_target'     => $data['new']['redirect_path'],
                        'rewrite_exclude'    => $rewrite_exclude,
                        'rewrite_subdir'    => $rewrite_subdir,
                        'proxy_directives'    => $final_proxy_directives,
                        'use_rewrite'    => ($data['new']['redirect_type'] == 'proxy' ? false:true),
                        'use_proxy'    => ($data['new']['redirect_type'] == 'proxy' ? true:false));
                    break;
@@ -1039,6 +1057,7 @@
                        'rewrite_target'     => $data['new']['redirect_path'],
                        'rewrite_exclude'    => $rewrite_exclude,
                        'rewrite_subdir'    => $rewrite_subdir,
                        'proxy_directives'    => $final_proxy_directives,
                        'use_rewrite'    => ($data['new']['redirect_type'] == 'proxy' ? false:true),
                        'use_proxy'    => ($data['new']['redirect_type'] == 'proxy' ? true:false));
                    break;
@@ -1084,6 +1103,7 @@
                        'rewrite_target'     => $data['new']['redirect_path'],
                        'rewrite_exclude'    => $rewrite_exclude,
                        'rewrite_subdir'    => $rewrite_subdir,
                        'proxy_directives'    => $final_proxy_directives,
                        'use_rewrite'    => ($data['new']['redirect_type'] == 'proxy' ? false:true),
                        'use_proxy'    => ($data['new']['redirect_type'] == 'proxy' ? true:false));
            }
@@ -1120,6 +1140,24 @@
        $aliases = $app->db->queryAllRecords('SELECT * FROM web_domain WHERE parent_domain_id = '.$data['new']['domain_id']." AND active = 'y' AND type != 'vhostsubdomain'");
        if(is_array($aliases)) {
            foreach($aliases as $alias) {
                // Custom proxy directives
                if($alias['redirect_type'] == 'proxy' && trim($alias['proxy_directives'] != '')){
                    $final_proxy_directives = array();
                    $proxy_directives = $alias['proxy_directives'];
                    // Make sure we only have Unix linebreaks
                    $proxy_directives = str_replace("\r\n", "\n", $proxy_directives);
                    $proxy_directives = str_replace("\r", "\n", $proxy_directives);
                    $proxy_directive_lines = explode("\n", $proxy_directives);
                    if(is_array($proxy_directive_lines) && !empty($proxy_directive_lines)){
                        foreach($proxy_directive_lines as $proxy_directive_line){
                            $final_proxy_directives[] = array('proxy_directive' => $proxy_directive_line);
                        }
                    }
                } else {
                    $final_proxy_directives = false;
                }
                if($alias['redirect_type'] == '' || $alias['redirect_path'] == '') {
                    switch($alias['subdomain']) {
                        case 'www':
@@ -1169,6 +1207,7 @@
                                'rewrite_type'         => ($alias['redirect_type'] == 'no')?'':$alias['redirect_type'],
                                'rewrite_target'     => $alias['redirect_path'],
                                'rewrite_subdir'    => $rewrite_subdir,
                                'proxy_directives'    => $final_proxy_directives,
                                'use_rewrite'    => ($alias['redirect_type'] == 'proxy' ? false:true),
                                'use_proxy'    => ($alias['redirect_type'] == 'proxy' ? true:false));
                                
@@ -1194,6 +1233,7 @@
                                'rewrite_type'         => ($alias['redirect_type'] == 'no')?'':$alias['redirect_type'],
                                'rewrite_target'     => $alias['redirect_path'],
                                'rewrite_subdir'    => $rewrite_subdir,
                                'proxy_directives'    => $final_proxy_directives,
                                'use_rewrite'    => ($alias['redirect_type'] == 'proxy' ? false:true),
                                'use_proxy'    => ($alias['redirect_type'] == 'proxy' ? true:false));
                            break;
@@ -1220,6 +1260,7 @@
                                'rewrite_type'         => ($alias['redirect_type'] == 'no')?'':$alias['redirect_type'],
                                'rewrite_target'     => $alias['redirect_path'],
                                'rewrite_subdir'    => $rewrite_subdir,
                                'proxy_directives'    => $final_proxy_directives,
                                'use_rewrite'    => ($alias['redirect_type'] == 'proxy' ? false:true),
                                'use_proxy'    => ($alias['redirect_type'] == 'proxy' ? true:false));
                            break;
@@ -1248,6 +1289,7 @@
                                'rewrite_type'         => ($alias['redirect_type'] == 'no')?'':$alias['redirect_type'],
                                'rewrite_target'     => $alias['redirect_path'],
                                'rewrite_subdir'    => $rewrite_subdir,
                                'proxy_directives'    => $final_proxy_directives,
                                'use_rewrite'    => ($alias['redirect_type'] == 'proxy' ? false:true),
                                'use_proxy'    => ($alias['redirect_type'] == 'proxy' ? true:false));
                    }