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 |
), |
|
200 |
'default' => '86400', |
|
201 |
'value' => '', |
|
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', |
|
220 |
'validators' => array ( 0 => array ( 'type' => 'ISIP', |
|
221 |
'allowempty' => 'y', |
|
222 |
'separator' => ',', |
|
223 |
'errmsg'=> 'xfer_error_regex'), |
|
224 |
), |
|
225 |
'default' => '', |
|
226 |
'value' => '', |
|
227 |
'width' => '30', |
|
228 |
'maxlength' => '255' |
f14188
|
229 |
), |
66e957
|
230 |
'also_notify' => array ( |
7fe908
|
231 |
'datatype' => 'VARCHAR', |
MC |
232 |
'formtype' => 'TEXT', |
|
233 |
'validators' => array ( 0 => array ( 'type' => 'ISIP', |
|
234 |
'allowempty' => 'y', |
|
235 |
'separator' => ',', |
|
236 |
'errmsg'=> 'also_notify_error_regex' |
|
237 |
), |
|
238 |
), |
|
239 |
'default' => '', |
|
240 |
'value' => '', |
|
241 |
'width' => '30', |
|
242 |
'maxlength' => '255' |
66e957
|
243 |
), |
T |
244 |
'update_acl' => array ( |
7fe908
|
245 |
'datatype' => 'VARCHAR', |
MC |
246 |
'formtype' => 'TEXT', |
|
247 |
'default' => '', |
|
248 |
'value' => '', |
|
249 |
'width' => '30', |
|
250 |
'maxlength' => '255' |
66e957
|
251 |
), |
f14188
|
252 |
'active' => array ( |
7fe908
|
253 |
'datatype' => 'VARCHAR', |
MC |
254 |
'formtype' => 'CHECKBOX', |
|
255 |
'default' => 'Y', |
|
256 |
'value' => array(0 => 'N', 1 => 'Y') |
f14188
|
257 |
), |
7fe908
|
258 |
//################################# |
MC |
259 |
// ENDE Datatable fields |
|
260 |
//################################# |
f14188
|
261 |
) |
T |
262 |
); |
|
263 |
|
|
264 |
$form["tabs"]['dns_records'] = array ( |
7fe908
|
265 |
'title' => "Records", |
MC |
266 |
'width' => 100, |
|
267 |
'template' => "templates/dns_records_edit.htm", |
|
268 |
'fields' => array ( |
|
269 |
//################################# |
|
270 |
// Begin Datatable fields |
|
271 |
//################################# |
|
272 |
|
|
273 |
//################################# |
|
274 |
// ENDE Datatable fields |
|
275 |
//################################# |
f14188
|
276 |
), |
T |
277 |
'plugins' => array ( |
7fe908
|
278 |
'dns_records' => array ( |
MC |
279 |
'class' => 'plugin_listview', |
|
280 |
'options' => array( |
f14188
|
281 |
'listdef' => 'list/dns_a.list.php', |
65ea2e
|
282 |
'sqlextwhere' => "zone = ".@$app->functions->intval(@$_REQUEST['id']), |
15e770
|
283 |
'sql_order_by' => "ORDER BY type, name" |
f14188
|
284 |
) |
7fe908
|
285 |
) |
f14188
|
286 |
) |
T |
287 |
); |
|
288 |
|
|
289 |
|
|
290 |
|
7fe908
|
291 |
?> |