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