server_config.tform.php 61.6 KB
Newer Older
1
2
3
<?php

/*
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  Form Definition

  Tabledefinition

  Datatypes:
  - INTEGER (Forces the input to Int)
  - DOUBLE
  - CURRENCY (Formats the values to currency notation)
  - VARCHAR (no format check, maxlength: 255)
  - TEXT (no format check)
  - DATE (Dateformat, automatic conversion to timestamps)

  Formtype:
  - TEXT (Textfield)
  - TEXTAREA (Textarea)
  - PASSWORD (Password textfield, input is not shown when edited)
  - SELECT (Select option field)
  - RADIO
  - CHECKBOX
  - CHECKBOXARRAY
  - FILE

  VALUE:
  - Wert oder Array

  Hint:
  The ID field of the database table is not part of the datafield definition.
  The ID field must be always auto incement (int or bigint).


 */

36
$form["title"] = "server_config";
Thom's avatar
Thom committed
37
//$form["description"] = "";
38
39
40
41
42
43
44
45
46
47
$form["name"] = "server_config";
$form["action"] = "server_config_edit.php";
$form["db_table"] = "server";
$form["db_table_idx"] = "server_id";
$form["db_history"] = "yes";
$form["tab_default"] = "server";
$form["list_default"] = "server_config_list.php";
$form["auth"] = 'yes'; // yes / no

$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
48
49
50
51
52
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete

53
54
55
56
57
$form["tabs"]['server'] = array(
	'title' => "Server",
	'width' => 70,
	'template' => "templates/server_config_server_edit.htm",
	'fields' => array(
58
59
60
		//#################################
		// Begin Datatable fields
		//#################################
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
		'auto_network_configuration' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
			'default' => 'n',
			'value' => array(0 => 'n', 1 => 'y')
		),
		'ip_address' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '192.168.0.105',
			'validators' => array(0 => array('type' => 'ISIPV4',
					'errmsg' => 'ip_address_error_wrong'),
			),
			'value' => '',
			'width' => '15',
			'maxlength' => '255'
		),
		'netmask' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '255.255.255.0',
			'validators' => array(0 => array('type' => 'ISIPV4',
					'errmsg' => 'netmask_error_wrong'),
			),
			'value' => '',
86
87
88
89
90
91
			'width' => '15',
			'maxlength' => '255'
		),
		'v6_prefix' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
92
93
94
95
96
97
			'validators' => array(  0 => array('type' => 'ISV6PREFIX',
						'errmsg' => 'v6_prefix_wrong'),
						1 => array('type' => 'V6PREFIXEND',
						'errmsg' => 'v6_prefix_end'),
						2 => array('type' => 'V6PREFIXLENGTH',
						'errmsg' => 'v6_prefix_length')
98
99
			),
			'default' => ''
100
101
102
103
		),
		'gateway' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
104
105
106
107
108
109
110
111
			'default' => '192.168.0.1',
			'validators' => array(0 => array('type' => 'ISIPV4',
					'errmsg' => 'gateway_error_wrong'),
			),
			'value' => '',
			'width' => '15',
			'maxlength' => '255'
		),
112
113
114
115
116
117
118
119
		'firewall' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'SELECT',
			'default' => 'bastille',
			'value' => array('bastille' => 'bastille', 'ufw' => 'ufw'),
			'width' => '40',
			'maxlength' => '255'
		),
120
121
122
123
		'hostname' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => 'server1.domain.tld',
124
			'filters'   => array( 0 => array( 'event' => 'SAVE',
125
126
127
128
129
130
					'type' => 'IDNTOASCII'),
				1 => array( 'event' => 'SHOW',
					'type' => 'IDNTOUTF8'),
				2 => array( 'event' => 'SAVE',
					'type' => 'TOLOWER')
			),
