commit | author | age
|
18341e
|
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). |
4c28d9
|
32 |
|
F |
33 |
Search: |
|
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 |
18341e
|
37 |
|
T |
38 |
|
|
39 |
*/ |
|
40 |
|
|
41 |
$form["title"] = "FTP User"; |
|
42 |
$form["description"] = ""; |
|
43 |
$form["name"] = "ftp_user"; |
|
44 |
$form["action"] = "ftp_user_edit.php"; |
|
45 |
$form["db_table"] = "ftp_user"; |
|
46 |
$form["db_table_idx"] = "ftp_user_id"; |
|
47 |
$form["db_history"] = "yes"; |
|
48 |
$form["tab_default"] = "ftp"; |
|
49 |
$form["list_default"] = "ftp_user_list.php"; |
|
50 |
$form["auth"] = 'yes'; // yes / no |
|
51 |
|
|
52 |
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user |
|
53 |
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user |
|
54 |
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete |
|
55 |
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete |
|
56 |
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete |
|
57 |
|
|
58 |
$form["tabs"]['ftp'] = array ( |
|
59 |
'title' => "FTP User", |
|
60 |
'width' => 100, |
|
61 |
'template' => "templates/ftp_user_edit.htm", |
|
62 |
'fields' => array ( |
|
63 |
################################## |
|
64 |
# Begin Datatable fields |
|
65 |
################################## |
|
66 |
'server_id' => array ( |
|
67 |
'datatype' => 'INTEGER', |
|
68 |
'formtype' => 'SELECT', |
|
69 |
'default' => '', |
|
70 |
'datasource' => array ( 'type' => 'SQL', |
9adcf5
|
71 |
'querystring' => 'SELECT server_id,server_name FROM server WHERE mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', |
18341e
|
72 |
'keyfield'=> 'server_id', |
T |
73 |
'valuefield'=> 'server_name' |
|
74 |
), |
|
75 |
'value' => '' |
|
76 |
), |
|
77 |
'parent_domain_id' => array ( |
|
78 |
'datatype' => 'INTEGER', |
|
79 |
'formtype' => 'SELECT', |
|
80 |
'default' => '', |
|
81 |
'datasource' => array ( 'type' => 'SQL', |
|
82 |
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain", |
|
83 |
'keyfield'=> 'domain_id', |
|
84 |
'valuefield'=> 'domain' |
|
85 |
), |
|
86 |
'value' => '' |
|
87 |
), |
|
88 |
'username' => array ( |
|
89 |
'datatype' => 'VARCHAR', |
|
90 |
'formtype' => 'TEXT', |
951880
|
91 |
'validators' => array ( 0 => array ( 'type' => 'UNIQUE', |
18341e
|
92 |
'errmsg'=> 'username_error_unique'), |
951880
|
93 |
1 => array ( 'type' => 'REGEX', |
T |
94 |
'regex' => '/^[\w\.\-]{0,64}$/', |
18341e
|
95 |
'errmsg'=> 'username_error_regex'), |
T |
96 |
), |
|
97 |
'default' => '', |
|
98 |
'value' => '', |
|
99 |
'width' => '30', |
4c28d9
|
100 |
'maxlength' => '255', |
F |
101 |
'searchable' => 1 |
18341e
|
102 |
), |
T |
103 |
'password' => array ( |
|
104 |
'datatype' => 'VARCHAR', |
|
105 |
'formtype' => 'PASSWORD', |
e2d6ed
|
106 |
'encryption' => 'CRYPT', |
18341e
|
107 |
'default' => '', |
T |
108 |
'value' => '', |
|
109 |
'width' => '30', |
|
110 |
'maxlength' => '255' |
|
111 |
), |
|
112 |
'quota_size' => array ( |
|
113 |
'datatype' => 'INTEGER', |
|
114 |
'formtype' => 'TEXT', |
|
115 |
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', |
|
116 |
'errmsg'=> 'quota_size_error_empty'), |
1ca823
|
117 |
1 => array ( 'type' => 'REGEX', |
T |
118 |
'regex' => '/^(\-1|[0-9]{1,10})$/', |
|
119 |
'errmsg'=> 'quota_size_error_regex'), |
18341e
|
120 |
), |
T |
121 |
'default' => '-1', |
|
122 |
'value' => '', |
|
123 |
'width' => '7', |
|
124 |
'maxlength' => '7' |
|
125 |
), |
|
126 |
'active' => array ( |
|
127 |
'datatype' => 'VARCHAR', |
|
128 |
'formtype' => 'CHECKBOX', |
|
129 |
'default' => 'y', |
|
130 |
'value' => array(0 => 'n',1 => 'y') |
|
131 |
), |
|
132 |
################################## |
|
133 |
# ENDE Datatable fields |
|
134 |
################################## |
|
135 |
) |
|
136 |
); |
|
137 |
|
03bca9
|
138 |
if($app->auth->is_admin()) { |
18341e
|
139 |
|
T |
140 |
$form["tabs"]['advanced'] = array ( |
086696
|
141 |
'title' => "Options", |
M |
142 |
'width' => 100, |
|
143 |
'template' => "templates/ftp_user_advanced.htm", |
|
144 |
'fields' => array ( |
|
145 |
################################## |
|
146 |
# Begin Datatable fields |
|
147 |
################################## |
|
148 |
'uid' => array ( |
|
149 |
'datatype' => 'VARCHAR', |
|
150 |
'formtype' => 'TEXT', |
|
151 |
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', |
|
152 |
'errmsg'=> 'uid_error_empty'), |
|
153 |
), |
|
154 |
'default' => '0', |
|
155 |
'value' => '', |
|
156 |
'width' => '30', |
|
157 |
'maxlength' => '255' |
|
158 |
), |
|
159 |
'gid' => array ( |
|
160 |
'datatype' => 'VARCHAR', |
|
161 |
'formtype' => 'TEXT', |
|
162 |
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', |
a93288
|
163 |
'errmsg'=> 'gid_error_empty'), |
086696
|
164 |
), |
M |
165 |
'default' => '0', |
|
166 |
'value' => '', |
|
167 |
'width' => '30', |
|
168 |
'maxlength' => '255' |
|
169 |
), |
|
170 |
'dir' => array ( |
|
171 |
'datatype' => 'VARCHAR', |
|
172 |
'formtype' => 'TEXT', |
|
173 |
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', |
|
174 |
'errmsg'=> 'directory_error_empty'), |
|
175 |
), |
|
176 |
'default' => '', |
|
177 |
'value' => '', |
|
178 |
'width' => '30', |
|
179 |
'maxlength' => '255' |
|
180 |
), |
|
181 |
'quota_files' => array ( |
|
182 |
'datatype' => 'INTEGER', |
|
183 |
'formtype' => 'TEXT', |
|
184 |
'default' => '0', |
|
185 |
'value' => '', |
|
186 |
'width' => '7', |
|
187 |
'maxlength' => '7' |
|
188 |
), |
|
189 |
'ul_ratio' => array ( |
|
190 |
'datatype' => 'INTEGER', |
|
191 |
'formtype' => 'TEXT', |
|
192 |
'default' => '0', |
|
193 |
'value' => '', |
|
194 |
'width' => '7', |
|
195 |
'maxlength' => '7' |
|
196 |
), |
|
197 |
'dl_ratio' => array ( |
|
198 |
'datatype' => 'INTEGER', |
|
199 |
'formtype' => 'TEXT', |
|
200 |
'default' => '0', |
|
201 |
'value' => '', |
|
202 |
'width' => '7', |
|
203 |
'maxlength' => '7' |
|
204 |
), |
|
205 |
'ul_bandwidth' => array ( |
|
206 |
'datatype' => 'INTEGER', |
|
207 |
'formtype' => 'TEXT', |
|
208 |
'default' => '0', |
|
209 |
'value' => '', |
|
210 |
'width' => '7', |
|
211 |
'maxlength' => '7' |
|
212 |
), |
|
213 |
'dl_bandwidth' => array ( |
|
214 |
'datatype' => 'INTEGER', |
|
215 |
'formtype' => 'TEXT', |
|
216 |
'default' => '0', |
|
217 |
'value' => '', |
|
218 |
'width' => '7', |
|
219 |
'maxlength' => '7' |
|
220 |
), |
|
221 |
################################## |
|
222 |
# ENDE Datatable fields |
|
223 |
################################## |
|
224 |
) |
|
225 |
); |
|
226 |
|
|
227 |
} else { |
|
228 |
|
|
229 |
$form["tabs"]['advanced'] = array ( |
|
230 |
'title' => "Options", |
|
231 |
'width' => 100, |
|
232 |
'template' => "templates/ftp_user_advanced_client.htm", |
|
233 |
'fields' => array ( |
|
234 |
################################## |
|
235 |
# Begin Datatable fields |
|
236 |
################################## |
|
237 |
'dir' => array ( |
|
238 |
'datatype' => 'VARCHAR', |
|
239 |
'formtype' => 'TEXT', |
|
240 |
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', |
|
241 |
'errmsg'=> 'directory_error_empty'), |
|
242 |
1 => array ( 'type' => 'CUSTOM', |
|
243 |
'class' => 'validate_ftpuser', |
|
244 |
'function' => 'ftp_dir', |
|
245 |
'errmsg' => 'directory_error_notinweb'), |
|
246 |
), |
|
247 |
'default' => '', |
|
248 |
'value' => '', |
|
249 |
'width' => '30', |
|
250 |
'maxlength' => '255' |
|
251 |
), |
|
252 |
################################## |
|
253 |
# ENDE Datatable fields |
|
254 |
################################## |
|
255 |
) |
18341e
|
256 |
); |
T |
257 |
|
|
258 |
} |
|
259 |
|
|
260 |
|
086696
|
261 |
|
18341e
|
262 |
?> |