Marius Burkard
2016-04-20 4569cae57f127afd093794310ccd290d2d9fdf36
commit | author | age
95affe 1 <?php
T 2
3 /*
4     Form Definition
5
6     Tabledefinition
7
8     Datatypes:
9     - INTEGER (Forces the input to Int)
10     - DOUBLE
11     - CURRENCY (Formats the values to currency notation)
12     - VARCHAR (no format check, maxlength: 255)
13     - TEXT (no format check)
14     - DATE (Dateformat, automatic conversion to timestamps)
15
16     Formtype:
17     - TEXT (Textfield)
18     - TEXTAREA (Textarea)
19     - PASSWORD (Password textfield, input is not shown when edited)
20     - SELECT (Select option field)
21     - RADIO
22     - CHECKBOX
23     - CHECKBOXARRAY
24     - FILE
25
26     VALUE:
27     - Wert oder Array
28
29     Hint:
30     The ID field of the database table is not part of the datafield definition.
31     The ID field must be always auto incement (int or bigint).
b1a6a5 32
4c28d9 33     Search:
F 34     - searchable = 1 or searchable = 2 include the field in the search
35     - searchable = 1: this field will be the title of the search result
36     - searchable = 2: this field will be included in the description of the search result
95affe 37
T 38
39 */
40
73813a 41 $vhostdomain_type = 'domain';
MC 42 $form_title = "Web Domain";
43 $validator_function = 'web_domain';
61f1f5 44 $first_tab_title = "Domain";
73813a 45
MC 46 if(isset($_SESSION['s']['var']['vhostdomain_type'])) {
47     if($_SESSION['s']['var']['vhostdomain_type'] == 'subdomain') {
48         $vhostdomain_type = 'subdomain';
49         $form_title = "Subdomain";
50         $validator_function = 'sub_domain';
d22277 51         $first_tab_title = "Subdomain";
73813a 52     } elseif($_SESSION['s']['var']['vhostdomain_type'] == 'aliasdomain') {
MC 53         $vhostdomain_type = 'aliasdomain';
54         $form_title = "Aliasdomain";
55         $validator_function = 'alias_domain';
d22277 56         $first_tab_title = "Aliasdomain";
73813a 57     }
MC 58 }
59
60 $form["title"]    = $form_title;
b1a6a5 61 $form["description"]  = "";
73813a 62 $form["name"]    = "web_vhost_domain";
MC 63 $form["action"]   = "web_vhost_domain_edit.php";
b1a6a5 64 $form["db_table"]  = "web_domain";
MC 65 $form["db_table_idx"] = "domain_id";
66 $form["db_history"]  = "yes";
67 $form["tab_default"] = "domain";
73813a 68 $form["list_default"] = "web_vhost_domain_list.php";
b1a6a5 69 $form["auth"]   = 'yes'; // yes / no
95affe 70
T 71 $form["auth_preset"]["userid"]  = 0; // 0 = id of the user, > 0 id must match with id of current user
72 $form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
73 $form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
74 $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
75 $form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
76
73813a 77 $web_domain_edit_readonly = false;
95affe 78 // Clients may not change the website basic settings if they are not resellers
T 79 if($app->auth->has_clients($_SESSION['s']['user']['userid']) || $app->auth->is_admin()) {
80     $web_domain_edit_readonly = false;
81 } else {
73813a 82     if($vhostdomain_type == 'domain') $web_domain_edit_readonly = true;
95affe 83 }
T 84
ac099e 85 $wildcard_available = true;
73813a 86 if($vhostdomain_type != 'domain') $wildcard_available = false;
ac099e 87 $ssl_available = true;
42be38 88 $backup_available = ($vhostdomain_type == 'domain');
ac099e 89 if(!$app->auth->is_admin()) {
b1a6a5 90     $client_group_id = $_SESSION["s"]["user"]["default_group"];
67b0cb 91     $client = $app->db->queryOneRecord("SELECT limit_wildcard, limit_ssl, limit_ssl_letsencrypt, limit_backup FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
b1a6a5 92
MC 93     if($client['limit_wildcard'] != 'y') $wildcard_available = false;
94     if($client['limit_ssl'] != 'y') $ssl_available = false;
67b0cb 95     if($client['limit_ssl_letsencrypt'] == 'y') $ssl_available = false;
7a4248 96     if($client['limit_backup'] != 'y') $backup_available = false;
ac099e 97 }
95affe 98
bd68aa 99 $app->uses('getconf');
MC 100 $web_config = $app->getconf->get_global_config('sites');
101
95affe 102 $form["tabs"]['domain'] = array (
61f1f5 103     'title'  => $first_tab_title,
b1a6a5 104     'width'  => 100,
73813a 105     'template'  => "templates/web_vhost_domain_edit.htm",
b1a6a5 106     'readonly' => $web_domain_edit_readonly,
MC 107     'fields'  => array (
108         //#################################
109         // Begin Datatable fields
110         //#################################
95affe 111         'server_id' => array (
b1a6a5 112             'datatype' => 'INTEGER',
MC 113             'formtype' => 'SELECT',
114             'default' => '',
115             'datasource' => array (  'type' => 'SQL',
116                 'querystring' => 'SELECT server_id,server_name FROM server WHERE mirror_server_id = 0 AND web_server = 1 AND {AUTHSQL} ORDER BY server_name',
117                 'keyfield'=> 'server_id',
118                 'valuefield'=> 'server_name'
119             ),
120             'value'  => ''
95affe 121         ),
T 122         'ip_address' => array (
b1a6a5 123             'datatype' => 'VARCHAR',
MC 124             'formtype' => 'SELECT',
125             'default' => '',
a7bdf8 126             /*'datasource'    => array (     'type'    => 'SQL',
T 127                                         'querystring' => "SELECT ip_address,ip_address FROM server_ip WHERE ip_type = 'IPv4' AND {AUTHSQL} ORDER BY ip_address",
95affe 128                                         'keyfield'=> 'ip_address',
T 129                                         'valuefield'=> 'ip_address'
a7bdf8 130                                      ),*/
b1a6a5 131             'value'  => '',
4c28d9 132             'searchable' => 2
a7bdf8 133         ),
T 134         'ipv6_address' => array (
b1a6a5 135             'datatype' => 'VARCHAR',
MC 136             'formtype' => 'SELECT',
137             'default' => '',
a7bdf8 138             /*'datasource'    => array (     'type'    => 'SQL',
T 139                                         'querystring' => "SELECT ip_address,ip_address FROM server_ip WHERE ip_type = 'IPv6' AND {AUTHSQL} ORDER BY ip_address",
140                                         'keyfield'=> 'ip_address',
141                                         'valuefield'=> 'ip_address'
142                                      ),*/
b1a6a5 143             'value'  => '',
4c28d9 144             'searchable' => 2
95affe 145         ),
T 146         'domain' => array (
b1a6a5 147             'datatype' => 'VARCHAR',
MC 148             'formtype' => 'TEXT',
149             'filters'   => array( 0 => array( 'event' => 'SAVE',
150                     'type' => 'IDNTOASCII'),
151                 1 => array( 'event' => 'SHOW',
152                     'type' => 'IDNTOUTF8'),
153                 2 => array( 'event' => 'SAVE',
154                     'type' => 'TOLOWER')
155             ),
156             'validators'    => array (  0 => array (    'type'  => 'CUSTOM',
157                     'class' => 'validate_domain',
73813a 158                     'function' => $validator_function,
b1a6a5 159                     'errmsg'=> 'domain_error_regex'),
MC 160             ),
161             'default' => '',
162             'value'  => '',
163             'width'  => '30',
164             'maxlength' => '255',
4c28d9 165             'searchable' => 1
95affe 166         ),
T 167         'type' => array (
b1a6a5 168             'datatype' => 'VARCHAR',
MC 169             'formtype' => 'SELECT',
170             'default' => 'y',
73813a 171             'value'  => array('vhost' => 'Site', 'alias' => 'Alias', 'vhostalias' => 'Alias', 'subdomain' => 'Subdomain', 'vhostsubdomain' => 'Subdomain')
95affe 172         ),
T 173         'parent_domain_id' => array (
b1a6a5 174             'datatype' => 'INTEGER',
MC 175             'formtype' => 'SELECT',
176             'default' => '',
177             'value'  => ''
95affe 178         ),
T 179         'vhost_type' => array (
b1a6a5 180             'datatype' => 'VARCHAR',
MC 181             'formtype' => 'SELECT',
182             'default' => 'y',
183             'value'  => array('name' => 'Namebased', 'ip' => 'IP-Based')
95affe 184         ),
T 185         'hd_quota' => array (
b1a6a5 186             'datatype' => 'INTEGER',
MC 187             'formtype' => 'TEXT',
73813a 188             'default' => ($vhostdomain_type == 'domain' ? '-1' : '0'),
b1a6a5 189             'value'  => '',
MC 190             'width'  => '7',
191             'maxlength' => '7'
95affe 192         ),
T 193         'traffic_quota' => array (
b1a6a5 194             'datatype' => 'INTEGER',
MC 195             'formtype' => 'TEXT',
196             'validators' => array (  0 => array ( 'type' => 'NOTEMPTY',
197                     'errmsg'=> 'traffic_quota_error_empty'),
198                 1 => array ( 'type' => 'REGEX',
199                     'regex' => '/^(\-1|[0-9]{1,10})$/',
200                     'errmsg'=> 'traffic_quota_error_regex'),
201             ),
202             'default' => '-1',
203             'value'  => '',
204             'width'  => '7',
205             'maxlength' => '7'
95affe 206         ),
T 207         'cgi' => array (
b1a6a5 208             'datatype' => 'VARCHAR',
MC 209             'formtype' => 'CHECKBOX',
210             'default' => 'n',
211             'value'  => array(0 => 'n', 1 => 'y')
95affe 212         ),
T 213         'ssi' => array (
b1a6a5 214             'datatype' => 'VARCHAR',
MC 215             'formtype' => 'CHECKBOX',
216             'default' => 'n',
217             'value'  => array(0 => 'n', 1 => 'y')
95affe 218         ),
T 219         'suexec' => array (
b1a6a5 220             'datatype' => 'VARCHAR',
MC 221             'formtype' => 'CHECKBOX',
222             'default' => 'y',
223             'value'  => array(0 => 'n', 1 => 'y')
95affe 224         ),
T 225         'errordocs' => array (
b1a6a5 226             'datatype' => 'INTEGER',
MC 227             'formtype' => 'CHECKBOX',
228             'default' => '1',
229             'value'  => array(0 => '0', 1 => '1')
95affe 230         ),
T 231         'subdomain' => array (
b1a6a5 232             'datatype' => 'VARCHAR',
MC 233             'formtype' => 'SELECT',
234             'default' => 'www',
235             'value'  => ($wildcard_available ? array('none' => 'none_txt', 'www' => 'www.', '*' => '*.') : array('none' => 'none_txt', 'www' => 'www.'))
95affe 236         ),
T 237         'ssl' => array (
b1a6a5 238             'datatype' => 'VARCHAR',
MC 239             'formtype' => 'CHECKBOX',
240             'default' => 'n',
241             'value'  => array(0 => 'n', 1 => 'y')
95affe 242         ),
2dffea 243         'ssl_letsencrypt' => array (
MC 244             'datatype' => 'VARCHAR',
245             'formtype' => 'CHECKBOX',
246             'default' => 'n',
247             'value'  => array(0 => 'n', 1 => 'y')
248         ),
95affe 249         'php' => array (
b1a6a5 250             'datatype' => 'VARCHAR',
MC 251             'formtype' => 'SELECT',
252             'default' => 'fast-cgi',
95affe 253             'valuelimit' => 'client:web_php_options',
c59632 254             'value'  => array('no' => 'disabled_txt', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP', 'php-fpm' => 'PHP-FPM', 'hhvm' => 'HHVM'),
4c28d9 255             'searchable' => 2
95affe 256         ),
62b385 257         'fastcgi_php_version' => array (
b1a6a5 258             'datatype' => 'VARCHAR',
MC 259             'formtype' => 'SELECT',
260             'default' => '',
62b385 261             /*'datasource'    => array (     'type'    => 'SQL',
F 262                                         'querystring' => "SELECT ip_address,ip_address FROM server_ip WHERE ip_type = 'IPv4' AND {AUTHSQL} ORDER BY ip_address",
263                                         'keyfield'=> 'ip_address',
264                                         'valuefield'=> 'ip_address'
265                                      ),*/
b1a6a5 266             'value'  => ''
62b385 267         ),
ab7597 268         'perl' => array (
b1a6a5 269             'datatype' => 'VARCHAR',
MC 270             'formtype' => 'CHECKBOX',
271             'default' => 'n',
272             'value'  => array(0 => 'n', 1 => 'y')
ab7597 273         ),
22ef48 274         'ruby' => array (
b1a6a5 275             'datatype' => 'VARCHAR',
MC 276             'formtype' => 'CHECKBOX',
277             'default' => 'n',
278             'value'  => array(0 => 'n', 1 => 'y')
22ef48 279         ),
298ef5 280         'python' => array (
b1a6a5 281             'datatype' => 'VARCHAR',
MC 282             'formtype' => 'CHECKBOX',
283             'default' => 'n',
284             'value'  => array(0 => 'n', 1 => 'y')
298ef5 285         ),
86bc65 286         'enable_pagespeed' => array (
MC 287             'datatype' => 'VARCHAR',
288             'formtype' => 'CHECKBOX',
289             'default'  => 'n',
290             'value' => array (
291                 0 => 'n',
292                 1 => 'y'
293             )
294         ),
95affe 295         'active' => array (
b1a6a5 296             'datatype' => 'VARCHAR',
MC 297             'formtype' => 'CHECKBOX',
298             'default' => 'y',
299             'value'  => array(0 => 'n', 1 => 'y')
95affe 300         ),
b1a6a5 301         //#################################
MC 302         // ENDE Datatable fields
303         //#################################
1fa8f4 304     ),
FT 305     'plugins' => array (
306         // needs serverId for web.server_type
307         'directive_snippets_id' => array (
308             'class' => 'plugin_directive_snippets'
309         ),
310      )
95affe 311 );
T 312
73813a 313 // add type-specific field attributes
MC 314 if($vhostdomain_type == 'domain') {
315     $form['tabs']['domain']['fields']['server_id']['validators'] = array(
316         0 => array (
317             'type'  => 'NOTEMPTY',
318             'errmsg'=> 'no_server_error'
319         ),
320     );
321     $form['tabs']['domain']['fields']['parent_domain_id']['datasource'] = array (
322         'type' => 'SQL',
323         'querystring' => "SELECT web_domain.domain_id,web_domain.domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
324         'keyfield'=> 'domain_id',
325         'valuefield'=> 'domain'
326     );
327     $form['tabs']['domain']['fields']['hd_quota']['validators'] = array (
328         0 => array (
329             'type' => 'NOTEMPTY',
330             'errmsg'=> 'hd_quota_error_empty'
331         ),
332         1 => array (
333             'type' => 'REGEX',
334             'regex' => '/^(\-1|[0-9]{1,10})$/',
335             'errmsg'=> 'hd_quota_error_regex'
336         ),
337     );
338     $form['tabs']['domain']['fields']['subdomain']['validators'] = array(
339         0 => array (
340             'type'  => 'CUSTOM',
341             'class' => 'validate_domain',
342             'function' => 'web_domain_autosub',
343             'errmsg'=> 'domain_error_autosub'
344         ),
345     );
d22277 346     $form['tabs']['domain']['fields']['web_folder'] = array (
MB 347         'datatype' => 'VARCHAR',
348         'validators' => array (  0 => array ( 'type' => 'REGEX',
349                 'regex' => '@^((?!(.*\.\.)|(.*\./)|(.*//))[^/][\w/_\.\-]{1,100})?$@',
350                 'errmsg'=> 'web_folder_error_regex'),
351         ),
352         'formtype' => 'TEXT',
353         'default' => '',
354         'value'  => '',
355         'width'  => '30',
356         'maxlength' => '255'
357     );
73813a 358 } else {
MC 359     $form['tabs']['domain']['fields']['parent_domain_id']['datasource'] = array (
360         'type' => 'SQL',
361         'querystring' => "SELECT web_domain.domain_id, CONCAT(web_domain.domain, ' :: ', server.server_name) AS parent_domain FROM web_domain, server WHERE web_domain.type = 'vhost' AND web_domain.server_id = server.server_id AND {AUTHSQL::web_domain} ORDER BY web_domain.domain",
362         'keyfield'=> 'domain_id',
363         'valuefield'=> 'parent_domain'
364     );
365     $form['tabs']['domain']['fields']['web_folder'] = array (
366         'datatype' => 'VARCHAR',
367         'validators' => array (  0 => array ( 'type' => 'REGEX',
d22277 368                 'regex' => '@^((?!(.*\.\.)|(.*\./)|(.*//))[^/][\w/_\.\-]{1,100})?$@',
73813a 369                 'errmsg'=> 'web_folder_error_regex'),
MC 370         ),
371         'formtype' => 'TEXT',
372         'default' => '',
373         'value'  => '',
374         'width'  => '30',
375         'maxlength' => '255'
376     );
377
378 }
379
95affe 380
T 381 $form["tabs"]['redirect'] = array (
b1a6a5 382     'title'  => "Redirect",
MC 383     'width'  => 100,
73813a 384     'template'  => "templates/web_vhost_domain_redirect.htm",
b1a6a5 385     'readonly' => false,
MC 386     'fields'  => array (
387         //#################################
388         // Begin Datatable fields
389         //#################################
95affe 390         'redirect_type' => array (
b1a6a5 391             'datatype' => 'VARCHAR',
MC 392             'formtype' => 'SELECT',
393             'default' => '',
394             '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')
95affe 395         ),
T 396         'redirect_path' => array (
b1a6a5 397             'datatype' => 'VARCHAR',
MC 398             'validators' => array (  0 => array ( 'type' => 'REGEX',
399                     'regex' => '@^(([\.]{0})|((ftp|https?)://([-\w\.]+)+(:\d+)?(/([\w/_\.\,\-\+\?\~!:%]*(\?\S+)?)?)?)|(\[scheme\]://([-\w\.]+)+(:\d+)?(/([\w/_\.\-\,\+\?\~!:%]*(\?\S+)?)?)?)|(/(?!.*\.\.)[\w/_\.\-]{1,255}/))$@',
400                     'errmsg'=> 'redirect_error_regex'),
401             ),
402             'formtype' => 'TEXT',
403             'default' => '',
404             'value'  => '',
405             'width'  => '30',
406             'maxlength' => '255'
95affe 407         ),
e64fbb 408         'seo_redirect' => array (
b1a6a5 409             'datatype' => 'VARCHAR',
MC 410             'formtype' => 'SELECT',
411             'default' => '',
412             'value'  => array('' => 'no_redirect_txt', 'non_www_to_www' => 'domain.tld => www.domain.tld', 'www_to_non_www' => 'www.domain.tld => domain.tld', '*_domain_tld_to_domain_tld' => '*.doman.tld => domain.tld', '*_domain_tld_to_www_domain_tld' => '*.domain.tld => www.domain.tld', '*_to_domain_tld' => '* => domain.tld', '*_to_www_domain_tld' => '* => www.domain.tld')
e64fbb 413         ),
615a0a 414         'rewrite_rules' => array (
b1a6a5 415             'datatype' => 'TEXT',
MC 416             'formtype' => 'TEXT',
417             'default' => '',
418             'value'  => '',
419             'width'  => '30',
420             'maxlength' => '255'
615a0a 421         ),
f0dfa9 422         'rewrite_to_https' => array (
MC 423             'datatype' => 'VARCHAR',
424             'formtype' => 'CHECKBOX',
425             'default'  => 'n',
426             'value' => array (
427                 0 => 'n',
428                 1 => 'y'
429             )
430         ),
b1a6a5 431         //#################################
MC 432         // ENDE Datatable fields
433         //#################################
95affe 434     )
T 435 );
436
ac099e 437 if($ssl_available) {
b1a6a5 438     $form["tabs"]['ssl'] = array (
MC 439         'title'  => "SSL",
440         'width'  => 100,
73813a 441         'template'  => "templates/web_vhost_domain_ssl.htm",
b1a6a5 442         'readonly' => false,
MC 443         'fields'  => array (
444             //#################################
445             // Begin Datatable fields
446             //#################################
447             'ssl_state' => array (
448                 'datatype' => 'VARCHAR',
449                 'formtype' => 'TEXT',
450                 'validators' => array (  0 => array ( 'type' => 'REGEX',
243697 451                         'regex' => '/^(([\.]{0})|([-a-zA-Z0-9._,&äöüÄÖÜ ]{0,255}))$/',
b1a6a5 452                         'errmsg'=> 'ssl_state_error_regex'),
MC 453                 ),
454                 'default' => '',
455                 'value'  => '',
456                 'width'  => '30',
457                 'maxlength' => '255'
458             ),
459             'ssl_locality' => array (
460                 'datatype' => 'VARCHAR',
461                 'formtype' => 'TEXT',
462                 'validators' => array (  0 => array ( 'type' => 'REGEX',
243697 463                         'regex' => '/^(([\.]{0})|([-a-zA-Z0-9._,&äöüÄÖÜ ]{0,255}))$/',
b1a6a5 464                         'errmsg'=> 'ssl_locality_error_regex'),
MC 465                 ),
466                 'default' => '',
467                 'value'  => '',
468                 'width'  => '30',
469                 'maxlength' => '255'
470             ),
471             'ssl_organisation' => array (
472                 'datatype' => 'VARCHAR',
473                 'formtype' => 'TEXT',
474                 'validators' => array (  0 => array ( 'type' => 'REGEX',
243697 475                         'regex' => '/^(([\.]{0})|([-a-zA-Z0-9._,&äöüÄÖÜ ]{0,255}))$/',
b1a6a5 476                         'errmsg'=> 'ssl_organisation_error_regex'),
MC 477                 ),
478                 'default' => '',
479                 'value'  => '',
480                 'width'  => '30',
481                 'maxlength' => '255'
482             ),
483             'ssl_organisation_unit' => array (
484                 'datatype' => 'VARCHAR',
485                 'formtype' => 'TEXT',
486                 'validators' => array (  0 => array ( 'type' => 'REGEX',
243697 487                         'regex' => '/^(([\.]{0})|([-a-zA-Z0-9._,&äöüÄÖÜ ]{0,255}))$/',
b1a6a5 488                         'errmsg'=> 'ssl_organistaion_unit_error_regex'),
MC 489                 ),
490                 'default' => '',
491                 'value'  => '',
492                 'width'  => '30',
493                 'maxlength' => '255'
494             ),
495             /*
95affe 496         'ssl_country' => array (
T 497             'datatype'    => 'VARCHAR',
498             'formtype'    => 'TEXT',
e2ce43 499             'validators'    => array (     0 => array (    'type'    => 'REGEX',
dec0df 500                                                         'regex' => '/^(([\.]{0})|([A-Z]{2,2}))$/',
e2ce43 501                                                         'errmsg'=> 'ssl_country_error_regex'),
T 502                                     ),
95affe 503             'default'    => '',
T 504             'value'        => '',
505             'width'        => '2',
506             'maxlength'    => '2'
507         ),
14b8be 508         */
b1a6a5 509             'ssl_country' => array (
MC 510                 'datatype' => 'VARCHAR',
511                 'formtype' => 'SELECT',
512                 'default' => '',
513                 'datasource' => array (  'type' => 'SQL',
514                     'querystring' => 'SELECT iso,printable_name FROM country ORDER BY printable_name',
515                     'keyfield'=> 'iso',
516                     'valuefield'=> 'printable_name'
517                 ),
518                 'value'  => ''
519             ),
520             'ssl_domain' => array (
521                 'datatype' => 'VARCHAR',
522                 'formtype' => 'TEXT',
523                 'default' => '',
524                 'value'  => '',
525                 'width'  => '30',
526                 'maxlength' => '255'
527             ),
528             'ssl_key' => array (
529                 'datatype' => 'TEXT',
530                 'formtype' => 'TEXTAREA',
531                 'default' => '',
532                 'value'  => '',
533                 'cols'  => '30',
534                 'rows'  => '10'
535             ),
536             'ssl_request' => array (
537                 'datatype' => 'TEXT',
538                 'formtype' => 'TEXTAREA',
539                 'default' => '',
540                 'value'  => '',
541                 'cols'  => '30',
542                 'rows'  => '10'
543             ),
544             'ssl_cert' => array (
545                 'datatype' => 'TEXT',
546                 'formtype' => 'TEXTAREA',
547                 'default' => '',
548                 'value'  => '',
549                 'cols'  => '30',
550                 'rows'  => '10'
551             ),
552             'ssl_bundle' => array (
553                 'datatype' => 'TEXT',
554                 'formtype' => 'TEXTAREA',
555                 'default' => '',
556                 'value'  => '',
557                 'cols'  => '30',
558                 'rows'  => '10'
559             ),
560             'ssl_action' => array (
561                 'datatype' => 'VARCHAR',
562                 'formtype' => 'SELECT',
563                 'default' => '',
564                 'value'  => array('' => 'none_txt', 'save' => 'save_certificate_txt', 'create' => 'create_certificate_txt', 'del' => 'delete_certificate_txt')
565             ),
f7ec00 566             'enable_spdy' => array (
PA 567                 'datatype' => 'VARCHAR',
568                 'formtype' => 'CHECKBOX',
569                 'default'  => 'n',
570                 'value' => array (
571                     0 => 'n',
572                     1 => 'y'
573                 )
574             ),
b1a6a5 575             //#################################
MC 576             // ENDE Datatable fields
577             //#################################
578         )
579     );
ac099e 580 }
95affe 581
eed36b 582 //* Statistics
T 583 $form["tabs"]['stats'] = array (
b1a6a5 584     'title'  => "Stats",
MC 585     'width'  => 100,
73813a 586     'template'  => "templates/web_vhost_domain_stats.htm",
b1a6a5 587     'readonly' => false,
MC 588     'fields'  => array (
589         //#################################
590         // Begin Datatable fields
591         //#################################
eed36b 592         'stats_password' => array (
b1a6a5 593             'datatype' => 'VARCHAR',
MC 594             'formtype' => 'PASSWORD',
7c2179 595             'validators' => array(
MC 596                 0 => array(
597                     'type' => 'CUSTOM',
598                     'class' => 'validate_password',
599                     'function' => 'password_check',
600                     'errmsg' => 'weak_password_txt'
601                 )
602             ),
eed36b 603             'encryption' => 'CRYPT',
b1a6a5 604             'default' => '',
MC 605             'value'  => '',
606             'width'  => '30',
607             'maxlength' => '255'
eed36b 608         ),
379a4b 609         'stats_type' => array (
b1a6a5 610             'datatype' => 'VARCHAR',
MC 611             'formtype' => 'SELECT',
612             'default' => 'webalizer',
797215 613             'value'  => array('webalizer' => 'Webalizer', 'awstats' => 'AWStats', '' => 'None')
379a4b 614         ),
b1a6a5 615         //#################################
MC 616         // ENDE Datatable fields
617         //#################################
eed36b 618     )
T 619 );
620
7a4248 621
D 622 //* Backup
623 if ($backup_available) {
624     $form["tabs"]['backup'] = array (
625         'title'  => "Backup",
626         'width'  => 100,
566050 627         'template'  => "templates/web_vhost_domain_backup.htm",
7a4248 628         'readonly' => false,
D 629         'fields'  => array (
630             //#################################
631             // Begin Datatable fields
632             //#################################
633             'backup_interval' => array (
634                 'datatype' => 'VARCHAR',
635                 'formtype' => 'SELECT',
636                 'default' => '',
637                 'value'  => array('none' => 'no_backup_txt', 'daily' => 'daily_backup_txt', 'weekly' => 'weekly_backup_txt', 'monthly' => 'monthly_backup_txt')
638             ),
639             'backup_copies' => array (
640                 'datatype' => 'INTEGER',
641                 'formtype' => 'SELECT',
642                 'default' => '',
643                 'value'  => array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10')
644             ),
645             'backup_excludes' => array (
646                 'datatype' => 'VARCHAR',
647                 'validators' => array (  0 => array ( 'type' => 'REGEX',
648                         'regex' => '@^(?!.*\.\.)[-a-zA-Z0-9_/.~,*]*$@',
649                         'errmsg'=> 'backup_excludes_error_regex'),
650                 ),
651                 'formtype' => 'TEXT',
652                 'default' => '',
653                 'value'  => '',
654                 'width'  => '30',
655                 'maxlength' => '255'
656             ),
657             //#################################
658             // ENDE Datatable fields
659             //#################################
660         ),
661         'plugins' => array (
662             'backup_records' => array (
663                 'class'   => 'plugin_backuplist',
664                 'options' => array(
665                 )
666             )
667         )
668     );
669 }
670
49d631 671 if($_SESSION["s"]["user"]["typ"] == 'admin'
D 672     || ($web_config['reseller_can_use_options'] == 'y' && $app->auth->has_clients($_SESSION['s']['user']['userid']))) {
95affe 673
b1a6a5 674     $form["tabs"]['advanced'] = array (
MC 675         'title'  => "Options",
676         'width'  => 100,
73813a 677         'template'  => "templates/web_vhost_domain_advanced.htm",
b1a6a5 678         'readonly' => false,
MC 679         'fields'  => array (
680             //#################################
681             // Begin Datatable fields
682             //#################################
683             'document_root' => array (
684                 'datatype' => 'VARCHAR',
685                 'formtype' => 'TEXT',
686                 'validators' => array (  0 => array ( 'type' => 'NOTEMPTY',
687                         'errmsg'=> 'documentroot_error_empty'),
688                 ),
689                 'default' => '',
690                 'value'  => '',
691                 'width'  => '30',
692                 'maxlength' => '255'
693             ),
694             'system_user' => array (
695                 'datatype' => 'VARCHAR',
696                 'formtype' => 'TEXT',
697                 'validators' => array (  0 => array ( 'type' => 'NOTEMPTY',
698                         'errmsg'=> 'sysuser_error_empty'),
797215 699                         1 => array(
MC 700                             'type' => 'CUSTOM',
701                             'class' => 'validate_systemuser',
702                             'function' => 'check_sysuser',
703                             'check_names' => true,
704                             'errmsg' => 'invalid_system_user_or_group_txt'
705                         ),
b1a6a5 706                 ),
MC 707                 'default' => '',
708                 'value'  => '',
709                 'width'  => '30',
710                 'maxlength' => '255'
711             ),
712             'system_group' => array (
713                 'datatype' => 'VARCHAR',
714                 'formtype' => 'TEXT',
715                 'validators' => array (  0 => array ( 'type' => 'NOTEMPTY',
716                         'errmsg'=> 'sysgroup_error_empty'),
797215 717                         1 => array(
MC 718                             'type' => 'CUSTOM',
719                             'class' => 'validate_systemuser',
720                             'function' => 'check_sysgroup',
721                             'check_names' => true,
722                             'errmsg' => 'invalid_system_user_or_group_txt'
723                         ),
b1a6a5 724                 ),
MC 725                 'default' => '',
726                 'value'  => '',
727                 'width'  => '30',
728                 'maxlength' => '255'
729             ),
730             'allow_override' => array (
731                 'datatype' => 'VARCHAR',
732                 'formtype' => 'TEXT',
733                 'validators' => array (  0 => array ( 'type' => 'NOTEMPTY',
734                         'errmsg'=> 'allow_override_error_empty'),
735                 ),
736                 'default' => 'All',
737                 'value'  => '',
738                 'width'  => '30',
739                 'maxlength' => '255'
740             ),
741             'php_fpm_use_socket' => array (
742                 'datatype' => 'VARCHAR',
743                 'formtype' => 'CHECKBOX',
744                 'default' => 'n',
745                 'value'  => array(0 => 'n', 1 => 'y')
746             ),
747             'pm' => array (
748                 'datatype' => 'VARCHAR',
749                 'formtype' => 'SELECT',
750                 'default' => 'dynamic',
751                 'value'  => array('static' => 'static', 'dynamic' => 'dynamic', 'ondemand' => 'ondemand (PHP Version >= 5.3.9)')
752             ),
753             'pm_max_children' => array (
754                 'datatype' => 'INTEGER',
755                 'formtype' => 'TEXT',
756                 'validators' => array (  0 => array ( 'type' => 'REGEX',
757                         'regex' => '/^([1-9][0-9]{0,10})$/',
758                         'errmsg'=> 'pm_max_children_error_regex'),
759                 ),
760                 'default' => '10',
761                 'value'  => '',
762                 'width'  => '3',
763                 'maxlength' => '3'
764             ),
765             'pm_start_servers' => array (
766                 'datatype' => 'INTEGER',
767                 'formtype' => 'TEXT',
768                 'validators' => array (  0 => array ( 'type' => 'REGEX',
769                         'regex' => '/^([1-9][0-9]{0,10})$/',
770                         'errmsg'=> 'pm_start_servers_error_regex'),
771                 ),
772                 'default' => '2',
773                 'value'  => '',
774                 'width'  => '3',
775                 'maxlength' => '3'
776             ),
777             'pm_min_spare_servers' => array (
778                 'datatype' => 'INTEGER',
779                 'formtype' => 'TEXT',
780                 'validators' => array (  0 => array ( 'type' => 'REGEX',
781                         'regex' => '/^([1-9][0-9]{0,10})$/',
782                         'errmsg'=> 'pm_min_spare_servers_error_regex'),
783                 ),
784                 'default' => '1',
785                 'value'  => '',
786                 'width'  => '3',
787                 'maxlength' => '3'
788             ),
789             'pm_max_spare_servers' => array (
790                 'datatype' => 'INTEGER',
791                 'formtype' => 'TEXT',
792                 'validators' => array (  0 => array ( 'type' => 'REGEX',
793                         'regex' => '/^([1-9][0-9]{0,10})$/',
794                         'errmsg'=> 'pm_max_spare_servers_error_regex'),
795                 ),
796                 'default' => '5',
797                 'value'  => '',
798                 'width'  => '3',
799                 'maxlength' => '3'
800             ),
801             'pm_process_idle_timeout' => array (
802                 'datatype' => 'INTEGER',
803                 'formtype' => 'TEXT',
804                 'validators' => array (  0 => array ( 'type' => 'REGEX',
805                         'regex' => '/^([1-9][0-9]{0,10})$/',
806                         'errmsg'=> 'pm_process_idle_timeout_error_regex'),
807                 ),
808                 'default' => '10',
809                 'value'  => '',
810                 'width'  => '3',
811                 'maxlength' => '6'
812             ),
813             'pm_max_requests' => array (
814                 'datatype' => 'INTEGER',
815                 'formtype' => 'TEXT',
816                 'validators' => array (  0 => array ( 'type' => 'REGEX',
817                         'regex' => '/^([0-9]{1,11})$/',
818                         'errmsg'=> 'pm_max_requests_error_regex'),
819                 ),
820                 'default' => '0',
821                 'value'  => '',
822                 'width'  => '3',
823                 'maxlength' => '6'
824             ),
825             'php_open_basedir' => array (
826                 'datatype' => 'VARCHAR',
827                 'formtype' => 'TEXT',
828                 /*'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
c8cf71 829                                                         'errmsg'=> 'php_open_basedir_error_empty'),
80e3c9 830                                     ),   */
b1a6a5 831                 'default' => 'All',
MC 832                 'value'  => '',
833                 'width'  => '30',
834                 'maxlength' => '255'
835             ),
836             'custom_php_ini' => array (
837                 'datatype' => 'TEXT',
838                 'formtype' => 'TEXT',
839                 'default' => '',
840                 'value'  => '',
841                 'width'  => '30',
842                 'maxlength' => '255'
843             ),
844             'apache_directives' => array (
845                 'datatype' => 'TEXT',
846                 'formtype' => 'TEXT',
797215 847                 'validators' => array (  0 => array(
MC 848                             'type' => 'CUSTOM',
849                             'class' => 'validate_domain',
850                             'function' => 'web_apache_directives',
851                             'errmsg' => 'apache_directive_blockd_error'
852                         ),
853                 ),
b1a6a5 854                 'default' => '',
MC 855                 'value'  => '',
856                 'width'  => '30',
857                 'maxlength' => '255'
858             ),
859             'nginx_directives' => array (
860                 'datatype' => 'TEXT',
861                 'formtype' => 'TEXT',
862                 'default' => '',
863                 'value'  => '',
864                 'width'  => '30',
865                 'maxlength' => '255'
866             ),
867             'proxy_directives' => array (
868                 'datatype' => 'TEXT',
869                 'formtype' => 'TEXT',
870                 'default' => '',
871                 'value'  => '',
872                 'width'  => '30',
873                 'maxlength' => '255'
874             ),
3d96c5 875             'added_date' => array (
TB 876                 'datatype'    => 'DATE',
877                 'formtype'    => 'TEXT',
878                 'default'    => date($app->lng('conf_format_dateshort')),
879                 'value'        => '',
880                 'separator'    => '',
881                 'width'        => '15',
882                 'maxlength'    => '15',
883                 'rows'        => '',
884                 'cols'        => ''
885             ),
886             'added_by' => array (
887                 'datatype' => 'VARCHAR',
888                 'formtype' => 'TEXT',
889                 'default' => $_SESSION['s']['user']['username'],
890                 'value'  => '',
891                 'separator' => '',
892                 'width'  => '30',
893                 'maxlength' => '255',
894                 'rows'  => '',
895                 'cols'  => ''
896             ),
634d3a 897             'http_port' => array (
TB 898                 'datatype' => 'INTEGER',
899                 'formtype' => 'TEXT',
900                 'validators' => array (  0 => array ( 'type' => 'REGEX',
901                         'regex' => '/^([0-9]{1,5})$/',
902                         'errmsg'=> 'http_port_error_regex'),
903                 ),
904                 'default' => '0',
905                 'value'  => '',
906                 'width'  => '3',
907                 'maxlength' => '6'
908             ),
909             'https_port' => array (
910                 'datatype' => 'INTEGER',
911                 'formtype' => 'TEXT',
912                 'validators' => array (  0 => array ( 'type' => 'REGEX',
913                         'regex' => '/^([0-9]{1,5})$/',
914                         'errmsg'=> 'https_port_error_regex'),
915                 ),
916                 'default' => '0',
917                 'value'  => '',
918                 'width'  => '3',
919                 'maxlength' => '6'
920             )
b1a6a5 921             //#################################
MC 922             // ENDE Datatable fields
923             //#################################
924         )
925     );
95affe 926
T 927 }
928
929
9539ce 930 ?>