tbrehm
2013-02-22 526b997c9891a796b152cdbab8e329b356b1f596
commit | author | age
532ae5 1 <?php
L 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).
32
33
34 */
35
36 $form["title"]             = "Client-Templates";
37 $form["description"]     = "";
38 $form["name"]             = "client_template";
39 $form["action"]            = "client_template_edit.php";
40 $form["db_table"]        = "client_template";
41 $form["db_table_idx"]    = "template_id";
42 $form["db_history"]        = "no";
43 $form["tab_default"]    = "template";
44 $form["list_default"]    = "client_template_list.php";
45 $form["auth"]            = 'yes';
46
47 $form["auth_preset"]["userid"]  = 0; // 0 = id of the user, > 0 id must match with id of current user
48 $form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
49 $form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
50 $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
51 $form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
52
53 //* Languages
54 $language_list = array();
55 $handle = @opendir(ISPC_ROOT_PATH.'/lib/lang');
56 while ($file = @readdir ($handle)) {
57     if ($file != '.' && $file != '..') {
58         if(@is_file(ISPC_ROOT_PATH.'/lib/lang/'.$file) and substr($file,-4,4) == '.lng') {
59             $tmp = substr($file, 0, 2);
60             $language_list[$tmp] = $tmp;
61         }
62     }
63 }
64
65 $form["tabs"]['template'] = array (
66     'title'     => "Template",
67     'width'     => 80,
68     'template'     => "templates/client_template_edit_template.htm",
69     'fields'     => array (
70     ##################################
71     # Begin Datatable fields
72     ##################################
73         'template_type' => array (
74             'datatype'    => 'VARCHAR',
75             'formtype'    => 'SELECT',
76             'default'    => 'm',
77             'value'        => array('m' => "Main Template",'a' => "Additional Template"),
78         ),
79         'template_name' => array (
80             'datatype'    => 'VARCHAR',
81             'formtype'    => 'TEXT',
82             'validators'    => array (     0 => array (    'type'    => 'NOTEMPTY',
83                                                         'errmsg'=> 'error_template_name_empty'),
84                                         ),
85             'default'    => '',
86             'value'        => '',
87             'width'        => '30',
88             'maxlength'    => '255'
89         ),
90     ##################################
91     # END Datatable fields
92     ##################################
93     )
94 );
95
96 $form["tabs"]['limits'] = array (
97     'title'     => "Limits",
98     'width'     => 80,
99     'template'     => "templates/client_template_edit_limits.htm",
100     'fields'     => array (
101     ##################################
102     # Begin Datatable fields
103     ##################################
104         'limit_maildomain' => array (
105             'datatype'    => 'INTEGER',
106             'formtype'    => 'TEXT',
107             'validators'    => array (     0 => array (    'type'    => 'ISINT',
108                                                         'errmsg'=> 'limit_maildomain_error_notint'),
109                                     ),
110             'default'    => '0',
111             'value'        => '',
112             'separator'    => '',
113             'width'        => '10',
114             'maxlength'    => '10',
115             'rows'        => '',
116             'cols'        => ''
117         ),
118         'limit_mailbox' => array (
119             'datatype'    => 'INTEGER',
120             'formtype'    => 'TEXT',
121             'validators'    => array (     0 => array (    'type'    => 'ISINT',
122                                                         'errmsg'=> 'limit_mailbox_error_notint'),
123                                     ),
124             'default'    => '0',
125             'value'        => '',
126             'separator'    => '',
127             'width'        => '10',
128             'maxlength'    => '10',
129             'rows'        => '',
130             'cols'        => ''
131         ),
132         'limit_mailalias' => array (
133             'datatype'    => 'INTEGER',
134             'formtype'    => 'TEXT',
135             'validators'    => array (     0 => array (    'type'    => 'ISINT',
136                                                         'errmsg'=> 'limit_mailalias_error_notint'),
137                                     ),
138             'default'    => '0',
139             'value'        => '',
140             'separator'    => '',
141             'width'        => '10',
142             'maxlength'    => '10',
143             'rows'        => '',
144             'cols'        => ''
145         ),
146         'limit_mailaliasdomain' => array (
147             'datatype'    => 'INTEGER',
148             'formtype'    => 'TEXT',
149             'validators'    => array (     0 => array (    'type'    => 'ISINT',
150                                                         'errmsg'=> 'limit_mailaliasdomain_error_notint'),
151                                     ),
152             'default'    => '-1',
153             'value'        => '',
154             'separator'    => '',
155             'width'        => '10',
156             'maxlength'    => '10',
157             'rows'        => '',
158             'cols'        => ''
159         ),
160         'limit_mailmailinglist' => array (
161             'datatype'    => 'INTEGER',
162             'formtype'    => 'TEXT',
163             'validators'    => array (     0 => array (    'type'    => 'ISINT',
164                                                         'errmsg'=> 'limit_mailmailinglist_error_notint'),
165                                     ),
166             'default'    => '-1',
167             'value'        => '',
168             'separator'    => '',
169             'width'        => '10',
170             'maxlength'    => '10',
171             'rows'        => '',
172             'cols'        => ''
173         ),
174         'limit_mailforward' => array (
175             'datatype'    => 'INTEGER',
176             'formtype'    => 'TEXT',
177             'validators'    => array (     0 => array (    'type'    => 'ISINT',
178                                                         'errmsg'=> 'limit_mailforward_error_notint'),
179                                     ),
180             'default'    => '0',
181             'value'        => '',
182             'separator'    => '',
183             'width'        => '10',
184             'maxlength'    => '10',
185             'rows'        => '',
186             'cols'        => ''
187         ),
188         'limit_mailcatchall' => array (
189             'datatype'    => 'INTEGER',
190             'formtype'    => 'TEXT',
191             'validators'    => array (     0 => array (    'type'    => 'ISINT',
192                                                         'errmsg'=> 'limit_mailcatchall_error_notint'),
193                                     ),
194             'default'    => '0',
195             'value'        => '',
196             'separator'    => '',
197             'width'        => '10',
198             'maxlength'    => '10',
199             'rows'        => '',
200             'cols'        => ''
201         ),
202         'limit_mailrouting' => array (
203             'datatype'    => 'INTEGER',
204             'formtype'    => 'TEXT',
205             'validators'    => array (     0 => array (    'type'    => 'ISINT',
206                                                         'errmsg'=> 'limit_mailrouting_error_notint'),
207                                     ),
208             'default'    => '0',
209             'value'        => '',
210             'separator'    => '',
211             'width'        => '10',
212             'maxlength'    => '10',
213             'rows'        => '',
214             'cols'        => ''
215         ),
216         'limit_mailfilter' => array (
217             'datatype'    => 'INTEGER',
218             'formtype'    => 'TEXT',
219             'validators'    => array (     0 => array (    'type'    => 'ISINT',
220                                                         'errmsg'=> 'limit_mailfilter_error_notint'),
221                                     ),
222             'default'    => '0',
223             'value'        => '',
224             'separator'    => '',
225             'width'        => '10',
226             'maxlength'    => '10',
227             'rows'        => '',
228             'cols'        => ''
229         ),
230         'limit_fetchmail' => array (
231             'datatype'    => 'INTEGER',
232             'formtype'    => 'TEXT',
233             'validators'    => array (     0 => array (    'type'    => 'ISINT',
234                                                         'errmsg'=> 'limit_mailfetchmail_error_notint'),
235                                     ),
236             'default'    => '0',
237             'value'        => '',
238             'separator'    => '',
239             'width'        => '10',
240             'maxlength'    => '10',
241             'rows'        => '',
242             'cols'        => ''
243         ),
244         'limit_mailquota' => array (
245             'datatype'    => 'INTEGER',
246             'formtype'    => 'TEXT',
247             'validators'    => array (     0 => array (    'type'    => 'ISINT',
248                                                         'errmsg'=> 'limit_mailquota_error_notint'),
249                                     ),
250             'default'    => '0',
251             'value'        => '',
252             'separator'    => '',
253             'width'        => '10',
254             'maxlength'    => '10',
255             'rows'        => '',
256             'cols'        => ''
257         ),
258         'limit_spamfilter_wblist' => array (
259             'datatype'    => 'INTEGER',
260             'formtype'    => 'TEXT',
261             'validators'    => array (     0 => array (    'type'    => 'ISINT',
262                                                         'errmsg'=> 'limit_spamfilter_wblist_error_notint'),
263                                     ),
264             'default'    => '0',
265             'value'        => '',
266             'separator'    => '',
267             'width'        => '10',
268             'maxlength'    => '10',
269             'rows'        => '',
270             'cols'        => ''
271         ),
272         'limit_spamfilter_user' => array (
273             'datatype'    => 'INTEGER',
274             'formtype'    => 'TEXT',
275             'validators'    => array (     0 => array (    'type'    => 'ISINT',
276                                                         'errmsg'=> 'limit_spamfilter_user_error_notint'),
277                                     ),
278             'default'    => '0',
279             'value'        => '',
280             'separator'    => '',
281             'width'        => '10',
282             'maxlength'    => '10',
283             'rows'        => '',
284             'cols'        => ''
285         ),
286         'limit_spamfilter_policy' => array (
287             'datatype'    => 'INTEGER',
288             'formtype'    => 'TEXT',
289             'validators'    => array (     0 => array (    'type'    => 'ISINT',
290                                                         'errmsg'=> 'limit_spamfilter_policy_error_notint'),
291                                     ),
292             'default'    => '0',
293             'value'        => '',
294             'separator'    => '',
295             'width'        => '10',
296             'maxlength'    => '10',
297             'rows'        => '',
298             'cols'        => ''
299         ),
300         'limit_web_domain' => array (
301             'datatype'    => 'INTEGER',
302             'formtype'    => 'TEXT',
303             'validators'    => array (     0 => array (    'type'    => 'ISINT',
304                                                         'errmsg'=> 'limit_web_domain_error_notint'),
305                                     ),
306             'default'    => '0',
307             'value'        => '',
308             'separator'    => '',
309             'width'        => '10',
310             'maxlength'    => '10',
311             'rows'        => '',
312             'cols'        => ''
313         ),
314         'limit_web_quota' => array (
315             'datatype'    => 'INTEGER',
316             'formtype'    => 'TEXT',
317             'validators'    => array (     0 => array (    'type'    => 'ISINT',
318                                                         'errmsg'=> 'limit_web_quota_error_notint'),
319                                     ),
320             'default'    => '-1',
321             'value'        => '',
322             'separator'    => '',
323             'width'        => '10',
324             'maxlength'    => '10',
325             'rows'        => '',
326             'cols'        => ''
327         ),
b2ea52 328         'web_php_options' => array (
T 329             'datatype'    => 'VARCHAR',
330             'formtype'    => 'CHECKBOXARRAY',
331             'default'    => '',
332             'separator' => ',',
333             'valuelimit' => 'client:web_php_options',
c56ca0 334             'value'        => array('no' => 'Disabled', 'fast-cgi' => 'Fast-CGI', 'cgi' => 'CGI', 'mod' => 'Mod-PHP', 'suphp' => 'SuPHP', 'php-fpm' => 'PHP-FPM')
b2ea52 335         ),
ac099e 336         'limit_cgi' => array (
M 337             'datatype'    => 'VARCHAR',
338             'formtype'    => 'CHECKBOX',
339             'default'    => 'n',
340             'value'        => array(0 => 'n',1 => 'y')
341         ),
342         'limit_ssi' => array (
343             'datatype'    => 'VARCHAR',
344             'formtype'    => 'CHECKBOX',
345             'default'    => 'n',
346             'value'        => array(0 => 'n',1 => 'y')
347         ),
348         'limit_perl' => array (
349             'datatype'    => 'VARCHAR',
350             'formtype'    => 'CHECKBOX',
351             'default'    => 'n',
352             'value'        => array(0 => 'n',1 => 'y')
353         ),
354         'limit_ruby' => array (
355             'datatype'    => 'VARCHAR',
356             'formtype'    => 'CHECKBOX',
357             'default'    => 'n',
358             'value'        => array(0 => 'n',1 => 'y')
359         ),
360         'limit_python' => array (
361             'datatype'    => 'VARCHAR',
362             'formtype'    => 'CHECKBOX',
363             'default'    => 'n',
364             'value'        => array(0 => 'n',1 => 'y')
365         ),
366         'force_suexec' => array (
367             'datatype'    => 'VARCHAR',
368             'formtype'    => 'CHECKBOX',
369             'default'    => 'y',
370             'value'        => array(0 => 'n',1 => 'y')
371         ),
372         'limit_hterror' => array (
373             'datatype'    => 'VARCHAR',
374             'formtype'    => 'CHECKBOX',
375             'default'    => 'n',
376             'value'        => array(0 => 'n',1 => 'y')
377         ),
378         'limit_wildcard' => array (
379             'datatype'    => 'VARCHAR',
380             'formtype'    => 'CHECKBOX',
381             'default'    => 'n',
382             'value'        => array(0 => 'n',1 => 'y')
383         ),
384         'limit_ssl' => array (
385             'datatype'    => 'VARCHAR',
386             'formtype'    => 'CHECKBOX',
387             'default'    => 'n',
388             'value'        => array(0 => 'n',1 => 'y')
389         ),
532ae5 390         'limit_web_aliasdomain' => array (
L 391             'datatype'    => 'INTEGER',
392             'formtype'    => 'TEXT',
393             'validators'    => array (     0 => array (    'type'    => 'ISINT',
394                                                         'errmsg'=> 'limit_web_aliasdomain_error_notint'),
395                                     ),
396             'default'    => '0',
397             'value'        => '',
398             'separator'    => '',
399             'width'        => '10',
400             'maxlength'    => '10',
401             'rows'        => '',
402             'cols'        => ''
403         ),
404         'limit_web_subdomain' => array (
405             'datatype'    => 'INTEGER',
406             'formtype'    => 'TEXT',
407             'validators'    => array (     0 => array (    'type'    => 'ISINT',
408                                                         'errmsg'=> 'limit_web_subdomain_error_notint'),
409                                     ),
410             'default'    => '0',
411             'value'        => '',
412             'separator'    => '',
413             'width'        => '10',
414             'maxlength'    => '10',
415             'rows'        => '',
416             'cols'        => ''
417         ),
418         'limit_ftp_user' => array (
419             'datatype'    => 'INTEGER',
420             'formtype'    => 'TEXT',
421             'validators'    => array (     0 => array (    'type'    => 'ISINT',
422                                                         'errmsg'=> 'limit_ftp_user_error_notint'),
423                                     ),
424             'default'    => '0',
425             'value'        => '',
426             'separator'    => '',
427             'width'        => '10',
428             'maxlength'    => '10',
429             'rows'        => '',
430             'cols'        => ''
431         ),
432         'limit_shell_user' => array (
433             'datatype'    => 'INTEGER',
434             'formtype'    => 'TEXT',
435             'validators'    => array (     0 => array (    'type'    => 'ISINT',
436                                                         'errmsg'=> 'limit_shell_user_error_notint'),
437                                     ),
438             'default'    => '0',
439             'value'        => '',
440             'separator'    => '',
441             'width'        => '10',
442             'maxlength'    => '10',
443             'rows'        => '',
444             'cols'        => ''
445         ),
b2ea52 446         'ssh_chroot' => array (
T 447             'datatype'    => 'VARCHAR',
448             'formtype'    => 'CHECKBOXARRAY',
5c67f7 449             'validators'    => array (
X 450               0 => array (
451                 'type'=> 'NOTEMPTY',
452                 'errmsg'=> 'ssh_chroot_notempty'
453               ),
454             ),
b2ea52 455             'default'    => '',
T 456             'separator' => ',',
457             'valuelimit' => 'client:ssh_chroot',
458             'value'        => array('no' => 'None', 'jailkit' => 'Jailkit')
459         ),
532ae5 460         'limit_webdav_user' => array (
L 461             'datatype'    => 'INTEGER',
462             'formtype'    => 'TEXT',
463             'validators'    => array (     0 => array (    'type'    => 'ISINT',
464                                                         'errmsg'=> 'limit_webdav_user_error_notint'),
465                                     ),
466             'default'    => '0',
467             'value'        => '',
468             'separator'    => '',
469             'width'        => '10',
470             'maxlength'    => '10',
471             'rows'        => '',
472             'cols'        => ''
473         ),
474         'limit_dns_zone' => array (
475             'datatype'    => 'INTEGER',
476             'formtype'    => 'TEXT',
477             'validators'    => array (     0 => array (    'type'    => 'ISINT',
478                                                         'errmsg'=> 'limit_dns_zone_error_notint'),
479                                     ),
480             'default'    => '0',
481             'value'        => '',
482             'separator'    => '',
483             'width'        => '10',
484             'maxlength'    => '10',
485             'rows'        => '',
486             'cols'        => ''
487         ),
488                 'limit_dns_slave_zone' => array (
489                         'datatype'      => 'INTEGER',
490                         'formtype'      => 'TEXT',
491                         'validators'    => array (      0 => array (    'type'  => 'ISINT',
492                                                                                                                 'errmsg'=> 'limit_dns_slave_zone_error_notint'),
493                                                                         ),
494                         'default'       => '0',
495                         'value'         => '',
496                         'separator'     => '',
497                         'width'         => '10',
498                         'maxlength'     => '10',
499                         'rows'          => '',
500                         'cols'          => ''
501                 ),
502         'limit_dns_record' => array (
503             'datatype'    => 'INTEGER',
504             'formtype'    => 'TEXT',
505             'validators'    => array (     0 => array (    'type'    => 'ISINT',
506                                                         'errmsg'=> 'limit_dns_record_error_notint'),
507                                     ),
508             'default'    => '0',
509             'value'        => '',
510             'separator'    => '',
511             'width'        => '10',
512             'maxlength'    => '10',
513             'rows'        => '',
514             'cols'        => ''
515         ),
516         /*
517         'limit_client' => array (
518             'datatype'    => 'INTEGER',
519             'formtype'    => 'TEXT',
520             'validators'    => array (     0 => array (    'type'    => 'ISINT',
521                                                         'errmsg'=> 'limit_client_error_notint'),
522                                     ),
523             'default'    => '0',
524             'value'        => '',
525             'separator'    => '',
526             'width'        => '10',
527             'maxlength'    => '10',
528             'rows'        => '',
529             'cols'        => ''
530         ),
531         */
532         'limit_database' => array (
533             'datatype'    => 'INTEGER',
534             'formtype'    => 'TEXT',
535             'validators'    => array (     0 => array (    'type'    => 'ISINT',
536                                                         'errmsg'=> 'limit_database_error_notint'),
537                                     ),
538             'default'    => '0',
539             'value'        => '',
540             'separator'    => '',
541             'width'        => '10',
542             'maxlength'    => '10',
543             'rows'        => '',
544             'cols'        => ''
545         ),
546         'limit_cron' => array (
547             'datatype'  => 'INTEGER',
548             'formtype'  => 'TEXT',
549             'validators'    => array (  0 => array (    'type'  => 'ISINT',
550                                                         'errmsg'=> 'limit_cron_error_notint'),
551                                     ),
552             'default'   => '0',
553             'value'     => '',
554             'separator' => '',
555             'width'     => '10',
556             'maxlength' => '10',
557             'rows'      => '',
558             'cols'      => ''
559         ),
560         'limit_cron_type' => array (
561             'datatype'  => 'VARCHAR',
562             'formtype'  => 'SELECT',
563             'default'   => '',
564             'value'     => array('full' => 'Full Cron','chrooted' => 'Chrooted Cron','url' => 'URL Cron')
565         ),
566         'limit_cron_frequency' => array (
567             'datatype'  => 'INTEGER',
568             'formtype'  => 'TEXT',
569             'validators'    => array (  0 => array (    'type'  => 'ISINT',
570                                                         'errmsg'=> 'limit_cron_error_frequency'),
571                                     ),
572             'default'   => '-1',
573             'value'     => '',
574             'separator' => '',
575             'width'     => '10',
576             'maxlength' => '10',
577             'rows'      => '',
578             'cols'      => ''
579         ),
580         'limit_traffic_quota' => array (
581             'datatype'    => 'INTEGER',
582             'formtype'    => 'TEXT',
583             'validators'    => array (     0 => array (    'type'    => 'ISINT',
584                                                         'errmsg'=> 'limit_traffic_quota_error_notint'),
585                                     ),
586             'default'    => '-1',
587             'value'        => '',
588             'separator'    => '',
589             'width'        => '10',
590             'maxlength'    => '10',
591             'rows'        => '',
592             'cols'        => ''
593         ),
f414ab 594         'limit_openvz_vm' => array (
T 595             'datatype'    => 'INTEGER',
596             'formtype'    => 'TEXT',
597             'validators'    => array (     0 => array (    'type'    => 'ISINT',
598                                                         'errmsg'=> 'limit_openvz_vm_error_notint'),
599                                     ),
600             'default'    => '0',
601             'value'        => '',
602             'separator'    => '',
603             'width'        => '10',
604             'maxlength'    => '10',
605             'rows'        => '',
606             'cols'        => ''
607         ),
608         'limit_openvz_vm_template_id' => array (
609             'datatype'    => 'INTEGER',
610             'formtype'    => 'SELECT',
611             'default'    => '',
612             'datasource'    => array (     'type'    => 'SQL',
613                                         'querystring' => 'SELECT template_id,template_name FROM openvz_template WHERE 1 ORDER BY template_name',
614                                         'keyfield'=> 'template_id',
615                                         'valuefield'=> 'template_name'
616                                      ),
617             'value'        => array(0 => ' ')
618         ),
526b99 619         'limit_aps' => array (
T 620             'datatype'    => 'INTEGER',
621             'formtype'    => 'TEXT',
622             'validators'    => array (     0 => array (    'type'    => 'ISINT',
623                                                         'errmsg'=> 'limit_aps_error_notint'),
624                                     ),
625             'default'    => '-1',
626             'value'        => '',
627             'separator'    => '',
628             'width'        => '10',
629             'maxlength'    => '10',
630             'rows'        => '',
631             'cols'        => ''
632         ),
532ae5 633     ##################################
L 634     # END Datatable fields
635     ##################################
636     )
637 );
638
639 ?>