131
132
133
			'validators' => array(	0 => array('type' => 'NOTEMPTY',
												'errmsg' => 'hostname_error_empty'),
									1 => array ('type' => 'REGEX',
Jesse Norell's avatar
Jesse Norell committed
134
												'regex' => '/^[\w\.\-]{1,255}\.[a-zA-Z0-9\-]{2,63}$/',
135
												'errmsg'=> 'hostname_error_regex'),
136
137
138
139
140
141
142
143
144
145
146
147
			),
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
		'nameservers' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '192.168.0.1,192.168.0.2',
			'validators' => array(0 => array('type' => 'NOTEMPTY',
					'errmsg' => 'nameservers_error_empty'),
			),
Till Brehm's avatar
Till Brehm committed
148
149
150
151
152
153
			'filters'   => array(
					0 => array( 'event' => 'SAVE',
					'type' => 'STRIPTAGS'),
					1 => array( 'event' => 'SAVE',
					'type' => 'STRIPNL')
			),
154
155
156
157
158
159
160
161
162
163
164
165
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
		'loglevel' => array(
			'datatype' => 'INTEGER',
			'formtype' => 'SELECT',
			'default' => '2',
			'value' => array('0' => 'Debug', '1' => 'Warnings', '2' => 'Errors'),
			'width' => '40',
			'maxlength' => '255'
		),
166
167
168
169
170
171
172
173
		'admin_notify_events' => array(
			'datatype' => 'INTEGER',
			'formtype' => 'SELECT',
			'default' => '1',
			'value' => array('3' => 'no_notifications_txt', '0' => 'Debug', '1' => 'Warnings', '2' => 'Errors'),
			'width' => '40',
			'maxlength' => '255'
		),
174
175
176
177
		'backup_dir' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '/var/backup',
178
			'validators' => array(	0 => array ( 	'type' => 'REGEX',
Florian Schaal's avatar
Florian Schaal committed
179
										'regex' => "/(|^\\/{1,2}(?:[\\w-]+[.]?\\/?){5,128})$/",
180
										'errmsg'=> 'backup_dir_error_regex'),
181
182
183
184
			),
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
185
		),
186
187
188
189
190
191
192
		'backup_tmp' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '/tmp/',
			'validators' => array(	0 => array('type' => 'NOTEMPTY',
										'errmsg' => 'tmpdir_path_error_empty'),
									1 => array ( 	'type' => 'REGEX',
193
										'regex' => "/^\/[a-zA-Z0-9\.\-\_\/]{3,128}$/",
194
195
196
197
198
199
										'errmsg'=> 'tmpdir_path_error_regex'),
			),
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
200
201
202
		'backup_dir_is_mount' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
Marius Cramer's avatar
Marius Cramer committed
203
			'default' => 'y',
204
205
			'value' => array(0 => 'n', 1 => 'y')
		),
