mail_user.tform.php 7.93 KB
Newer Older
tbrehm's avatar
tbrehm committed
1
2
3
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
36
37
<?php

/*
	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).


*/

$form["title"] 			= "Mailbox";
$form["description"] 	= "";
tbrehm's avatar
tbrehm committed
38
39
40
41
$form["name"] 			= "mail_user";
$form["action"]			= "mail_user_edit.php";
$form["db_table"]		= "mail_user";
$form["db_table_idx"]	= "mailuser_id";
tbrehm's avatar
tbrehm committed
42
$form["db_history"]		= "yes";
tbrehm's avatar
tbrehm committed
43
44
$form["tab_default"]	= "mailuser";
$form["list_default"]	= "mail_user_list.php";
tbrehm's avatar
tbrehm committed
45
46
47
48
49
50
51
52
$form["auth"]			= 'yes'; // yes / no

$form["auth_preset"]["userid"]  = 0; // 0 = id of the user, > 0 id must match with id of current user
$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

tbrehm's avatar
tbrehm committed
53
$form["tabs"]['mailuser'] = array (
tbrehm's avatar
tbrehm committed
54
55
	'title' 	=> "Mailbox",
	'width' 	=> 100,
tbrehm's avatar
tbrehm committed
56
	'template' 	=> "templates/mail_user_mailbox_edit.htm",
tbrehm's avatar
tbrehm committed
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
	'fields' 	=> array (
	##################################
	# Begin Datatable fields
	##################################
		'server_id' => array (
			'datatype'	=> 'INTEGER',
			'formtype'	=> 'TEXT',
			'default'	=> '',
			'value'		=> '',
			'width'		=> '30',
			'maxlength'	=> '255'
		),
		'email' => array (
			'datatype'	=> 'VARCHAR',
			'formtype'	=> 'TEXT',
			'validators'	=> array ( 	0 => array (	'type'	=> 'ISEMAIL',
														'errmsg'=> 'email_error_isemail'),
										1 => array (	'type'	=> 'UNIQUE',
														'errmsg'=> 'email_error_unique'),
									),
			'default'	=> '',
			'value'		=> '',
			'width'		=> '30',
			'maxlength'	=> '255'
		),
82
83
84
85
86
87
88
    'login' => array (
      'datatype'  => 'VARCHAR',
      'formtype'  => 'TEXT',
      'validators'  => array (
                    0 => array (  'type'  => 'UNIQUE',
                            'errmsg'=> 'login_error_unique'),
                    1 => array (  'type'  => 'REGEX',
latham's avatar
latham committed
89
                            'regex' => '/^[a-z0-9][\w\.\-_\+@]{1,63}$/',
90
91
92
93
94
95
96
                            'errmsg'=> 'login_error_regex'),
                  ),
      'default' => '',
      'value'   => '',
      'width'   => '30',
      'maxlength' => '255'
    ),
tbrehm's avatar
tbrehm committed
97
		'password' => array (
tbrehm's avatar
tbrehm committed
98
99
100
101
102
103
104
105
			'datatype'	=> 'VARCHAR',
			'formtype'	=> 'PASSWORD',
			'encryption'=> 'CRYPT',
			'default'	=> '',
			'value'		=> '',
			'width'		=> '30',
			'maxlength'	=> '255'
		),
106
107
108
109
110
111
112
113
		'name' => array (
			'datatype'	=> 'VARCHAR',
			'formtype'	=> 'TEXT',
			'default'	=> '',
			'value'		=> '',
			'width'		=> '30',
			'maxlength'	=> '255'
		),
tbrehm's avatar
tbrehm committed
114
115
116
117
118
		'quota' => array (
			'datatype'	=> 'INTEGER',
			'formtype'	=> 'TEXT',
			'validators'	=> array ( 	0 => array (	'type'	=> 'ISINT',
														'errmsg'=> 'quota_error_isint'),
119
										1 => array (	'type'	=> 'REGEX',
tbrehm's avatar
tbrehm committed
120
														'regex' => '/^([0-9]*)$/',
121
														'errmsg'=> 'quota_error_value'),
tbrehm's avatar
tbrehm committed
122
									),
tbrehm's avatar
tbrehm committed
123
			'default'	=> '-1',
tbrehm's avatar
tbrehm committed
124
125
126
127
			'value'		=> '',
			'width'		=> '30',
			'maxlength'	=> '255'
		),
128
129
130
131
		'cc' => array (
			'datatype'	=> 'VARCHAR',
			'formtype'	=> 'TEXT',
			'validators'	=> array ( 	0 => array (	'type'	=> 'REGEX',
132
														'regex' => '/^(\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\w+\.[a-z\-]{2,10}){0,1}$/i',
133
134
135
136
137
138
139
														'errmsg'=> 'cc_error_isemail'),
									),
			'default'	=> '',
			'value'		=> '',
			'width'		=> '30',
			'maxlength'	=> '255'
		),
tbrehm's avatar
tbrehm committed
140
141
142
143
144
145
146
147
		'maildir' => array (
			'datatype'	=> 'VARCHAR',
			'formtype'	=> 'TEXT',
			'default'	=> '',
			'value'		=> '',
			'width'		=> '30',
			'maxlength'	=> '255'
		),
tbrehm's avatar
tbrehm committed
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
		'homedir' => array (
			'datatype'	=> 'VARCHAR',
			'formtype'	=> 'TEXT',
			'default'	=> '',
			'value'		=> '',
			'width'		=> '30',
			'maxlength'	=> '255'
		),
		'uid' => array (
			'datatype'	=> 'INTEGER',
			'formtype'	=> 'TEXT',
			'default'	=> '',
			'value'		=> '',
			'width'		=> '10',
			'maxlength'	=> '10'
		),
		'gid' => array (
			'datatype'	=> 'INTEGER',
			'formtype'	=> 'TEXT',
			'default'	=> '',
			'value'		=> '',
			'width'		=> '10',
			'maxlength'	=> '10'
		),
		'postfix' => array (
tbrehm's avatar
tbrehm committed
173
			'datatype'	=> 'VARCHAR',
tbrehm's avatar
tbrehm committed
174
			'formtype'	=> 'CHECKBOX',
tbrehm's avatar
tbrehm committed
175
176
			'default'	=> 'y',
			'value'		=> array(1 => 'y',0 => 'n')
tbrehm's avatar
tbrehm committed
177
		),
178
		/*
tbrehm's avatar
tbrehm committed
179
		'access' => array (
tbrehm's avatar
tbrehm committed
180
			'datatype'	=> 'VARCHAR',
tbrehm's avatar
tbrehm committed
181
			'formtype'	=> 'CHECKBOX',
tbrehm's avatar
tbrehm committed
182
			'default'	=> 'y',
tbrehm's avatar
tbrehm committed
183
			'value'		=> array(1 => 'y',0 => 'n')
tbrehm's avatar
tbrehm committed
184
		),
185
186
187
188
		*/
		'disableimap' => array (
			'datatype'	=> 'VARCHAR',
			'formtype'	=> 'CHECKBOX',
189
190
			'default'	=> 'n',
			'value'		=> array(1 => 'y',0 => 'n')
191
192
193
194
		),
		'disablepop3' => array (
			'datatype'	=> 'VARCHAR',
			'formtype'	=> 'CHECKBOX',
195
196
			'default'	=> 'n',
			'value'		=> array(1 => 'y',0 => 'n')
197
		),
tbrehm's avatar
tbrehm committed
198
199
200
201
202
203
204
205
206
	##################################
	# ENDE Datatable fields
	##################################
	)
);

