Marius Cramer
2015-08-06 37b29231e47a0c4458dc1c15d98588f16f07e1e2
commit | author | age
f14188 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).
7fe908 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
f14188 37
T 38
39 */
65ea2e 40 global $app;
f14188 41
7fe908 42 $form["title"]    = "DNS Zone";
MC 43 $form["description"]  = "";
44 $form["name"]    = "dns_soa";
45 $form["action"]   = "dns_soa_edit.php";
46 $form["db_table"]  = "dns_soa";
47 $form["db_table_idx"] = "id";
48 $form["db_history"]  = "yes";
49 $form["tab_default"] = "dns_soa";
50 $form["list_default"] = "dns_soa_list.php";
51 $form["auth"]   = 'yes'; // yes / no
f14188 52
T 53 $form["auth_preset"]["userid"]  = 0; // 0 = id of the user, > 0 id must match with id of current user
54 $form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
55 $form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
56 $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
57 $form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
58
59 $form["tabs"]['dns_soa'] = array (
7fe908 60     'title'  => "DNS Zone",
MC 61     'width'  => 100,
62     'template'  => "templates/dns_soa_edit.htm",
63     'fields'  => array (
64         //#################################
65         // Begin Datatable fields
66         //#################################
f14188 67         'server_id' => array (
7fe908 68             'datatype' => 'INTEGER',
MC 69             'formtype' => 'SELECT',
70             'datasource' => array (  'type' => 'SQL',
71                 'querystring' => 'SELECT server_id,server_name FROM server WHERE mirror_server_id = 0 AND dns_server = 1 AND {AUTHSQL} ORDER BY server_name',
72                 'keyfield'=> 'server_id',
73                 'valuefield'=> 'server_name'
74             ),
75             'validators' => array (  0 => array ( 'type' => 'NOTEMPTY',
76                     'errmsg'=> 'server_id_error_empty'),
77             ),
78             'default' => '',
79             'value'  => '',
80             'width'  => '30',
81             'maxlength' => '255'
f14188 82         ),
T 83         'origin' => array (
7fe908 84             'datatype' => 'VARCHAR',
MC 85             'formtype' => 'TEXT',
86             'filters'   => array( 0 => array( 'event' => 'SAVE',
87                     'type' => 'IDNTOASCII'),
88                 1 => array( 'event' => 'SHOW',
89                     'type' => 'IDNTOUTF8'),
90                 2 => array( 'event' => 'SAVE',
91                     'type' => 'TOLOWER')
92             ),
93             'validators' => array (  0 => array ( 'type' => 'NOTEMPTY',
94                     'errmsg'=> 'origin_error_empty'),
95                 1 => array ( 'type' => 'UNIQUE',
96                     'errmsg'=> 'origin_error_unique'),
97                 2 => array ( 'type' => 'REGEX',
91bb61 98                     'regex' => '/^[a-zA-Z0-9\.\-\/]{2,255}\.[a-zA-Z0-9\-]{2,30}[\.]{0,1}$/',
7fe908 99                     'errmsg'=> 'origin_error_regex'),
MC 100             ),
101             'default' => '',
102             'value'  => '',
103             'width'  => '30',
104             'maxlength' => '255',
4c28d9 105             'searchable' => 1
f14188 106         ),
T 107         'ns' => array (
7fe908 108             'datatype' => 'VARCHAR',
MC 109             'formtype' => 'TEXT',
110             'filters'   => array( 0 => array( 'event' => 'SAVE',
111                     'type' => 'IDNTOASCII'),
112                 1 => array( 'event' => 'SHOW',
113                     'type' => 'IDNTOUTF8'),
114                 2 => array( 'event' => 'SAVE',
115                     'type' => 'TOLOWER')
116             ),
117             'validators' => array (  0 => array ( 'type' => 'REGEX',
91bb61 118                     'regex' => '/^[a-zA-Z0-9\.\-]{1,255}$/',
7fe908 119                     'errmsg'=> 'ns_error_regex'),
MC 120             ),
121             'default' => '',
122             'value'  => '',
123             'width'  => '30',
124             'maxlength' => '255',
4c28d9 125             'searchable' => 2
f14188 126         ),
T 127         'mbox' => array (
7fe908 128             'datatype' => 'VARCHAR',
MC 129             'formtype' => 'TEXT',
130             'filters'   => array( 0 => array( 'event' => 'SAVE',
131                     'type' => 'IDNTOASCII'),
132                 1 => array( 'event' => 'SHOW',
133                     'type' => 'IDNTOUTF8'),
134                 2 => array( 'event' => 'SAVE',
135                     'type' => 'TOLOWER')
136             ),
137             'validators' => array (  0 => array ( 'type' => 'NOTEMPTY',
138                     'errmsg'=> 'mbox_error_empty'),
139                 1 => array ( 'type' => 'REGEX',
91bb61 140                     'regex' => '/^[a-zA-Z0-9\.\-\_]{0,255}\.$/',
7fe908 141                     'errmsg'=> 'mbox_error_regex'),
MC 142             ),
143             'default' => '',
144             'value'  => '',
145             'width'  => '30',
146             'maxlength' => '255',
4c28d9 147             'searchable' => 2
f14188 148         ),
T 149         'serial' => array (
7fe908 150             'datatype' => 'INTEGER',
MC 151             'formtype' => 'TEXT',
152             'default' => '',
153             'value'  => '',
154             'width'  => '10',
155             'maxlength' => '10'
f14188 156         ),
T 157         'refresh' => array (
7fe908 158             'datatype' => 'INTEGER',
MC 159             'formtype' => 'TEXT',
160             'validators' => array (  0 => array ( 'type' => 'RANGE',
161                     'range' => '60:',
162                     'errmsg'=> 'refresh_range_error'),
163             ),
164             'default' => '7200',
165             'value'  => '',
166             'width'  => '10',
167             'maxlength' => '10'
f14188 168         ),
T 169         'retry' => array (
7fe908 170             'datatype' => 'INTEGER',
MC 171             'formtype' => 'TEXT',
172             'validators' => array (  0 => array ( 'type' => 'RANGE',
173                     'range' => '60:',
174                     'errmsg'=> 'retry_range_error'),
175             ),
176             'default' => '540',
177             'value'  => '',
178             'width'  => '10',
179             'maxlength' => '10'
f14188 180         ),
T 181         'expire' => array (
7fe908 182             'datatype' => 'INTEGER',
MC 183             'formtype' => 'TEXT',
184             'validators' => array (  0 => array ( 'type' => 'RANGE',
185                     'range' => '60:',
186                     'errmsg'=> 'expire_range_error'),
187             ),
188             'default' => '604800',
189             'value'  => '',
190             'width'  => '10',
191             'maxlength' => '10'
f14188 192         ),
T 193         'minimum' => array (
7fe908 194             'datatype' => 'INTEGER',
MC 195             'formtype' => 'TEXT',
196             'validators' => array (  0 => array ( 'type' => 'RANGE',
197                     'range' => '60:',
198                     'errmsg'=> 'minimum_range_error'),
199             ),
b41803 200             'default' => '3600',
7fe908 201             'value'  => '',
MC 202             'width'  => '10',
203             'maxlength' => '10'
f14188 204         ),
T 205         'ttl' => array (
7fe908 206             'datatype' => 'INTEGER',
MC 207             'formtype' => 'TEXT',
208             'validators' => array (  0 => array ( 'type' => 'RANGE',
209                     'range' => '60:',
210                     'errmsg'=> 'ttl_range_error'),
211             ),
212             'default' => '3600',
213             'value'  => '',
214             'width'  => '10',
215             'maxlength' => '10'
f14188 216         ),
T 217         'xfer' => array (
7fe908 218             'datatype' => 'VARCHAR',
MC 219             'formtype' => 'TEXT',
3d3f98 220             'validators' => array (  0 => array ( 'type' => 'CUSTOM',
TB 221                     'class' => 'validate_dns',
222                     'function' => 'validate_xfer',
223                     'allowempty' => 'y',
224                     'separator' => ',',
225                     'errmsg'=> 'xfer_error_regex'),
226             ),
227             /*
7fe908 228             'validators' => array (  0 => array ( 'type' => 'ISIP',
MC 229                     'allowempty' => 'y',
230                     'separator' => ',',
231                     'errmsg'=> 'xfer_error_regex'),
232             ),
3d3f98 233             */
7fe908 234             'default' => '',
MC 235             'value'  => '',
236             'width'  => '30',
237             'maxlength' => '255'
f14188 238         ),
66e957 239         'also_notify' => array (
7fe908 240             'datatype' => 'VARCHAR',
MC 241             'formtype' => 'TEXT',
242             'validators'    => array (  0 => array ( 'type' => 'ISIP',
243                     'allowempty' => 'y',
244                     'separator' => ',',
245                     'errmsg'=> 'also_notify_error_regex'
246                 ),
247             ),
248             'default' => '',
249             'value'  => '',
250             'width'  => '30',
251             'maxlength' => '255'
66e957 252         ),
T 253         'update_acl' => array (
7fe908 254             'datatype' => 'VARCHAR',
MC 255             'formtype' => 'TEXT',
256             'default' => '',
257             'value'  => '',
258             'width'  => '30',
259             'maxlength' => '255'
66e957 260         ),
f14188 261         'active' => array (
7fe908 262             'datatype' => 'VARCHAR',
MC 263             'formtype' => 'CHECKBOX',
264             'default' => 'Y',
265             'value'  => array(0 => 'N', 1 => 'Y')
f14188 266         ),
7fe908 267         //#################################
MC 268         // ENDE Datatable fields
269         //#################################
f14188 270     )
T 271 );
272
273 $form["tabs"]['dns_records'] = array (
7fe908 274     'title'  => "Records",
MC 275     'width'  => 100,
276     'template'  => "templates/dns_records_edit.htm",
277     'fields'  => array (
278         //#################################
279         // Begin Datatable fields
280         //#################################
281
282         //#################################
283         // ENDE Datatable fields
284         //#################################
f14188 285     ),
T 286     'plugins' => array (
7fe908 287         'dns_records' => array (
MC 288             'class'   => 'plugin_listview',
289             'options' => array(
f14188 290                 'listdef' => 'list/dns_a.list.php',
65ea2e 291                 'sqlextwhere' => "zone = ".@$app->functions->intval(@$_REQUEST['id']),
15e770 292                 'sql_order_by' => "ORDER BY type, name"
f14188 293             )
7fe908 294         )
f14188 295     )
T 296 );
297
298
299
7fe908 300 ?>