206
		'backup_mode' => array(
207
			'datatype' => 'VARCHAR',
208
209
			'formtype' => 'SELECT',
			'default' => 'userzip',
210
			'value' => array('userzip' => 'backup_mode_userzip', 'rootgz' => 'backup_mode_rootgz', 'borg' => 'backup_mode_borg_txt'),
211
212
			'width' => '40',
			'maxlength' => '255'
213
		),
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
		'backup_time' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'SELECT',
			'default' => '0:00',
			'value' => array(	'0:00' => '0:00h',
								'0:15' => '0:15h',
								'0:30' => '0:30h',
								'0:45' => '0:45h',
								'1:00' => '1:00h',
								'1:15' => '1:15h',
								'1:30' => '1:30h',
								'1:45' => '1:45h',
								'2:00' => '2:00h',
								'2:15' => '2:15h',
								'2:30' => '2:30h',
								'2:45' => '2:45h',
								'3:00' => '3:00h',
								'3:15' => '3:15h',
								'3:30' => '3:30h',
								'3:45' => '3:45h',
								'4:00' => '4:00h',
								'4:15' => '4:15h',
								'4:30' => '4:30h',
								'4:45' => '4:45h',
								'5:00' => '5:00h',
								'5:15' => '5:15h',
								'5:30' => '5:30h',
								'5:45' => '5:45h',
								'6:00' => '6:00h',
								'6:15' => '6:15h',
								'6:30' => '6:30h',
								'6:45' => '6:45h',
								'7:00' => '7:00h',
								'7:15' => '7:15h',
								'7:30' => '7:30h',
								'7:45' => '7:45h',
								'8:00' => '8:00h',
								'8:15' => '8:15h',
								'8:30' => '8:30h',
								'8:45' => '8:45h',
								'9:00' => '9:00h',
								'9:15' => '9:15h',
								'9:30' => '9:30h',
								'9:45' => '9:45h',
								'10:00' => '10:00h',
								'10:15' => '10:15h',
								'10:30' => '10:30h',
								'10:45' => '10:45h',
								'11:00' => '11:00h',
								'11:15' => '11:15h',
								'11:30' => '11:30h',
								'11:45' => '11:45h',
								'12:00' => '12:00h',
								'12:15' => '12:15h',
								'12:30' => '12:30h',
								'12:45' => '12:45h',
								'13:00' => '13:00h',
								'13:15' => '13:15h',
								'13:30' => '13:30h',
								'13:45' => '13:45h',
								'14:00' => '14:00h',
								'14:15' => '14:15h',
								'14:30' => '14:30h',
								'14:45' => '14:45h',
								'15:00' => '15:00h',
								'15:15' => '15:15h',
								'15:30' => '15:30h',
								'15:45' => '15:45h',
								'16:00' => '16:00h',
								'16:15' => '16:15h',
								'16:30' => '16:30h',
								'16:45' => '16:45h',
								'17:00' => '17:00h',
								'17:15' => '17:15h',
								'17:30' => '17:30h',
								'17:45' => '17:45h',
								'18:00' => '18:00h',
								'18:15' => '18:15h',
								'18:30' => '18:30h',
								'18:45' => '18:45h',
								'19:00' => '19:00h',
								'19:15' => '19:15h',
								'19:30' => '19:30h',
								'19:45' => '19:45h',
								'20:00' => '20:00h',
								'20:15' => '20:15h',
								'20:30' => '20:30h',
								'20:45' => '20:45h',
								'21:00' => '21:00h',
								'21:15' => '21:15h',
								'21:30' => '21:30h',
								'21:45' => '21:45h',
								'22:00' => '22:00h',
								'22:15' => '22:15h',
								'22:30' => '22:30h',
								'22:45' => '22:45h',
								'23:00' => '23:00h',
								'23:15' => '23:15h',
								'23:30' => '23:30h',
								'23:45' => '23:45h',
								),
			'width' => '40',
			'maxlength' => '255'
		),
318
319
320
321
322
323
		'backup_delete' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
			'default' => 'y',
			'value' => array(0 => 'n', 1 => 'y')
		),
324
325
326
327
		'monit_url' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '',
328
329
330
331
			'validators' => array ( 0 => array ( 'type' => 'REGEX',
					'regex' => '/^[0-9a-zA-Z\:\/\-\.\[\]]{0,255}$/',
					'errmsg'=> 'monit_url_error_regex'),
			),
332
333
334
335
336
337
338
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
		'monit_user' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
Till Brehm's avatar
Till Brehm committed
339
340
341
342
343
344
			'filters'   => array(
					0 => array( 'event' => 'SAVE',
					'type' => 'STRIPTAGS'),
					1 => array( 'event' => 'SAVE',
					'type' => 'STRIPNL')
			),
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
			'default' => '',
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
		'monit_password' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '',
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
		'munin_url' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '',
362
363
364
365
			'validators' => array ( 0 => array ( 'type' => 'REGEX',
					'regex' => '/^[0-9a-zA-Z\:\/\-\.\[\]]{0,255}$/',
					'errmsg'=> 'munin_url_error_regex'),
			),