$form["tabs"]['autoresponder'] = array (
	'title' 	=> "Autoresponder",
	'width' 	=> 100,
tbrehm's avatar
tbrehm committed
207
	'template' 	=> "templates/mail_user_autoresponder_edit.htm",
tbrehm's avatar
tbrehm committed
208
209
210
211
212
213
214
215
216
217
218
219
220
	'fields' 	=> array (
	##################################
	# Begin Datatable fields
	##################################
		'autoresponder_text' => array (
			'datatype'	=> 'TEXT',
			'formtype'	=> 'TEXTAREA',
			'default'	=> '',
			'value'		=> '',
			'cols'		=> '30',
			'rows'		=> '15'
		),
		'autoresponder' => array (
221
			'datatype'	=> 'VARCHAR',
tbrehm's avatar
tbrehm committed
222
			'formtype'	=> 'CHECKBOX',
223
224
			'default'	=> 'n',
			'value'		=> array(1 => 'y',0 => 'n')
tbrehm's avatar
tbrehm committed
225
		),
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
		'autoresponder_start_date' => array (
			'datatype'	=> 'DATETIME',
			'formtype'	=> 'DATETIME',
			'validators'=> array ( 	0 => array (	'type'	=> 'CUSTOM',
													'class' => 'validate_autoresponder',
													'function' => 'start_date',
													'errmsg'=> 'autoresponder_start_date_isfuture'),
								 ),
		),
		'autoresponder_end_date' => array (
			'datatype'	=> 'DATETIME',
			'formtype'	=> 'DATETIME',
			'validators'=> array ( 	0 => array (	'type'	=> 'CUSTOM',
													'class' => 'validate_autoresponder',
													'function' => 'end_date',
													'errmsg'=> 'autoresponder_end_date_isgreater'),
								 ),
		),
tbrehm's avatar
tbrehm committed
244
245
246
247
248
249
	##################################
	# ENDE Datatable fields
	##################################
	)
);

250
251
252
253
254
255
256
257
$form["tabs"]['filter_records'] = array (
	'title' 	=> "Mail Filter",
	'width' 	=> 100,
	'template' 	=> "templates/mail_user_mailfilter_edit.htm",
	'fields' 	=> array (
	##################################
	# Begin Datatable fields
	##################################
258
259
260
261
262
263
		'move_junk' => array (
			'datatype'	=> 'VARCHAR',
			'formtype'	=> 'CHECKBOX',
			'default'	=> 'n',
			'value'		=> array(0 => 'n',1 => 'y')
		),
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
	##################################
	# ENDE Datatable fields
	##################################
	),
	'plugins' => array (
     	'filter_records' => array (
         	'class'   => 'plugin_listview',
     		'options' => array(
				'listdef' => 'list/mail_user_filter.list.php',
				'sqlextwhere' => "mailuser_id = ".@intval(@$_REQUEST['id']),
				'sql_order_by' => "ORDER BY rulename"
			)
        )
	)
);

280
281
282
if($_SESSION["s"]["user"]["typ"] == 'admin') {

$form["tabs"]['mailfilter'] = array (
283
	'title' 	=> "Custom Rules",
284
	'width' 	=> 100,
285
	'template' 	=> "templates/mail_user_custom_rules_edit.htm",
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
	'fields' 	=> array (
	##################################
	# Begin Datatable fields
	##################################
		'custom_mailfilter' => array (
			'datatype'	=> 'TEXT',
			'formtype'	=> 'TEXTAREA',
			'default'	=> '',
			'value'		=> '',
			'cols'		=> '30',
			'rows'		=> '15'
		),
	##################################
	# ENDE Datatable fields
	##################################
	)
);

}

tbrehm's avatar
tbrehm committed
306

tbrehm's avatar
tbrehm committed
307
?>