commit | author | age
|
e22f1e
|
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 |
e22f1e
|
37 |
|
T |
38 |
|
|
39 |
*/ |
65ea2e
|
40 |
global $app; |
bd68aa
|
41 |
$app->uses('getconf'); |
MC |
42 |
$global_config = $app->getconf->get_global_config(); |
e22f1e
|
43 |
|
b1a6a5
|
44 |
$form["title"] = "Mailbox"; |
MC |
45 |
$form["description"] = ""; |
|
46 |
$form["name"] = "mail_user"; |
|
47 |
$form["action"] = "mail_user_edit.php"; |
|
48 |
$form["db_table"] = "mail_user"; |
|
49 |
$form["db_table_idx"] = "mailuser_id"; |
|
50 |
$form["db_history"] = "yes"; |
|
51 |
$form["tab_default"] = "mailuser"; |
|
52 |
$form["list_default"] = "mail_user_list.php"; |
|
53 |
$form["auth"] = 'yes'; // yes / no |
e22f1e
|
54 |
|
T |
55 |
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user |
|
56 |
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user |
|
57 |
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete |
|
58 |
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete |
|
59 |
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete |
|
60 |
|
c99650
|
61 |
$form["tabs"]['mailuser'] = array( |
b1a6a5
|
62 |
'title' => "Mailbox", |
MC |
63 |
'width' => 100, |
|
64 |
'template' => "templates/mail_user_mailbox_edit.htm", |
|
65 |
'fields' => array ( |
|
66 |
//################################# |
|
67 |
// Begin Datatable fields |
|
68 |
//################################# |
e22f1e
|
69 |
'server_id' => array ( |
b1a6a5
|
70 |
'datatype' => 'INTEGER', |
MC |
71 |
'formtype' => 'TEXT', |
|
72 |
'default' => '', |
|
73 |
'value' => '', |
|
74 |
'width' => '30', |
|
75 |
'maxlength' => '255' |
e22f1e
|
76 |
), |
T |
77 |
'email' => array ( |
b1a6a5
|
78 |
'datatype' => 'VARCHAR', |
MC |
79 |
'formtype' => 'TEXT', |
|
80 |
'filters' => array( 0 => array( 'event' => 'SAVE', |
|
81 |
'type' => 'IDNTOASCII'), |
|
82 |
1 => array( 'event' => 'SHOW', |
|
83 |
'type' => 'IDNTOUTF8'), |
|
84 |
2 => array( 'event' => 'SAVE', |
|
85 |
'type' => 'TOLOWER') |
|
86 |
), |
|
87 |
'validators' => array ( 0 => array ( 'type' => 'ISEMAIL', |
|
88 |
'errmsg'=> 'email_error_isemail'), |
|
89 |
1 => array ( 'type' => 'UNIQUE', |
|
90 |
'errmsg'=> 'email_error_unique'), |
|
91 |
), |
|
92 |
'default' => '', |
|
93 |
'value' => '', |
|
94 |
'width' => '30', |
|
95 |
'maxlength' => '255', |
4c28d9
|
96 |
'searchable' => 1 |
e22f1e
|
97 |
), |
b1a6a5
|
98 |
'login' => array ( |
MC |
99 |
'datatype' => 'VARCHAR', |
|
100 |
'formtype' => 'TEXT', |
|
101 |
'filters' => array( 0 => array( 'event' => 'SAVE', |
|
102 |
'type' => 'IDNTOASCII'), |
|
103 |
1 => array( 'event' => 'SHOW', |
|
104 |
'type' => 'IDNTOUTF8'), |
|
105 |
2 => array( 'event' => 'SAVE', |
|
106 |
'type' => 'TOLOWER') |
|
107 |
), |
|
108 |
'validators' => array ( |
|
109 |
0 => array ( 'type' => 'UNIQUE', |
|
110 |
'errmsg'=> 'login_error_unique'), |
|
111 |
1 => array ( 'type' => 'REGEX', |
1272df
|
112 |
'regex' => '/^[_a-z0-9][\w\.\-_\+@]{1,63}$/', |
b1a6a5
|
113 |
'errmsg'=> 'login_error_regex'), |
MC |
114 |
), |
|
115 |
'default' => '', |
|
116 |
'value' => '', |
|
117 |
'width' => '30', |
|
118 |
'maxlength' => '255' |
|
119 |
), |
ac3b1f
|
120 |
'password' => array ( |
b1a6a5
|
121 |
'datatype' => 'VARCHAR', |
MC |
122 |
'formtype' => 'PASSWORD', |
e22f1e
|
123 |
'encryption'=> 'CRYPT', |
b1a6a5
|
124 |
'default' => '', |
MC |
125 |
'value' => '', |
|
126 |
'width' => '30', |
|
127 |
'maxlength' => '255' |
e22f1e
|
128 |
), |
fd7b50
|
129 |
'name' => array ( |
b1a6a5
|
130 |
'datatype' => 'VARCHAR', |
MC |
131 |
'formtype' => 'TEXT', |
|
132 |
'default' => '', |
|
133 |
'value' => '', |
|
134 |
'width' => '30', |
|
135 |
'maxlength' => '255', |
4c28d9
|
136 |
'searchable' => 2 |
fd7b50
|
137 |
), |
e22f1e
|
138 |
'quota' => array ( |
b1a6a5
|
139 |
'datatype' => 'VARCHAR', |
MC |
140 |
'formtype' => 'TEXT', |
|
141 |
'validators' => array ( 1 => array ( 'type' => 'ISINT', |
|
142 |
'errmsg'=> 'quota_error_isint'), |
|
143 |
0 => array ( 'type' => 'REGEX', |
|
144 |
'regex' => '/^([0-9]{1,})$/', |
|
145 |
'errmsg'=> 'quota_error_value'), |
|
146 |
), |
|
147 |
'default' => '-1', |
|
148 |
'value' => '', |
|
149 |
'width' => '30', |
|
150 |
'maxlength' => '255' |
e22f1e
|
151 |
), |
2a704f
|
152 |
'cc' => array ( |
b1a6a5
|
153 |
'datatype' => 'VARCHAR', |
MC |
154 |
'formtype' => 'TEXT', |
|
155 |
'filters' => array( 0 => array( 'event' => 'SAVE', |
|
156 |
'type' => 'IDNTOASCII'), |
|
157 |
1 => array( 'event' => 'SHOW', |
|
158 |
'type' => 'IDNTOUTF8'), |
|
159 |
2 => array( 'event' => 'SAVE', |
|
160 |
'type' => 'TOLOWER') |
|
161 |
), |
|
162 |
'validators' => array ( 0 => array ( 'type' => 'REGEX', |
f798aa
|
163 |
'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,1}(,\s*\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\.[a-z\-]{2,10}){0,}$/i', |
b1a6a5
|
164 |
'errmsg'=> 'cc_error_isemail'), |
MC |
165 |
), |
|
166 |
'default' => '', |
|
167 |
'value' => '', |
|
168 |
'width' => '30', |
|
169 |
'maxlength' => '255' |
2a704f
|
170 |
), |
e22f1e
|
171 |
'maildir' => array ( |
b1a6a5
|
172 |
'datatype' => 'VARCHAR', |
MC |
173 |
'formtype' => 'TEXT', |
|
174 |
'default' => '', |
|
175 |
'value' => '', |
|
176 |
'width' => '30', |
|
177 |
'maxlength' => '255' |
e22f1e
|
178 |
), |
ac3b1f
|
179 |
'homedir' => array ( |
b1a6a5
|
180 |
'datatype' => 'VARCHAR', |
MC |
181 |
'formtype' => 'TEXT', |
|
182 |
'default' => '', |
|
183 |
'value' => '', |
|
184 |
'width' => '30', |
|
185 |
'maxlength' => '255' |
ac3b1f
|
186 |
), |
T |
187 |
'uid' => array ( |
b1a6a5
|
188 |
'datatype' => 'INTEGER', |
MC |
189 |
'formtype' => 'TEXT', |
|
190 |
'default' => '', |
|
191 |
'value' => '', |
|
192 |
'width' => '10', |
|
193 |
'maxlength' => '10' |
ac3b1f
|
194 |
), |
T |
195 |
'gid' => array ( |
b1a6a5
|
196 |
'datatype' => 'INTEGER', |
MC |
197 |
'formtype' => 'TEXT', |
|
198 |
'default' => '', |
|
199 |
'value' => '', |
|
200 |
'width' => '10', |
|
201 |
'maxlength' => '10' |
ac3b1f
|
202 |
), |
T |
203 |
'postfix' => array ( |
b1a6a5
|
204 |
'datatype' => 'VARCHAR', |
MC |
205 |
'formtype' => 'CHECKBOX', |
|
206 |
'default' => 'y', |
|
207 |
'value' => array(1 => 'y', 0 => 'n') |
ac3b1f
|
208 |
), |
4c0bc2
|
209 |
/* |
ac3b1f
|
210 |
'access' => array ( |
45f11e
|
211 |
'datatype' => 'VARCHAR', |
e22f1e
|
212 |
'formtype' => 'CHECKBOX', |
3edf9d
|
213 |
'default' => 'y', |
45f11e
|
214 |
'value' => array(1 => 'y',0 => 'n') |
e22f1e
|
215 |
), |
4c0bc2
|
216 |
*/ |
T |
217 |
'disableimap' => array ( |
b1a6a5
|
218 |
'datatype' => 'VARCHAR', |
MC |
219 |
'formtype' => 'CHECKBOX', |
|
220 |
'default' => 'n', |
|
221 |
'value' => array(1 => 'y', 0 => 'n') |
4c0bc2
|
222 |
), |
T |
223 |
'disablepop3' => array ( |
b1a6a5
|
224 |
'datatype' => 'VARCHAR', |
MC |
225 |
'formtype' => 'CHECKBOX', |
|
226 |
'default' => 'n', |
|
227 |
'value' => array(1 => 'y', 0 => 'n') |
4c0bc2
|
228 |
), |
b1a6a5
|
229 |
//################################# |
MC |
230 |
// END Datatable fields |
|
231 |
//################################# |
e22f1e
|
232 |
) |
T |
233 |
); |
|
234 |
|
c99650
|
235 |
if($global_config['mail']['mail_password_onlyascii'] == 'y') { |
MC |
236 |
$form['tabs']['mailuser']['fields']['password']['validators'] = array( 0 => array( 'type' => 'ISASCII', |
|
237 |
'errmsg' => 'email_error_isascii') |
|
238 |
); |
|
239 |
} |
|
240 |
|
bd68aa
|
241 |
if ($global_config['mail']['mailbox_show_autoresponder_tab'] === 'y') { |
MC |
242 |
$form["tabs"]['autoresponder'] = array ( |
b1a6a5
|
243 |
'title' => "Autoresponder", |
MC |
244 |
'width' => 100, |
|
245 |
'template' => "templates/mail_user_autoresponder_edit.htm", |
|
246 |
'fields' => array ( |
|
247 |
//################################# |
|
248 |
// Begin Datatable fields |
|
249 |
//################################# |
bd68aa
|
250 |
'autoresponder_subject' => array ( |
MC |
251 |
'datatype' => 'VARCHAR', |
|
252 |
'formtype' => 'TEXT', |
|
253 |
'default' => 'Out of office reply', |
|
254 |
'value' => '', |
b1a6a5
|
255 |
'width' => '30', |
MC |
256 |
'maxlength' => '255' |
bd68aa
|
257 |
), |
MC |
258 |
'autoresponder_text' => array ( |
b1a6a5
|
259 |
'datatype' => 'TEXT', |
MC |
260 |
'formtype' => 'TEXTAREA', |
|
261 |
'default' => '', |
|
262 |
'value' => '', |
|
263 |
'cols' => '30', |
|
264 |
'rows' => '15' |
bd68aa
|
265 |
), |
MC |
266 |
'autoresponder' => array ( |
b1a6a5
|
267 |
'datatype' => 'VARCHAR', |
MC |
268 |
'formtype' => 'CHECKBOX', |
|
269 |
'default' => 'n', |
|
270 |
'value' => array(1 => 'y', 0 => 'n') |
bd68aa
|
271 |
), |
MC |
272 |
'autoresponder_start_date' => array ( |
b1a6a5
|
273 |
'datatype' => 'DATETIME', |
MC |
274 |
'formtype' => 'DATETIME', |
bd68aa
|
275 |
'validators'=> array ( 0 => array ( 'type' => 'CUSTOM', |
b1a6a5
|
276 |
'class' => 'validate_autoresponder', |
MC |
277 |
'function' => 'start_date', |
|
278 |
'errmsg'=> 'autoresponder_start_date_is_required'), |
bd68aa
|
279 |
) |
MC |
280 |
), |
|
281 |
'autoresponder_end_date' => array ( |
b1a6a5
|
282 |
'datatype' => 'DATETIME', |
MC |
283 |
'formtype' => 'DATETIME', |
|
284 |
'validators'=> array ( 0 => array ( 'type' => 'CUSTOM', |
|
285 |
'class' => 'validate_autoresponder', |
|
286 |
'function' => 'end_date', |
|
287 |
'errmsg'=> 'autoresponder_end_date_isgreater'), |
|
288 |
), |
bd68aa
|
289 |
), |
b1a6a5
|
290 |
//################################# |
MC |
291 |
// END Datatable fields |
|
292 |
//################################# |
bd68aa
|
293 |
) |
MC |
294 |
); |
d097c7
|
295 |
} |
C |
296 |
|
|
297 |
|
bd68aa
|
298 |
if ($global_config['mail']['mailbox_show_mail_filter_tab'] === 'y') { |
MC |
299 |
$form["tabs"]['filter_records'] = array ( |
b1a6a5
|
300 |
'title' => "Mail Filter", |
MC |
301 |
'width' => 100, |
|
302 |
'template' => "templates/mail_user_mailfilter_edit.htm", |
|
303 |
'fields' => array ( |
|
304 |
//################################# |
|
305 |
// Begin Datatable fields |
|
306 |
//################################# |
bd68aa
|
307 |
'move_junk' => array ( |
b1a6a5
|
308 |
'datatype' => 'VARCHAR', |
MC |
309 |
'formtype' => 'CHECKBOX', |
|
310 |
'default' => 'n', |
|
311 |
'value' => array(0 => 'n', 1 => 'y') |
bd68aa
|
312 |
), |
b1a6a5
|
313 |
//################################# |
MC |
314 |
// END Datatable fields |
|
315 |
//################################# |
bd68aa
|
316 |
), |
MC |
317 |
'plugins' => array ( |
|
318 |
'filter_records' => array ( |
|
319 |
'class' => 'plugin_listview', |
|
320 |
'options' => array( |
b1a6a5
|
321 |
'listdef' => 'list/mail_user_filter.list.php', |
MC |
322 |
'sqlextwhere' => "mailuser_id = ".@$app->functions->intval(@$_REQUEST['id']), |
|
323 |
'sql_order_by' => "ORDER BY rulename" |
|
324 |
) |
bd68aa
|
325 |
) |
MC |
326 |
) |
|
327 |
); |
|
328 |
} |
|
329 |
|
|
330 |
|
|
331 |
if ($_SESSION["s"]["user"]["typ"] == 'admin' && $global_config['mail']['mailbox_show_custom_rules_tab'] === 'y') { |
|
332 |
$form["tabs"]['mailfilter'] = array ( |
b1a6a5
|
333 |
'title' => "Custom Rules", |
MC |
334 |
'width' => 100, |
|
335 |
'template' => "templates/mail_user_custom_rules_edit.htm", |
|
336 |
'fields' => array ( |
|
337 |
//################################# |
|
338 |
// Begin Datatable fields |
|
339 |
//################################# |
bd68aa
|
340 |
'custom_mailfilter' => array ( |
b1a6a5
|
341 |
'datatype' => 'TEXT', |
MC |
342 |
'formtype' => 'TEXTAREA', |
|
343 |
'default' => '', |
|
344 |
'value' => '', |
|
345 |
'cols' => '30', |
|
346 |
'rows' => '15' |
bd68aa
|
347 |
), |
b1a6a5
|
348 |
//################################# |
MC |
349 |
// END Datatable fields |
|
350 |
//################################# |
bd68aa
|
351 |
) |
MC |
352 |
); |
|
353 |
} |
|
354 |
|
f17718
|
355 |
//* Backup |
FS |
356 |
$form["tabs"]['backup'] = array ( |
|
357 |
'title' => "Backup", |
|
358 |
'width' => 100, |
|
359 |
'template' => "templates/mail_user_backup.htm", |
|
360 |
'readonly' => false, |
|
361 |
'fields' => array ( |
|
362 |
################################## |
|
363 |
# Begin Datatable fields |
|
364 |
################################## |
|
365 |
'backup_interval' => array ( |
|
366 |
'datatype' => 'VARCHAR', |
|
367 |
'formtype' => 'SELECT', |
|
368 |
'default' => '', |
|
369 |
'value' => array('none' => 'no_backup_txt', 'daily' => 'daily_backup_txt', 'weekly' => 'weekly_backup_txt', 'monthly' => 'monthly_backup_txt') |
|
370 |
), |
|
371 |
'backup_copies' => array ( |
|
372 |
'datatype' => 'INTEGER', |
|
373 |
'formtype' => 'SELECT', |
|
374 |
'default' => '', |
|
375 |
'value' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10') |
|
376 |
), |
|
377 |
################################## |
|
378 |
# ENDE Datatable fields |
|
379 |
################################## |
|
380 |
), |
|
381 |
'plugins' => array ( |
|
382 |
'backup_records' => array ( |
|
383 |
'class' => 'plugin_backuplist_mail', |
|
384 |
'options' => array( |
|
385 |
) |
|
386 |
) |
|
387 |
) |
|
388 |
); |
d097c7
|
389 |
|
bd68aa
|
390 |
?> |