366
367
368
369
370
371
372
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
		'munin_user' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
Till Brehm's avatar
Till Brehm committed
373
374
375
376
377
378
			'filters'   => array(
					0 => array( 'event' => 'SAVE',
					'type' => 'STRIPTAGS'),
					1 => array( 'event' => 'SAVE',
					'type' => 'STRIPNL')
			),
379
380
381
382
383
384
385
386
387
388
389
390
391
			'default' => '',
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
		'munin_password' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '',
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
392
393
394
395
396
397
		'monitor_system_updates' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
			'default' => 'y',
			'value' => array(0 => 'n', 1 => 'y')
		),
398
399
400
401
402
403
404
405
406
407
408
		'log_retention' => array (
			'datatype' => 'INTEGER',
			'formtype' => 'TEXT',
			'validators' => array (  0 => array ( 'type' => 'ISPOSITIVE',
				'errmsg'=> 'log_retention_error_ispositive'),
			),
			'default' => '30',
			'value' => '',
			'width' => '4',
			'maxlength' => '4'
		),
409
410
411
412
413
414
		'migration_mode' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
			'default' => 'n',
			'value' => array(0 => 'n', 1 => 'y')
		),
415
		//#################################
Helmo's avatar
Helmo committed
416
		// END Datatable fields
417
		//#################################
418
419
420
	)
);

421
422
423
424
425
$form["tabs"]['mail'] = array(
	'title' => "Mail",
	'width' => 60,
	'template' => "templates/server_config_mail_edit.htm",
	'fields' => array(
426
427
428
		//#################################
		// Begin Datatable fields
		//#################################
429
430
431
432
433
434
435
436
437
438
		'module' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'SELECT',
			'default' => '',
			'value' => array('postfix_mysql' => 'postfix_mysql')
		),
		'maildir_path' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '/home/vmail/[domain]/[localpart]/',
439
440
441
442
443
			'validators' => array(	0 => array('type' => 'NOTEMPTY',
										'errmsg' => 'maildir_path_error_empty'),
									1 => array ( 	'type' => 'REGEX',
										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/\[\]]{5,128}$/',
										'errmsg'=> 'maildir_path_error_regex'),
444
445
446
447
448
			),
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
449
450
451
452
453
454
		'maildir_format' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'SELECT',
			'default' => '20',
			'value' => array('maildir' => 'Maildir', 'mdbox' => 'mdbox')
		),
455
456
457
458
		'homedir_path' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '/home/vmail/',
459
460
461
462
463
464
465
			'validators' => array(	0 => array ( 'type' => 'NOTEMPTY',
						           'errmsg' => 'homedir_path_error_empty'
						    ),
						1 => array ( 'type' => 'REGEX',
						            'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
							    'errmsg'=> 'homedir_path_error_regex'
						    ),
466
467
468
469
470
			),
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
Marius Burkard's avatar
Marius Burkard committed
471
472
473
474
475
476
477
478
479
480
481
482
483
		'content_filter' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'SELECT',
			'default' => 'rspamd',
			'value' => array('amavisd' => 'Amavisd', 'rspamd' => 'Rspamd')
		),
		'rspamd_password' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '',
			'value' => '',
			'width' => '40',
			'maxlength' => '255',
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
			'filters'   => array(
					0 => array( 'event' => 'SAVE',
						'type' => 'TRIM'),
			),
		),
		'rspamd_redis_servers' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '127.0.0.1',
			'value' => '',
			'width' => '40',
			'maxlength' => '255',
			'filters'   => array(
					0 => array( 'event' => 'SAVE',
						'type' => 'TRIM'),
			),
		),
		'rspamd_redis_password' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '',
			'value' => '',
			'width' => '40',
			'maxlength' => '255',
			'filters'   => array(
					0 => array( 'event' => 'SAVE',
						'type' => 'TRIM'),
			),
		),
		'rspamd_redis_bayes_servers' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '127.0.0.1',
			'value' => '',
			'width' => '40',
			'maxlength' => '255',
			'filters'   => array(
					0 => array( 'event' => 'SAVE',
						'type' => 'TRIM'),
			),
		),
		'rspamd_redis_bayes_password' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '',
			'value' => '',
			'width' => '40',
			'maxlength' => '255',
			'filters'   => array(
					0 => array( 'event' => 'SAVE',
						'type' => 'TRIM'),
Marius Burkard's avatar
Marius Burkard committed
535
536
537
538
539
540
541
542
			),
		),
		'rspamd_available' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
			'default' => 'n',
			'value' => array(0 => 'n', 1 => 'y')
		),
543
544
545
		'dkim_path' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
Till Brehm's avatar
Till Brehm committed
546
547
548
549
550
551
			'filters'   => array(
					0 => array( 'event' => 'SAVE',
					'type' => 'STRIPTAGS'),
					1 => array( 'event' => 'SAVE',
					'type' => 'STRIPNL')
			),
552
553
554
555
556
			'default' => '/var/lib/amavis/dkim',
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
557
558
559
		'dkim_strength' => array(
			'datatype' => 'INTEGER',
			'formtype' => 'SELECT',
560
			'default' => '2048',
Marius Cramer's avatar
Marius Cramer committed
561
			'value' => array('1024' => 'weak (1024)', '2048' => 'normal (2048)', '4096' => 'strong (4096)')
562
		),
563
564
565
566
567
568
569
570
571
        'relayhost_password' => array(
            'datatype' => 'VARCHAR',
            'formtype' => 'TEXT',
            'default' => '',
            'value' => '',
            'width' => '40',
            'maxlength' => '255'
        ),

572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
		'pop3_imap_daemon' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'SELECT',
			'default' => '20',
			'value' => array('courier' => 'Courier', 'dovecot' => 'Dovecot')
		),
		'mail_filter_syntax' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'SELECT',
			'default' => '20',
			'value' => array('maildrop' => 'Maildrop', 'sieve' => 'Sieve')
		),
		'mailuser_uid' => array(
			'datatype' => 'INTEGER',
			'formtype' => 'TEXT',
			'default' => '5000',
588
589
590
591
592
			'validators' => array(	0 => array('type' => 'NOTEMPTY',
										'errmsg' => 'mailuser_uid_error_empty'),
									1 => array('type' => 'RANGE',
										'range' => '1999:',
										'errmsg' => 'mailuser_uid_error_range'),
593
594
595
596
597
598
599
600
601
			),
			'value' => '',
			'width' => '10',
			'maxlength' => '255'
		),
		'mailuser_gid' => array(
			'datatype' => 'INTEGER',
			'formtype' => 'TEXT',
			'default' => '5000',
602
603
604
605
606
			'validators' => array(	0 => array('type' => 'NOTEMPTY',
										'errmsg' => 'mailuser_gid_error_empty'),
									1 => array('type' => 'RANGE',
										'range' => '1999:',
										'errmsg' => 'mailuser_gid_error_range'),
607
608
609
610
611
612
613
614
615
			),
			'value' => '',
			'width' => '10',
			'maxlength' => '255'
		),
		'mailuser_name' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => 'vmail',
616
617
618
619
620
			'validators' => array(	0 => array('type' => 'NOTEMPTY',
										'errmsg' => 'mailuser_name_error_empty'),
									1 => array ( 	'type' => 'REGEX',
										'regex' => '/^(?!ispconfig|root)([a-zA-Z0-9]{1,20})$/',
										'errmsg'=> 'mailuser_name_error_regex'),
621
622
623
624
625
626
627
628
629
			),
			'value' => '',
			'width' => '10',
			'maxlength' => '255'
		),
		'mailuser_group' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => 'vmail',
630
631
632
633
634
			'validators' => array(	0 => array('type' => 'NOTEMPTY',
										'errmsg' => 'mailuser_group_error_empty'),
									1 => array ( 	'type' => 'REGEX',
										'regex' => '/^(?!ispconfig|root)([a-zA-Z0-9]{1,20})$/',
										'errmsg'=> 'mailuser_group_name_error_regex'),
635
636
637
638
639
			),
			'value' => '',
			'width' => '10',
			'maxlength' => '255'
		),
640
		'mailbox_virtual_uidgid_maps' => array(
Dominik's avatar
Dominik committed
641
642
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
643
644
645
646
			'validators' => array (0 => array ( 'type' => 'CUSTOM',
					'class' => 'validate_server_mail_config',
					'function' => 'mailbox_virtual_uidgid_maps'),
			),
Dominik's avatar
Dominik committed
647
648
			'default' => 'n',
			'value' => array(0 => 'n', 1 => 'y')
649
		),
650
651
652
		'relayhost' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
Till Brehm's avatar
Till Brehm committed
653
654
655
656
657
658
			'filters'   => array(
					0 => array( 'event' => 'SAVE',
					'type' => 'STRIPTAGS'),
					1 => array( 'event' => 'SAVE',
					'type' => 'STRIPNL')
			),
659
660
661
662
663
664
665
666
			'default' => '',
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
		'relayhost_user' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
Till Brehm's avatar
Till Brehm committed
667
668
669
670
671
672
			'filters'   => array(
					0 => array( 'event' => 'SAVE',
					'type' => 'STRIPTAGS'),
					1 => array( 'event' => 'SAVE',
					'type' => 'STRIPNL')
			),
673
674
675
676
677
678
679
680
681
682
683
684
685
			'default' => '',
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
		'relayhost_password' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '',
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
686
687
688
689
690
691
		'reject_sender_login_mismatch' => array (
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
			'default' => 'n',
			'value' => array(0 => 'n', 1 => 'y')
		),
692
693
694
695
696
697
698
699
700
701
702
		'reject_unknown' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'SELECT',
			'default' => 'helo',
			'value' => array(
				'helo' => 'reject_unknown_helo_txt',
				'client' => 'reject_unknown_client_txt',
				'client_helo' => 'reject_unknown_client_helo_txt',
				'none' => 'disabled_txt',
			)
		),
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
		'mailbox_size_limit' => array(
			'datatype' => 'INTEGER',
			'formtype' => 'TEXT',
			'default' => '0',
			'value' => '',
			'width' => '10',
			'maxlength' => '15'
		),
		'message_size_limit' => array(
			'datatype' => 'INTEGER',
			'formtype' => 'TEXT',
			'default' => '0',
			'value' => '',
			'width' => '10',
			'maxlength' => '15'
718
		),
marknl's avatar
marknl committed
719
720
721
722
		'realtime_blackhole_list' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '',
723
724
725
726
			'validators' => array (  0 => array ( 'type' => 'REGEX',
					'regex' => '/^((([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])(,\s*(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9]))*)?$/',
					'errmsg'=> 'rbl_error_regex'),
			),
marknl's avatar
marknl committed
727
			'value' => '',
728
729
730
			'width' => '40',
			'maxlength' => '255'
		),
731
732
733
734
735
736
		'stress_adaptive' => array (
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
			'default' => 'y',
			'value' => array(0 => 'n', 1 => 'y')
		),
Helmo's avatar
Helmo committed
737
		'mailbox_soft_delete' => array (
Helmo's avatar
Helmo committed
738
739
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
740
			'default' => 'n',
Helmo's avatar
Helmo committed
741
742
			'value' => array(0 => 'n', 1 => 'y')
		),
743
744
745
746
747
748
		'mailbox_quota_stats' => array (
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
			'default' => 'y',
			'value' => array(0 => 'n', 1 => 'y')
		),
749
750
751
752
753
754
755
756
757
758
759
760
		'overquota_notify_threshold' => array(
			'datatype' => 'INTEGER',
			'formtype' => 'TEXT',
			'default' => '90',
			'validators' => array(
				0 => array('type' => 'NOTEMPTY', 'errmsg' => 'overquota_notify_threshold_error'),
				1 => array('type' => 'RANGE',	'range' => '0:100',	'errmsg' => 'overquota_notify_threshold_error'),
			),
			'value' => '',
			'width' => '20',
			'maxlength' => '3'
		),
761
		'overquota_notify_admin' => array(
762
			'datatype' => 'VARCHAR',
763
764
765
766
			'formtype' => 'CHECKBOX',
			'default' => 'y',
			'value' => array(0 => 'n', 1 => 'y')
		),
767
768
769
770
771
772
		'overquota_notify_reseller' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
			'default' => 'y',
			'value' => array(0 => 'n', 1 => 'y')
		),
773
774
775
776
777
778
779
780
		'overquota_notify_client' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
			'default' => 'y',
			'value' => array(0 => 'n', 1 => 'y')
		),
		'overquota_notify_freq' => array(
			'datatype' => 'INTEGER',
781
			'formtype' => 'TEXT',
782
			'default' => '7',
783
			'value' => '',
784
785
			'width' => '20',
			'maxlength' => '255'
786
787
788
789
790
791
		),
		'overquota_notify_onok' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
			'default' => 'n',
			'value' => array(0 => 'n', 1 => 'y')
marknl's avatar
marknl committed
792
		),
793
794
795
796
797
798
		'rspamd_url' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '',
			'filters'   => array(
				0 => array( 'event' => 'SAVE', 'type' => 'IDNTOASCII'),
799
				1 => array( 'event' => 'SHOW', 'type' => 'IDNTOUTF8')
800
801
802
803
804
			),
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
805
		//#################################
Helmo's avatar
Helmo committed
806
		// END Datatable fields
807
		//#################################
808
809
810
	)
);

811
812
813
814
815
$form["tabs"]['getmail'] = array(
	'title' => "Getmail",
	'width' => 80,
	'template' => "templates/server_config_getmail_edit.htm",
	'fields' => array(
816
817
818
		//#################################
		// Begin Datatable fields
		//#################################
819
820
821
822
		'getmail_config_dir' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '',
823
824
825
826
827
			'validators' => array(	0 => array('type' => 'NOTEMPTY',
										'errmsg' => 'getmail_config_dir_error_empty'),
									1 => array ( 	'type' => 'REGEX',
										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
										'errmsg'=> 'getmail_config_dir_error_regex'),
828
829
830
831
			),
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
832
		),
833
		//#################################
Helmo's avatar
Helmo committed
834
		// END Datatable fields
835
		//#################################
836
837
838
	)
);

839
840
841
842
843
$form["tabs"]['web'] = array(
	'title' => "Web",
	'width' => 60,
	'template' => "templates/server_config_web_edit.htm",
	'fields' => array(
844
845
846
		//#################################
		// Begin Datatable fields
		//#################################
Falko Timme's avatar
Falko Timme committed
847
848
849
850
		'server_type' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'SELECT',
			'default' => 'apache',
851
			'value' => array('apache' => 'Apache', 'nginx' => 'Nginx')
Falko Timme's avatar
Falko Timme committed
852
		),
853
854
855
856
		'website_basedir' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '',
857
858
859
860
861
			'validators' => array(	0 => array('type' => 'NOTEMPTY',
										'errmsg' => 'website_basedir_error_empty'),
									1 => array ( 	'type' => 'REGEX',
										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
										'errmsg'=> 'website_basedir_error_regex'),
862
863
864
865
866
867
868
869
870
			),
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
		'website_path' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '',
871
872
873
874
875
			'validators' => array(	0 => array(	'type' => 'NOTEMPTY',
										'errmsg' => 'website_path_error_empty'),
									1 => array ( 	'type' => 'REGEX',
										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/\[\]]{5,128}$/',
										'errmsg'=> 'website_path_error_regex'),
876
877
878
879
880
881
882
883
884
			),
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
		'website_symlinks' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '',
885
886
887
888
889
			'validators' => array(	0 => array('type' => 'NOTEMPTY',
										'errmsg' => 'website_symlinks_error_empty'),
									1 => array ( 	'type' => 'REGEX',
										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/\[\]\:]{5,128}$/',
										'errmsg'=> 'website_symlinks_error_regex'),
890
891
892
893
894
			),
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
895
896
897
898
		'website_symlinks_rel' => array (
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
			'default' => 'n',
899
			'value' => array(0 => 'n', 1 => 'y')
900
		),
901
902
903
904
905
906
		'network_filesystem' => array (
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
			'default' => 'n',
			'value' => array(0 => 'n', 1 => 'y')
		),
907
908
909
		'website_autoalias' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
Till Brehm's avatar
Till Brehm committed
910
911
912
913
914
915
			'filters'   => array(
					0 => array( 'event' => 'SAVE',
					'type' => 'STRIPTAGS'),
					1 => array( 'event' => 'SAVE',
					'type' => 'STRIPNL')
			),
916
917
			'default' => '',
			'value' => '',
918
919
920
			'width' => '40',
			'maxlength' => '255'
		),
921
922
923
924
925
926
		'vhost_rewrite_v6' => array (
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
			'default' => 'n',
			'value' => array(0 => 'n',1 => 'y')
		),
Jason's avatar
Jason committed
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
		'vhost_proxy_protocol_enabled' => array (
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
			'default' => 'n',
			'value' => array(0 => 'n',1 => 'y')
		),
		'vhost_proxy_protocol_http_port' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '880',
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
		'vhost_proxy_protocol_https_port' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '8443',
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
949
950
951
		'vhost_conf_dir' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
952
			'default' => '',
953
954
955
956
957
			'validators' => array(	0 => array('type' => 'NOTEMPTY',
										'errmsg' => 'vhost_conf_dir_error_empty'),
									1 => array ( 	'type' => 'REGEX',
										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
										'errmsg'=> 'vhost_conf_dir_error_regex'),
958
959
960
961
962
963
964
965
966
			),
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
		'vhost_conf_enabled_dir' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '',
967
968
969
970
971
			'validators' => array(	0 => array('type' => 'NOTEMPTY',
										'errmsg' => 'vhost_conf_enabled_dir_error_empty'),
									1 => array ( 	'type' => 'REGEX',
										'regex' => '/^\/[a-zA-Z0-9\.\-\_\/]{5,128}$/',
										'errmsg'=> 'vhost_conf_enabled_dir_error_regex'),
972
973
974
975
976
			),
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
977
978
979
980
		'apache_init_script' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '',
981
982
983
984
			'validators' => array(	0 => array('type' => 'REGEX',
										'regex' => '/^(|[a-zA-Z0-9\.\-\_]{1,128})$/',
										'errmsg' => 'apache_init_script_error_regex'),
			),
985
986
987
988
			'value' => '',
			'width' => '40',
			'maxlength' => '255'
		),
989
990
991
992
993
994
		'nginx_enable_pagespeed' => array (
			'datatype' => 'VARCHAR',
			'formtype' => 'CHECKBOX',
			'default' => 'n',
			'value' => array(0 => 'n',1 => 'y')
		),
Falko Timme's avatar
Falko Timme committed
995
996
997
998
		'nginx_vhost_conf_dir' => array(
			'datatype' => 'VARCHAR',
			'formtype' => 'TEXT',
			'default' => '',
999
1000
			'validators' => array(	0 => array('type' => 'NOTEMPTY',
										'errmsg' => 'nginx_vhost_conf_dir_error_empty'),
For faster browsing, not all history is shown. View entire blame