1 |
diff -urN smeserver-zarafa-0.9.0.orig/createlinks smeserver-zarafa-0.9.0/createlinks |
2 |
--- smeserver-zarafa-0.9.0.orig/createlinks 2009-06-01 21:07:05.000000000 +1000 |
3 |
+++ smeserver-zarafa-0.9.0/createlinks 2009-06-01 21:11:39.000000000 +1000 |
4 |
@@ -4,6 +4,9 @@ |
5 |
use File::Basename; |
6 |
use File::Path; |
7 |
|
8 |
+panel_link("zarafaCFG", 'manager'); |
9 |
+panel_link("zarafaUI", 'manager'); |
10 |
+ |
11 |
#we use S99 as on first run it must run after S99mysql.init |
12 |
service_link_enhanced("zarafa-gateway", "S99", "7"); |
13 |
service_link_enhanced("zarafa-ical", "S99", "7"); |
14 |
diff -urN smeserver-zarafa-0.9.0.orig/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/zarafaCFG smeserver-zarafa-0.9.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/zarafaCFG |
15 |
--- smeserver-zarafa-0.9.0.orig/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/zarafaCFG 1970-01-01 10:00:00.000000000 +1000 |
16 |
+++ smeserver-zarafa-0.9.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/zarafaCFG 2009-06-01 21:15:33.000000000 +1000 |
17 |
@@ -0,0 +1,223 @@ |
18 |
+<lexicon lang="en-us"> |
19 |
+ |
20 |
+ <entry> |
21 |
+ <base>ZARAFA_CFG_MANAGEMENT</base> |
22 |
+ <trans>Configuration</trans> |
23 |
+ </entry> |
24 |
+ |
25 |
+ <entry> |
26 |
+ <base>FORM_TITLE</base> |
27 |
+ <trans>Zarafa mail server configuration</trans> |
28 |
+ </entry> |
29 |
+ |
30 |
+ <entry> |
31 |
+ <base>SOFTDELETE</base> |
32 |
+ <trans>Soft-delete lifetime adjustment</trans> |
33 |
+ </entry> |
34 |
+ |
35 |
+ <entry> |
36 |
+ <base>CFG_BUTTON</base> |
37 |
+ <trans>Server configuration</trans> |
38 |
+ </entry> |
39 |
+ |
40 |
+ <entry> |
41 |
+ <base>KEY_BUTTON</base> |
42 |
+ <trans>Activation/Add a CAL</trans> |
43 |
+ </entry> |
44 |
+ |
45 |
+ <entry> |
46 |
+ <base>MYSQL_BUTTON</base> |
47 |
+ <trans>MySQL adjustment</trans> |
48 |
+ </entry> |
49 |
+ |
50 |
+ <entry> |
51 |
+ <base>CACHE_CELL_SIZE</base> |
52 |
+ <trans>Cache Cell size adjustment</trans> |
53 |
+ </entry> |
54 |
+ |
55 |
+ <entry> |
56 |
+ <base>CACHE_OBJECT_SIZE</base> |
57 |
+ <trans>Cache Object size adjustment</trans> |
58 |
+ </entry> |
59 |
+ |
60 |
+ <entry> |
61 |
+ <base>CACHE_INDEX_SIZE</base> |
62 |
+ <trans>Cache Index size adjustment</trans> |
63 |
+ </entry> |
64 |
+ |
65 |
+ <entry> |
66 |
+ <base>QUOTA_WARN</base> |
67 |
+ <trans>Warning Quota adjustment</trans> |
68 |
+ </entry> |
69 |
+ |
70 |
+ <entry> |
71 |
+ <base>QUOTA_SOFT</base> |
72 |
+ <trans>Soft Quota adjustmen</trans> |
73 |
+ </entry> |
74 |
+ |
75 |
+ <entry> |
76 |
+ <base>QUOTA_HARD</base> |
77 |
+ <trans>Hard Quota adjustmen</trans> |
78 |
+ </entry> |
79 |
+ |
80 |
+ <entry> |
81 |
+ <base>COMPANYQUOTA_WARN</base> |
82 |
+ <trans>Company Quota adjustment</trans> |
83 |
+ </entry> |
84 |
+ |
85 |
+ <entry> |
86 |
+ <base>VERSION</base> |
87 |
+ <trans>Zarafa version :</trans> |
88 |
+ </entry> |
89 |
+ |
90 |
+ <entry> |
91 |
+ <base>SYS_AUTH</base> |
92 |
+ <trans>Database System :</trans> |
93 |
+ </entry> |
94 |
+ |
95 |
+ <entry> |
96 |
+ <base>REGISTERED</base> |
97 |
+ <trans>Registered version</trans> |
98 |
+ </entry> |
99 |
+ |
100 |
+ <entry> |
101 |
+ <base>UNREGISTERED</base> |
102 |
+ <trans>Community version</trans> |
103 |
+ </entry> |
104 |
+ |
105 |
+ <entry> |
106 |
+ <base>MAX_USERS</base> |
107 |
+ <trans>Maximum users :</trans> |
108 |
+ </entry> |
109 |
+ |
110 |
+ <entry> |
111 |
+ <base>MODIFY_BUTTON</base> |
112 |
+ <trans>Modify</trans> |
113 |
+ </entry> |
114 |
+ |
115 |
+ <entry> |
116 |
+ <base>CD_KEY</base> |
117 |
+ <trans>CD-key :</trans> |
118 |
+ </entry> |
119 |
+ |
120 |
+ <entry> |
121 |
+ <base>NBRUSERTXT</base> |
122 |
+ <trans>Maximum users :</trans> |
123 |
+ </entry> |
124 |
+ |
125 |
+ <entry> |
126 |
+ <base>CALNAME</base> |
127 |
+ <trans>CAL file name</trans> |
128 |
+ </entry> |
129 |
+ |
130 |
+ <entry> |
131 |
+ <base>CALKEY</base> |
132 |
+ <trans>Registered CD-Key</trans> |
133 |
+ </entry> |
134 |
+ |
135 |
+ <entry> |
136 |
+ <base>CAL_BUTTON</base> |
137 |
+ <trans>Add a CAL</trans> |
138 |
+ </entry> |
139 |
+ |
140 |
+ <entry> |
141 |
+ <base>MODIFY_CONFIG_SUCCESS</base> |
142 |
+ <trans>Config modified !</trans> |
143 |
+ </entry> |
144 |
+ |
145 |
+ <entry> |
146 |
+ <base>CFG_BUTTON_BUBBLE</base> |
147 |
+ <trans>Clic here to configure some aspect of Zarafa server</trans> |
148 |
+ </entry> |
149 |
+ |
150 |
+ <entry> |
151 |
+ <base>KEY_BUTTON_BUBBLE</base> |
152 |
+ <trans>Clic here if you want to activate your version of Zarafa or to add some CAL</trans> |
153 |
+ </entry> |
154 |
+ |
155 |
+ <entry> |
156 |
+ <base>MYSQL_BUTTON_BUBBLE</base> |
157 |
+ <trans>Clic here to configure some aspect of MySQL in Zarafa</trans> |
158 |
+ </entry> |
159 |
+ |
160 |
+ <entry> |
161 |
+ <base>CAL_BUTTON_BUBBLE</base> |
162 |
+ <trans>Clic here to add a CAL</trans> |
163 |
+ </entry> |
164 |
+ |
165 |
+ <entry> |
166 |
+ <base>INVALID_KEY</base> |
167 |
+ <trans>Invalid CD-Key. It must be composed by 24 alphanumeric characters.</trans> |
168 |
+ </entry> |
169 |
+ |
170 |
+ <entry> |
171 |
+ <base>CREATE_BUTTON</base> |
172 |
+ <trans>Add a key</trans> |
173 |
+ </entry> |
174 |
+ |
175 |
+ <entry> |
176 |
+ <base>EXIST_CALNAME</base> |
177 |
+ <trans>The filename is already use in another CAL. Please choose another.</trans> |
178 |
+ </entry> |
179 |
+ |
180 |
+ <entry> |
181 |
+ <base>EXIST_CALKEY</base> |
182 |
+ <trans>This key is already use in another CAL. Please enter another.</trans> |
183 |
+ </entry> |
184 |
+ |
185 |
+ <entry> |
186 |
+ <base>CAUTION_TIME</base> |
187 |
+ <trans>CAUTION - This operation may take 1 minutes or more because Zarafa's services must be restarted.</trans> |
188 |
+ </entry> |
189 |
+ |
190 |
+ <entry> |
191 |
+ <base>INSERT_CAL_NAME</base> |
192 |
+ <trans>CAL namefile</trans> |
193 |
+ </entry> |
194 |
+ |
195 |
+ <entry> |
196 |
+ <base>INSERT_CAL_KEY</base> |
197 |
+ <trans>CAL key</trans> |
198 |
+ </entry> |
199 |
+ |
200 |
+ <entry> |
201 |
+ <base>CLEF_CD</base> |
202 |
+ <trans>Enter the CD-key</trans> |
203 |
+ </entry> |
204 |
+ |
205 |
+ <entry> |
206 |
+ <base>BUFFER_POOL_SIZE</base> |
207 |
+ <trans>Buffer pool size</trans> |
208 |
+ </entry> |
209 |
+ |
210 |
+ <entry> |
211 |
+ <base>ADDITIONAL_MEM_POOL_SIZE</base> |
212 |
+ <trans>Additionnal memory pool size</trans> |
213 |
+ </entry> |
214 |
+ |
215 |
+ <entry> |
216 |
+ <base>LOG_FILE_SIZE</base> |
217 |
+ <trans>Log file size</trans> |
218 |
+ </entry> |
219 |
+ |
220 |
+ <entry> |
221 |
+ <base>LOG_BUFFER_SIZE</base> |
222 |
+ <trans>Log file size</trans> |
223 |
+ </entry> |
224 |
+ |
225 |
+ <entry> |
226 |
+ <base>NO_MODIFICATION_ASKED</base> |
227 |
+ <trans>No modification have been asked.</trans> |
228 |
+ </entry> |
229 |
+ |
230 |
+ <entry> |
231 |
+ <base>NOT_NUM</base> |
232 |
+ <trans>Some characteres are not numeric characters.</trans> |
233 |
+ </entry> |
234 |
+ |
235 |
+ <entry> |
236 |
+ <base>GREETING</base> |
237 |
+ <trans><![CDATA[ <br><b>Contrib developped by <a href="mailto:lucas.marcadieu@gmail.com">Marcadieu Lucas</a> and <a href="mailto:mk@ati-informatique.net">Kelkermans Marc</a>.</b>]]></trans> |
238 |
+ </entry> |
239 |
+ |
240 |
+</lexicon> |
241 |
\ No newline at end of file |
242 |
diff -urN smeserver-zarafa-0.9.0.orig/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/zarafaUI smeserver-zarafa-0.9.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/zarafaUI |
243 |
--- smeserver-zarafa-0.9.0.orig/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/zarafaUI 1970-01-01 10:00:00.000000000 +1000 |
244 |
+++ smeserver-zarafa-0.9.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/zarafaUI 2009-06-01 21:15:33.000000000 +1000 |
245 |
@@ -0,0 +1,273 @@ |
246 |
+<lexicon lang="en-us"> |
247 |
+ |
248 |
+ <entry> |
249 |
+ <base>USER_GROUP_MANAGEMENT</base> |
250 |
+ <trans>Management</trans> |
251 |
+ </entry> |
252 |
+ |
253 |
+ <entry> |
254 |
+ <base>FORM_TITLE</base> |
255 |
+ <trans><![CDATA[Users and groups management for Zarafa<br>]]></trans> |
256 |
+ </entry> |
257 |
+ |
258 |
+ <entry> |
259 |
+ <base>ADD_USER</base> |
260 |
+ <trans>Add an user</trans> |
261 |
+ </entry> |
262 |
+ |
263 |
+ <entry> |
264 |
+ <base>ADD_USER_BUBBLE</base> |
265 |
+ <trans>Click here to add an user</trans> |
266 |
+ </entry> |
267 |
+ |
268 |
+ <entry> |
269 |
+ <base>ADD_GROUP</base> |
270 |
+ <trans>Add a group</trans> |
271 |
+ </entry> |
272 |
+ |
273 |
+ <entry> |
274 |
+ <base>ADD_GROUP_BUBBLE</base> |
275 |
+ <trans>Click here to add a group</trans> |
276 |
+ </entry> |
277 |
+ |
278 |
+ <entry> |
279 |
+ <base>USERNAME</base> |
280 |
+ <trans>Username : </trans> |
281 |
+ </entry> |
282 |
+ |
283 |
+ <entry> |
284 |
+ <base>FULLNAME</base> |
285 |
+ <trans>Fullname : </trans> |
286 |
+ </entry> |
287 |
+ |
288 |
+ <entry> |
289 |
+ <base>DELETE</base> |
290 |
+ <trans>Delete</trans> |
291 |
+ </entry> |
292 |
+ |
293 |
+ <entry> |
294 |
+ <base>DETAILS</base> |
295 |
+ <trans>User's details : </trans> |
296 |
+ </entry> |
297 |
+ |
298 |
+ <entry> |
299 |
+ <base>STOCK_USE</base> |
300 |
+ <trans>Current store size : </trans> |
301 |
+ </entry> |
302 |
+ |
303 |
+ <entry> |
304 |
+ <base>ACTIVE_USER</base> |
305 |
+ <trans>Active user : </trans> |
306 |
+ </entry> |
307 |
+ |
308 |
+ <entry> |
309 |
+ <base>ACTIVE_CREATE</base> |
310 |
+ <trans>User : </trans> |
311 |
+ </entry> |
312 |
+ |
313 |
+ <entry> |
314 |
+ <base>EMAILADDRESS</base> |
315 |
+ <trans>Email Address : </trans> |
316 |
+ </entry> |
317 |
+ |
318 |
+ <entry> |
319 |
+ <base>ADMIN</base> |
320 |
+ <trans>Is the user an admin ?</trans> |
321 |
+ </entry> |
322 |
+ |
323 |
+ <entry> |
324 |
+ <base>AUTO_ACCEPT_MEETING</base> |
325 |
+ <trans>Accept auto meeting request ?</trans> |
326 |
+ </entry> |
327 |
+ |
328 |
+ <entry> |
329 |
+ <base>DECLINE_DLB_REQ</base> |
330 |
+ <trans>Decline dlb meeting request ?</trans> |
331 |
+ </entry> |
332 |
+ |
333 |
+ <entry> |
334 |
+ <base>DECLINE_RECUR_REQ</base> |
335 |
+ <trans>Decline reccur meeting request ?</trans> |
336 |
+ </entry> |
337 |
+ |
338 |
+ <entry> |
339 |
+ <base>QUOTA_OVERR</base> |
340 |
+ <trans>Set quota override ?</trans> |
341 |
+ </entry> |
342 |
+ |
343 |
+ <entry> |
344 |
+ <base>WARN_LVL</base> |
345 |
+ <trans>Warning level (unit is Mo) : </trans> |
346 |
+ </entry> |
347 |
+ |
348 |
+ <entry> |
349 |
+ <base>SOFT_LVL</base> |
350 |
+ <trans>Soft level (unit is Mo) : </trans> |
351 |
+ </entry> |
352 |
+ |
353 |
+ <entry> |
354 |
+ <base>HARD_LVL</base> |
355 |
+ <trans>Hard level (unit is Mo) : </trans> |
356 |
+ </entry> |
357 |
+ |
358 |
+ <entry> |
359 |
+ <base>PASSWORD</base> |
360 |
+ <trans>Password : </trans> |
361 |
+ </entry> |
362 |
+ |
363 |
+ <entry> |
364 |
+ <base>CHANGE_PSSWD</base> |
365 |
+ <trans>New password (optional) : </trans> |
366 |
+ </entry> |
367 |
+ |
368 |
+ <entry> |
369 |
+ <base>MODIFY_BUTTON</base> |
370 |
+ <trans>Modify</trans> |
371 |
+ </entry> |
372 |
+ |
373 |
+ <entry> |
374 |
+ <base>CREATE_BUTTON</base> |
375 |
+ <trans>Create</trans> |
376 |
+ </entry> |
377 |
+ |
378 |
+ <entry> |
379 |
+ <base>DELETE_BUTTON</base> |
380 |
+ <trans>Delete</trans> |
381 |
+ </entry> |
382 |
+ |
383 |
+ <entry> |
384 |
+ <base>MODIFY_USER_SUCCESS</base> |
385 |
+ <trans>User's modified</trans> |
386 |
+ </entry> |
387 |
+ |
388 |
+ <entry> |
389 |
+ <base>CREATE_USER_SUCCESS</base> |
390 |
+ <trans>User's created</trans> |
391 |
+ </entry> |
392 |
+ |
393 |
+ <entry> |
394 |
+ <base>DELETE_USER_SUCCESS</base> |
395 |
+ <trans>User's deleted</trans> |
396 |
+ </entry> |
397 |
+ |
398 |
+ <entry> |
399 |
+ <base>CREATE_GROUP_SUCCESS</base> |
400 |
+ <trans>Group's created</trans> |
401 |
+ </entry> |
402 |
+ |
403 |
+ <entry> |
404 |
+ <base>DELETE_USER_TXT</base> |
405 |
+ <trans>Do you really want to delete this user ?</trans> |
406 |
+ </entry> |
407 |
+ |
408 |
+ <entry> |
409 |
+ <base>GROUP_NAME</base> |
410 |
+ <trans>Group name : </trans> |
411 |
+ </entry> |
412 |
+ |
413 |
+ <entry> |
414 |
+ <base>DELETE_GROUP_TXT</base> |
415 |
+ <trans>Do you really want to delete this group ?</trans> |
416 |
+ </entry> |
417 |
+ |
418 |
+ <entry> |
419 |
+ <base>GROUP_TEXT_DISPLAY</base> |
420 |
+ <trans>Groups list</trans> |
421 |
+ </entry> |
422 |
+ |
423 |
+ <entry> |
424 |
+ <base>CHECKED_YES</base> |
425 |
+ <trans>Yes</trans> |
426 |
+ </entry> |
427 |
+ |
428 |
+ <entry> |
429 |
+ <base>CHECKED_NO</base> |
430 |
+ <trans>No</trans> |
431 |
+ </entry> |
432 |
+ |
433 |
+ <entry> |
434 |
+ <base>GROUP_NAME_ARRAY</base> |
435 |
+ <trans>Group name</trans> |
436 |
+ </entry> |
437 |
+ |
438 |
+ <entry> |
439 |
+ <base>DELETE_GROUP_SUCCESS</base> |
440 |
+ <trans>Group deleted</trans> |
441 |
+ </entry> |
442 |
+ |
443 |
+ <entry> |
444 |
+ <base>MODIFY_GROUP_TEXT</base> |
445 |
+ <trans>Group's users modification</trans> |
446 |
+ </entry> |
447 |
+ |
448 |
+ <entry> |
449 |
+ <base>MODIFY_GROUP_SUCCESS</base> |
450 |
+ <trans>Group modified</trans> |
451 |
+ </entry> |
452 |
+ |
453 |
+ <entry> |
454 |
+ <base>EXIST_GROUP</base> |
455 |
+ <trans>Existing group : </trans> |
456 |
+ </entry> |
457 |
+ |
458 |
+ <entry> |
459 |
+ <base>FULLNAME_VERIF_ERROR</base> |
460 |
+ <trans>The fullname is not a correct fullname. It may contain only alphabetical letters and/or interval.</trans> |
461 |
+ </entry> |
462 |
+ |
463 |
+ <entry> |
464 |
+ <base>MY_PASSWORD_VERIF_ERROR</base> |
465 |
+ <trans>The password is not a correct password. It may contain only alphanumeric characters and at least six characters.</trans> |
466 |
+ </entry> |
467 |
+ |
468 |
+ <entry> |
469 |
+ <base>QUOTA_TEST_VERIF_ERROR</base> |
470 |
+ <trans>The quota limit is not a correct quota. A correct quota limit is an numeric value.</trans> |
471 |
+ </entry> |
472 |
+ |
473 |
+ <entry> |
474 |
+ <base>SOFT_INF_WARN</base> |
475 |
+ <trans>This quota limit can't be inferior or equal to the warning level quota.</trans> |
476 |
+ </entry> |
477 |
+ |
478 |
+ <entry> |
479 |
+ <base>HARD_INF_OTHER</base> |
480 |
+ <trans>This quota limit can't be inferior or equal to the soft level quota.</trans> |
481 |
+ </entry> |
482 |
+ |
483 |
+ <entry> |
484 |
+ <base>MULTIPLE_USERNAME</base> |
485 |
+ <trans>This username is already taken by another user, please choose another.</trans> |
486 |
+ </entry> |
487 |
+ |
488 |
+ <entry> |
489 |
+ <base>MULTIPLE_EMAIL</base> |
490 |
+ <trans>This email address is already taken by another user, please choose another.</trans> |
491 |
+ </entry> |
492 |
+ |
493 |
+ <entry> |
494 |
+ <base>MULTIPLE_GROUPNAME</base> |
495 |
+ <trans>This group name is already taken, please choose another.</trans> |
496 |
+ </entry> |
497 |
+ |
498 |
+ <entry> |
499 |
+ <base>FALSE_USERNAME</base> |
500 |
+ <trans>The username is not a correct fullname. It may contain only alphabetical letters, intervals, points or coma.</trans> |
501 |
+ </entry> |
502 |
+ |
503 |
+ <entry> |
504 |
+ <base>DISABLED</base> |
505 |
+ <trans>Disabled</trans> |
506 |
+ </entry> |
507 |
+ |
508 |
+ <entry> |
509 |
+ <base>ENABLED</base> |
510 |
+ <trans>Enabled</trans> |
511 |
+ </entry> |
512 |
+ |
513 |
+ <entry> |
514 |
+ <base>GREETING</base> |
515 |
+ <trans><![CDATA[ <br><b>Contrib developped by <a href="mailto:lucas.marcadieu@gmail.com">Marcadieu Lucas</a> and <a href="mailto:mk@ati-informatique.net">Kelkermans Marc</a>.</b>]]></trans> |
516 |
+ </entry> |
517 |
+ |
518 |
+</lexicon> |
519 |
\ No newline at end of file |
520 |
diff -urN smeserver-zarafa-0.9.0.orig/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/zarafaCFG smeserver-zarafa-0.9.0/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/zarafaCFG |
521 |
--- smeserver-zarafa-0.9.0.orig/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/zarafaCFG 1970-01-01 10:00:00.000000000 +1000 |
522 |
+++ smeserver-zarafa-0.9.0/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/zarafaCFG 2009-06-01 21:15:33.000000000 +1000 |
523 |
@@ -0,0 +1,238 @@ |
524 |
+<lexicon lang="fr"> |
525 |
+ |
526 |
+ <entry> |
527 |
+ <base>ZARAFA_CFG_MANAGEMENT</base> |
528 |
+ <trans>Serveur</trans> |
529 |
+ </entry> |
530 |
+ |
531 |
+ <entry> |
532 |
+ <base>FORM_TITLE</base> |
533 |
+ <trans><![CDATA[Configuration du serveur Zarafa]]></trans> |
534 |
+ </entry> |
535 |
+ |
536 |
+ <entry> |
537 |
+ <base>SOFTDELETE</base> |
538 |
+ <trans>Réglage du soft-delete lifetime</trans> |
539 |
+ </entry> |
540 |
+ |
541 |
+ <entry> |
542 |
+ <base>CFG_BUTTON</base> |
543 |
+ <trans>Configuration serveur</trans> |
544 |
+ </entry> |
545 |
+ |
546 |
+ <entry> |
547 |
+ <base>KEY_BUTTON</base> |
548 |
+ <trans>Activation/Ajout de CAL</trans> |
549 |
+ </entry> |
550 |
+ |
551 |
+ <entry> |
552 |
+ <base>MYSQL_BUTTON</base> |
553 |
+ <trans>Réglages MySQL</trans> |
554 |
+ </entry> |
555 |
+ |
556 |
+ <entry> |
557 |
+ <base>CACHE_CELL_SIZE</base> |
558 |
+ <trans>Réglage de la taille du cache du noyau</trans> |
559 |
+ </entry> |
560 |
+ |
561 |
+ <entry> |
562 |
+ <base>CACHE_OBJECT_SIZE</base> |
563 |
+ <trans>Réglage de la taille du cache objet</trans> |
564 |
+ </entry> |
565 |
+ |
566 |
+ <entry> |
567 |
+ <base>CACHE_INDEX_SIZE</base> |
568 |
+ <trans>Réglage de la taille du cache l'index</trans> |
569 |
+ </entry> |
570 |
+ |
571 |
+ <entry> |
572 |
+ <base>QUOTA_WARN</base> |
573 |
+ <trans>Réglage du niveau du Warning Quota</trans> |
574 |
+ </entry> |
575 |
+ |
576 |
+ <entry> |
577 |
+ <base>QUOTA_SOFT</base> |
578 |
+ <trans>Réglage du niveau du Soft Quota</trans> |
579 |
+ </entry> |
580 |
+ |
581 |
+ <entry> |
582 |
+ <base>QUOTA_HARD</base> |
583 |
+ <trans>Réglage du niveau du Hard Quota</trans> |
584 |
+ </entry> |
585 |
+ |
586 |
+ <entry> |
587 |
+ <base>COMPANYQUOTA_WARN</base> |
588 |
+ <trans>Réglage du niveau de quota de companies</trans> |
589 |
+ </entry> |
590 |
+ |
591 |
+ <entry> |
592 |
+ <base>VERSION</base> |
593 |
+ <trans><![CDATA[<b>Version de Zarafa :]]></trans> |
594 |
+ </entry> |
595 |
+ |
596 |
+ <entry> |
597 |
+ <base>SYS_AUTH</base> |
598 |
+ <trans>Système de base de données :</trans> |
599 |
+ </entry> |
600 |
+ |
601 |
+ <entry> |
602 |
+ <base>REGISTERED</base> |
603 |
+ <trans>Version enregistrée</trans> |
604 |
+ </entry> |
605 |
+ |
606 |
+ <entry> |
607 |
+ <base>UNREGISTERED</base> |
608 |
+ <trans>Version communautaire</trans> |
609 |
+ </entry> |
610 |
+ |
611 |
+ <entry> |
612 |
+ <base>MAX_USERS</base> |
613 |
+ <trans><![CDATA[utilisateurs maximum.</b><br>]]></trans> |
614 |
+ </entry> |
615 |
+ |
616 |
+ <entry> |
617 |
+ <base>MODIFY_BUTTON</base> |
618 |
+ <trans>Modifier</trans> |
619 |
+ </entry> |
620 |
+ |
621 |
+ <entry> |
622 |
+ <base>CD_KEY</base> |
623 |
+ <trans>Serial :</trans> |
624 |
+ </entry> |
625 |
+ |
626 |
+ <entry> |
627 |
+ <base>NBRUSERTXT</base> |
628 |
+ <trans>utilisateurs maximum.</trans> |
629 |
+ </entry> |
630 |
+ |
631 |
+ <entry> |
632 |
+ <base>CALNAME</base> |
633 |
+ <trans>Nom du fichier CAL</trans> |
634 |
+ </entry> |
635 |
+ |
636 |
+ <entry> |
637 |
+ <base>CALKEY</base> |
638 |
+ <trans>Serial enregistré</trans> |
639 |
+ </entry> |
640 |
+ |
641 |
+ <entry> |
642 |
+ <base>CAL_BUTTON</base> |
643 |
+ <trans>Ajouter un CAL</trans> |
644 |
+ </entry> |
645 |
+ |
646 |
+ <entry> |
647 |
+ <base>MODIFY_CONFIG_SUCCESS</base> |
648 |
+ <trans>Modifications réussies !</trans> |
649 |
+ </entry> |
650 |
+ |
651 |
+ <entry> |
652 |
+ <base>CFG_BUTTON_BUBBLE</base> |
653 |
+ <trans>Cliquez ici pour configurer certain aspect de Zarafa</trans> |
654 |
+ </entry> |
655 |
+ |
656 |
+ <entry> |
657 |
+ <base>KEY_BUTTON_BUBBLE</base> |
658 |
+ <trans>Cliquez ici pour activer votre version de Zarafa ou pour rajouter des CAL</trans> |
659 |
+ </entry> |
660 |
+ |
661 |
+ <entry> |
662 |
+ <base>MYSQL_BUTTON_BUBBLE</base> |
663 |
+ <trans>Cliquez ici pour configurer certain aspect MySQL de Zarafa</trans> |
664 |
+ </entry> |
665 |
+ |
666 |
+ <entry> |
667 |
+ <base>CAL_BUTTON_BUBBLE</base> |
668 |
+ <trans>Cliquez ici pour ajouter un CAL</trans> |
669 |
+ </entry> |
670 |
+ |
671 |
+ <entry> |
672 |
+ <base>INVALID_KEY</base> |
673 |
+ <trans>Serial invalide. Il doit être obligatoirement composée de 24 caractéres alphanumériques.</trans> |
674 |
+ </entry> |
675 |
+ |
676 |
+ <entry> |
677 |
+ <base>CREATE_BUTTON</base> |
678 |
+ <trans>Ajouter Serial</trans> |
679 |
+ </entry> |
680 |
+ |
681 |
+ <entry> |
682 |
+ <base>EXIST_CALNAME</base> |
683 |
+ <trans>Le nom saisi est déjà  utilisé pour un autre CAL. Veuillez en choisir un autre.</trans> |
684 |
+ </entry> |
685 |
+ |
686 |
+ <entry> |
687 |
+ <base>EXIST_CALKEY</base> |
688 |
+ <trans>Le serial saisi est déjà  à utilisé dans un autre CAL. Veuillez en saisir un autre.</trans> |
689 |
+ </entry> |
690 |
+ |
691 |
+ <entry> |
692 |
+ <base>CAUTION_TIME</base> |
693 |
+ <trans><![CDATA[<b>ATTENTION - Les services Zarafa et MySQL doivent être redémarré.</b>]]></trans> |
694 |
+ </entry> |
695 |
+ |
696 |
+ <entry> |
697 |
+ <base>INSERT_CAL_NAME</base> |
698 |
+ <trans>Nom du fichier CAL</trans> |
699 |
+ </entry> |
700 |
+ |
701 |
+ <entry> |
702 |
+ <base>INSERT_CAL_KEY</base> |
703 |
+ <trans>Serial du CAL</trans> |
704 |
+ </entry> |
705 |
+ |
706 |
+ <entry> |
707 |
+ <base>CLEF_CD</base> |
708 |
+ <trans>Saisir le serial</trans> |
709 |
+ </entry> |
710 |
+ |
711 |
+ <entry> |
712 |
+ <base>BUFFER_POOL_SIZE</base> |
713 |
+ <trans>Taille du buffer pool</trans> |
714 |
+ </entry> |
715 |
+ |
716 |
+ <entry> |
717 |
+ <base>ADDITIONAL_MEM_POOL_SIZE</base> |
718 |
+ <trans>Taille de la mémoire additionel du pool</trans> |
719 |
+ </entry> |
720 |
+ |
721 |
+ <entry> |
722 |
+ <base>LOG_FILE_SIZE</base> |
723 |
+ <trans>Taille du fichier de log</trans> |
724 |
+ </entry> |
725 |
+ |
726 |
+ <entry> |
727 |
+ <base>LOG_BUFFER_SIZE</base> |
728 |
+ <trans>Taille du fichier log du buffer</trans> |
729 |
+ </entry> |
730 |
+ |
731 |
+ <entry> |
732 |
+ <base>NO_MODIFICATION_ASKED</base> |
733 |
+ <trans>Aucune modification n'a été demandé.</trans> |
734 |
+ </entry> |
735 |
+ |
736 |
+ <entry> |
737 |
+ <base>NOT_NUM</base> |
738 |
+ <trans>Les caractéres saisi ne sont pas tous des caractéres numériques.</trans> |
739 |
+ </entry> |
740 |
+ |
741 |
+ <entry> |
742 |
+ <base>MULTICOMP</base> |
743 |
+ <trans>Multi-companie </trans> |
744 |
+ </entry> |
745 |
+ |
746 |
+ <entry> |
747 |
+ <base>GLOBALFORWARD</base> |
748 |
+ <trans>Gobal Forward</trans> |
749 |
+ </entry> |
750 |
+ |
751 |
+ <entry> |
752 |
+ <base>ZARAFA_PLUGIN_CAUTION</base> |
753 |
+ <trans>Impossible de déterminer votre plugin</trans> |
754 |
+ </entry> |
755 |
+ |
756 |
+ <entry> |
757 |
+ <base>GREETING</base> |
758 |
+ <trans><![CDATA[ <br><b>Contrib developped by <a href="mailto:lucas.marcadieu@gmail.com">Marcadieu Lucas</a> and <a href="mailto:mk@ati-informatique.net">Kelkermans Marc</a>.</b>]]></trans> |
759 |
+ </entry> |
760 |
+ |
761 |
+</lexicon> |
762 |
\ No newline at end of file |
763 |
diff -urN smeserver-zarafa-0.9.0.orig/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/zarafaUI smeserver-zarafa-0.9.0/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/zarafaUI |
764 |
--- smeserver-zarafa-0.9.0.orig/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/zarafaUI 1970-01-01 10:00:00.000000000 +1000 |
765 |
+++ smeserver-zarafa-0.9.0/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/zarafaUI 2009-06-01 21:15:33.000000000 +1000 |
766 |
@@ -0,0 +1,284 @@ |
767 |
+<lexicon lang="fr"> |
768 |
+ |
769 |
+ <entry> |
770 |
+ <base>USER_GROUP_MANAGEMENT</base> |
771 |
+ <trans>Utilisateurs</trans> |
772 |
+ </entry> |
773 |
+ |
774 |
+ <entry> |
775 |
+ <base>FORM_TITLE</base> |
776 |
+ <trans><![CDATA[Gestion des utilisateurs et des groupes de Zarafa<br>]]></trans> |
777 |
+ </entry> |
778 |
+ |
779 |
+ <entry> |
780 |
+ <base>ADD_USER</base> |
781 |
+ <trans>Ajouter un utilisateur</trans> |
782 |
+ </entry> |
783 |
+ |
784 |
+ <entry> |
785 |
+ <base>ADD_USER_BUBBLE</base> |
786 |
+ <trans>Cliquez pour ajouter un utilisateur</trans> |
787 |
+ </entry> |
788 |
+ |
789 |
+ <entry> |
790 |
+ <base>ADD_GROUP</base> |
791 |
+ <trans>Ajouter un groupe</trans> |
792 |
+ </entry> |
793 |
+ |
794 |
+ <entry> |
795 |
+ <base>ADD_GROUP_BUBBLE</base> |
796 |
+ <trans>Cliquez pour ajouter un groupe</trans> |
797 |
+ </entry> |
798 |
+ |
799 |
+ <entry> |
800 |
+ <base>USERNAME</base> |
801 |
+ <trans>Nom utilisateur : </trans> |
802 |
+ </entry> |
803 |
+ |
804 |
+ <entry> |
805 |
+ <base>FULLNAME</base> |
806 |
+ <trans>Nom complet : </trans> |
807 |
+ </entry> |
808 |
+ |
809 |
+ <entry> |
810 |
+ <base>DELETE</base> |
811 |
+ <trans>Supprimer</trans> |
812 |
+ </entry> |
813 |
+ |
814 |
+ <entry> |
815 |
+ <base>DETAILS</base> |
816 |
+ <trans><![CDATA[<b>Détails de l'utilisateur : ]]></trans> |
817 |
+ </entry> |
818 |
+ |
819 |
+ <entry> |
820 |
+ <base>STOCK_USE</base> |
821 |
+ <trans>Espace de stockage utilisé : </trans> |
822 |
+ </entry> |
823 |
+ |
824 |
+ <entry> |
825 |
+ <base>ACTIVE_USER</base> |
826 |
+ <trans><![CDATA[<br>Utilisateur actif : ]]></trans> |
827 |
+ </entry> |
828 |
+ |
829 |
+ <entry> |
830 |
+ <base>ACTIVE_CREATE</base> |
831 |
+ <trans>Utilisateur : </trans> |
832 |
+ </entry> |
833 |
+ |
834 |
+ <entry> |
835 |
+ <base>EMAILADDRESS</base> |
836 |
+ <trans>Adresse internet : </trans> |
837 |
+ </entry> |
838 |
+ |
839 |
+ <entry> |
840 |
+ <base>ADMIN</base> |
841 |
+ <trans>L'utilisateur est-il un administrateur ?</trans> |
842 |
+ </entry> |
843 |
+ |
844 |
+ <entry> |
845 |
+ <base>AUTO_ACCEPT_MEETING</base> |
846 |
+ <trans>Accept auto meeting request ?</trans> |
847 |
+ </entry> |
848 |
+ |
849 |
+ <entry> |
850 |
+ <base>DECLINE_DLB_REQ</base> |
851 |
+ <trans>Decline dlb meeting request ?</trans> |
852 |
+ </entry> |
853 |
+ |
854 |
+ <entry> |
855 |
+ <base>DECLINE_RECUR_REQ</base> |
856 |
+ <trans>Decline reccur meeting request ?</trans> |
857 |
+ </entry> |
858 |
+ |
859 |
+ <entry> |
860 |
+ <base>QUOTA_OVERR</base> |
861 |
+ <trans>Mettre des quotas personalisés ?</trans> |
862 |
+ </entry> |
863 |
+ |
864 |
+ <entry> |
865 |
+ <base>WARN_LVL</base> |
866 |
+ <trans>Warning level (en Mo) : </trans> |
867 |
+ </entry> |
868 |
+ |
869 |
+ <entry> |
870 |
+ <base>SOFT_LVL</base> |
871 |
+ <trans>Soft level (en Mo) : </trans> |
872 |
+ </entry> |
873 |
+ |
874 |
+ <entry> |
875 |
+ <base>HARD_LVL</base> |
876 |
+ <trans>Hard level (en Mo) : </trans> |
877 |
+ </entry> |
878 |
+ |
879 |
+ <entry> |
880 |
+ <base>PASSWORD</base> |
881 |
+ <trans>Mot de passe : </trans> |
882 |
+ </entry> |
883 |
+ |
884 |
+ <entry> |
885 |
+ <base>CHANGE_PSSWD</base> |
886 |
+ <trans>Nouveau mot de passe (optionnel) : </trans> |
887 |
+ </entry> |
888 |
+ |
889 |
+ <entry> |
890 |
+ <base>MODIFY_BUTTON</base> |
891 |
+ <trans>Modifier</trans> |
892 |
+ </entry> |
893 |
+ |
894 |
+ <entry> |
895 |
+ <base>CREATE_BUTTON</base> |
896 |
+ <trans>Créer</trans> |
897 |
+ </entry> |
898 |
+ |
899 |
+ <entry> |
900 |
+ <base>DELETE_BUTTON</base> |
901 |
+ <trans>Supprimer</trans> |
902 |
+ </entry> |
903 |
+ |
904 |
+ <entry> |
905 |
+ <base>MODIFY_USER_SUCCESS</base> |
906 |
+ <trans>Utilisateur modifié</trans> |
907 |
+ </entry> |
908 |
+ |
909 |
+ <entry> |
910 |
+ <base>CREATE_USER_SUCCESS</base> |
911 |
+ <trans>Utilisateur créé</trans> |
912 |
+ </entry> |
913 |
+ |
914 |
+ <entry> |
915 |
+ <base>DELETE_USER_SUCCESS</base> |
916 |
+ <trans>Utilisateur supprimé</trans> |
917 |
+ </entry> |
918 |
+ |
919 |
+ <entry> |
920 |
+ <base>CREATE_GROUP_SUCCESS</base> |
921 |
+ <trans>Groupe créé</trans> |
922 |
+ </entry> |
923 |
+ |
924 |
+ <entry> |
925 |
+ <base>DELETE_USER_TXT</base> |
926 |
+ <trans>Voulez vous vraiment supprimer cet utilisateur ?</trans> |
927 |
+ </entry> |
928 |
+ |
929 |
+ <entry> |
930 |
+ <base>GROUP_NAME</base> |
931 |
+ <trans>Nom du groupe : </trans> |
932 |
+ </entry> |
933 |
+ |
934 |
+ <entry> |
935 |
+ <base>DELETE_GROUP_TXT</base> |
936 |
+ <trans>Voulez-vous vraiment supprimer ce groupe ?</trans> |
937 |
+ </entry> |
938 |
+ |
939 |
+ <entry> |
940 |
+ <base>GROUP_TEXT_DISPLAY</base> |
941 |
+ <trans>Liste des groupes</trans> |
942 |
+ </entry> |
943 |
+ |
944 |
+ <entry> |
945 |
+ <base>CHECKED_YES</base> |
946 |
+ <trans>Oui</trans> |
947 |
+ </entry> |
948 |
+ |
949 |
+ <entry> |
950 |
+ <base>CHECKED_NO</base> |
951 |
+ <trans>Non</trans> |
952 |
+ </entry> |
953 |
+ |
954 |
+ <entry> |
955 |
+ <base>GROUP_NAME_ARRAY</base> |
956 |
+ <trans>Nom du groupe</trans> |
957 |
+ </entry> |
958 |
+ |
959 |
+ <entry> |
960 |
+ <base>DELETE_GROUP_SUCCESS</base> |
961 |
+ <trans>Groupe supprimé</trans> |
962 |
+ </entry> |
963 |
+ |
964 |
+ <entry> |
965 |
+ <base>MODIFY_GROUP_TEXT</base> |
966 |
+ <trans><![CDATA[<b>Modification des utilisateurs du groupe]]></trans> |
967 |
+ </entry> |
968 |
+ |
969 |
+ <entry> |
970 |
+ <base>MODIFY_GROUP_SUCCESS</base> |
971 |
+ <trans>Groupe modifié</trans> |
972 |
+ </entry> |
973 |
+ |
974 |
+ <entry> |
975 |
+ <base>EXIST_GROUP</base> |
976 |
+ <trans>Groupes existant : </trans> |
977 |
+ </entry> |
978 |
+ |
979 |
+ <entry> |
980 |
+ <base>FULLNAME_VERIF_ERROR</base> |
981 |
+ <trans>Le nom d'utilisateur rentré n'est pas un nom valide. Il ne doit contenir que des lettres de l'alphabet, des espace, des points ou bien des tirets.</trans> |
982 |
+ </entry> |
983 |
+ |
984 |
+ <entry> |
985 |
+ <base>MY_PASSWORD_VERIF_ERROR</base> |
986 |
+ <trans>Le mot de passe saisi n'est pas considéré comme valide. Le mot de passe ne doit contenir que des caractéres alphanumérique et doit contenir au moins 6 caractéres.</trans> |
987 |
+ </entry> |
988 |
+ |
989 |
+ <entry> |
990 |
+ <base>QUOTA_TEST_VERIF_ERROR</base> |
991 |
+ <trans>La limite de quota saisi n'est pas valide. Une limite valide est une valeur numérique.</trans> |
992 |
+ </entry> |
993 |
+ |
994 |
+ <entry> |
995 |
+ <base>SOFT_INF_WARN</base> |
996 |
+ <trans>La limite de se quota ne peut être inférieur ou égale à la limite du warning level.</trans> |
997 |
+ </entry> |
998 |
+ |
999 |
+ <entry> |
1000 |
+ <base>HARD_INF_OTHER</base> |
1001 |
+ <trans>La limite de se quota ne peut être inférieur ou égale à la limite du soft level.</trans> |
1002 |
+ </entry> |
1003 |
+ |
1004 |
+ <entry> |
1005 |
+ <base>MULTIPLE_USERNAME</base> |
1006 |
+ <trans>Le nom d'utilisateur saisi est déja utilisé, veuillez en choisir un autre.</trans> |
1007 |
+ </entry> |
1008 |
+ |
1009 |
+ <entry> |
1010 |
+ <base>MULTIPLE_EMAIL</base> |
1011 |
+ <trans>L'email saisi est déjà utilisé par un autre utilisateur, veuillez en saisir un autre.</trans> |
1012 |
+ </entry> |
1013 |
+ |
1014 |
+ <entry> |
1015 |
+ <base>MULTIPLE_GROUPNAME</base> |
1016 |
+ <trans>Ce nom de groupe est djà utilisé, veuillez en saisir un autre.</trans> |
1017 |
+ </entry> |
1018 |
+ |
1019 |
+ <entry> |
1020 |
+ <base>FALSE_USERNAME</base> |
1021 |
+ <trans>Ce nom d'utilisateur n'est pas validable. Il ne doit contenir que des caractéres alphanumérique, des points ou encore des tirets</trans> |
1022 |
+ </entry> |
1023 |
+ |
1024 |
+ <entry> |
1025 |
+ <base>ENABLED</base> |
1026 |
+ <trans>Activé</trans> |
1027 |
+ </entry> |
1028 |
+ |
1029 |
+ <entry> |
1030 |
+ <base>DISABLED</base> |
1031 |
+ <trans>Désactivé</trans> |
1032 |
+ </entry> |
1033 |
+ |
1034 |
+ <entry> |
1035 |
+ <base>GREETING</base> |
1036 |
+ <trans><![CDATA[ <br><b>Contrib developped by <a href="mailto:lucas.marcadieu@gmail.com">Marcadieu Lucas</a> and <a href="mailto:mk@ati-informatique.net">Kelkermans Marc</a>.</b>]]></trans> |
1037 |
+ </entry> |
1038 |
+ |
1039 |
+ <entry> |
1040 |
+ <base>CAUTION_NOT_DB</base> |
1041 |
+ <trans><![CDATA[ ATTENTION ! L'utilisateur n'est pas dans la DB Serveur !</b><br><br>]]></trans> |
1042 |
+ </entry> |
1043 |
+ |
1044 |
+ |
1045 |
+ <entry> |
1046 |
+ <base>IN_DB</base> |
1047 |
+ <trans><![CDATA[ L'utilisateur est dans la DB Serveur</b> <br><br>]]></trans> |
1048 |
+ </entry> |
1049 |
+ |
1050 |
+</lexicon> |
1051 |
\ No newline at end of file |
1052 |
diff -urN smeserver-zarafa-0.9.0.orig/root/etc/e-smith/web/functions/zarafaCFG smeserver-zarafa-0.9.0/root/etc/e-smith/web/functions/zarafaCFG |
1053 |
--- smeserver-zarafa-0.9.0.orig/root/etc/e-smith/web/functions/zarafaCFG 1970-01-01 10:00:00.000000000 +1000 |
1054 |
+++ smeserver-zarafa-0.9.0/root/etc/e-smith/web/functions/zarafaCFG 2009-06-01 21:15:42.000000000 +1000 |
1055 |
@@ -0,0 +1,127 @@ |
1056 |
+#!/usr/bin/perl -wT |
1057 |
+ |
1058 |
+# vim: ts=4 sw=4 et: |
1059 |
+#---------------------------------------------------------------------- |
1060 |
+# heading : Zarafa |
1061 |
+# description : ZARAFA_CFG_MANAGEMENT |
1062 |
+# navigation : 2000 2200 |
1063 |
+#---------------------------------------------------------------------- |
1064 |
+ |
1065 |
+ use strict; |
1066 |
+ use warnings; |
1067 |
+ use esmith::FormMagick::Panel::zarafaCFG; |
1068 |
+ |
1069 |
+ my $f = esmith::FormMagick::Panel::zarafaCFG->new(); |
1070 |
+ $f->display(); |
1071 |
+ |
1072 |
+__DATA__ |
1073 |
+ <form |
1074 |
+ title="FORM_TITLE" |
1075 |
+ header="/etc/e-smith/web/common/head.tmpl" |
1076 |
+ footer="/etc/e-smith/web/common/foot.tmpl"> |
1077 |
+ |
1078 |
+ <page name="First" pre-event="print_status_message()"> |
1079 |
+ <subroutine src="display_buttons()" /> |
1080 |
+ <subroutine src="print_message('GREETING')" /> |
1081 |
+ </page> |
1082 |
+ |
1083 |
+ <page name="Config" pre-event="print_status_message()" post-event="modify_config()"> |
1084 |
+ |
1085 |
+ <subroutine src="display_config()" /> |
1086 |
+ |
1087 |
+ <field type="text" id="Softdelete" size="8" validation="nonblank"> |
1088 |
+ <label>SOFTDELETE</label> |
1089 |
+ </field> |
1090 |
+ |
1091 |
+ <field type="text" id="cache_cell" size="8" validation="nonblank"> |
1092 |
+ <label>CACHE_CELL_SIZE</label> |
1093 |
+ </field> |
1094 |
+ |
1095 |
+ <field type="text" id="cache_object" size="8" validation="nonblank"> |
1096 |
+ <label>CACHE_OBJECT_SIZE</label> |
1097 |
+ </field> |
1098 |
+ |
1099 |
+ <field type="text" id="cache_index" size="8" validation="nonblank"> |
1100 |
+ <label>CACHE_INDEX_SIZE</label> |
1101 |
+ </field> |
1102 |
+ |
1103 |
+ <field type="text" id="quota_warn" size="8"> |
1104 |
+ <label>QUOTA_WARN</label> |
1105 |
+ </field> |
1106 |
+ |
1107 |
+ <field type="text" id="quota_soft" size="8"> |
1108 |
+ <label>QUOTA_SOFT</label> |
1109 |
+ </field> |
1110 |
+ |
1111 |
+ <field type="text" id="quota_hard" size="8"> |
1112 |
+ <label>QUOTA_HARD</label> |
1113 |
+ </field> |
1114 |
+ |
1115 |
+ <field type="text" id="companyquota_warn" size="8"> |
1116 |
+ <label>COMPANYQUOTA_WARN</label> |
1117 |
+ </field> |
1118 |
+ |
1119 |
+ <subroutine src="display_modify_button()" /> |
1120 |
+ <subroutine src="print_message('GREETING')" /> |
1121 |
+ </page> |
1122 |
+ |
1123 |
+ <page name="KEYSNeed" pre-event="print_status_message()" post-event="add_cdkey()"> |
1124 |
+ |
1125 |
+ <description>CAUTION_TIME</description> |
1126 |
+ <field type="text" id="clef-cd" size="30" validation="nonblank, valid_keys"> |
1127 |
+ <label>CLEF_CD</label> |
1128 |
+ </field> |
1129 |
+ |
1130 |
+ <subroutine src="display_modify_button()" /> |
1131 |
+ <subroutine src="print_message('GREETING')" /> |
1132 |
+ </page> |
1133 |
+ |
1134 |
+ <page name="KEYSUNeed" pre-event="print_status_message()"> |
1135 |
+ |
1136 |
+ <subroutine src="display_key_info()" /> |
1137 |
+ <subroutine src="display_cal()" /> |
1138 |
+ <subroutine src="print_message('GREETING')" /> |
1139 |
+ </page> |
1140 |
+ |
1141 |
+ <page name="MYSQL" pre-event="print_status_message()" post-event="modify_mysql()"> |
1142 |
+ |
1143 |
+ <description>CAUTION_TIME</description> |
1144 |
+ |
1145 |
+ <subroutine src="display_value()" /> |
1146 |
+ |
1147 |
+ <field type="text" id="buffer_pool_size" size="10" validation="nonblank, only_num"> |
1148 |
+ <label>BUFFER_POOL_SIZE</label> |
1149 |
+ </field> |
1150 |
+ |
1151 |
+ <field type="text" id="additional_mem_pool_size" size="10" validation="nonblank, only_num"> |
1152 |
+ <label>ADDITIONAL_MEM_POOL_SIZE</label> |
1153 |
+ </field> |
1154 |
+ |
1155 |
+ <field type="text" id="log_file_size" size="10" validation="nonblank, only_num"> |
1156 |
+ <label>LOG_FILE_SIZE</label> |
1157 |
+ </field> |
1158 |
+ |
1159 |
+ <field type="text" id="log_buffer_size" size="10" validation="nonblank, only_num"> |
1160 |
+ <label>LOG_BUFFER_SIZE</label> |
1161 |
+ </field> |
1162 |
+ |
1163 |
+ <subroutine src="display_modify_button()" /> |
1164 |
+ <subroutine src="print_message('GREETING')" /> |
1165 |
+ </page> |
1166 |
+ |
1167 |
+ <page name="CreateCal" pre-event="print_status_message()" post-event="create_cal()"> |
1168 |
+ |
1169 |
+ <description>CAUTION_TIME</description> |
1170 |
+ <field type="text" id="user_name_cal" size="30" validation="nonblank, unique_name"> |
1171 |
+ <label>INSERT_CAL_NAME</label> |
1172 |
+ </field> |
1173 |
+ |
1174 |
+ <field type="text" id="user_key_cal" size="30" validation="nonblank, valid_cal, unique_key"> |
1175 |
+ <label>INSERT_CAL_KEY</label> |
1176 |
+ </field> |
1177 |
+ |
1178 |
+ <subroutine src="display_create_button()" /> |
1179 |
+ <subroutine src="print_message('GREETING')" /> |
1180 |
+ </page> |
1181 |
+ |
1182 |
+ </form> |
1183 |
\ No newline at end of file |
1184 |
diff -urN smeserver-zarafa-0.9.0.orig/root/etc/e-smith/web/functions/zarafaUI smeserver-zarafa-0.9.0/root/etc/e-smith/web/functions/zarafaUI |
1185 |
--- smeserver-zarafa-0.9.0.orig/root/etc/e-smith/web/functions/zarafaUI 1970-01-01 10:00:00.000000000 +1000 |
1186 |
+++ smeserver-zarafa-0.9.0/root/etc/e-smith/web/functions/zarafaUI 2009-06-01 21:15:42.000000000 +1000 |
1187 |
@@ -0,0 +1,193 @@ |
1188 |
+#!/usr/bin/perl -wT |
1189 |
+ |
1190 |
+# vim: ts=4 sw=4 et: |
1191 |
+#---------------------------------------------------------------------- |
1192 |
+# heading : Zarafa |
1193 |
+# description : USER_GROUP_MANAGEMENT |
1194 |
+# navigation : 2000 2150 |
1195 |
+#---------------------------------------------------------------------- |
1196 |
+ |
1197 |
+ use strict; |
1198 |
+ use warnings; |
1199 |
+ use esmith::FormMagick::Panel::zarafaUI; |
1200 |
+ |
1201 |
+ my $f = esmith::FormMagick::Panel::zarafaUI->new(); |
1202 |
+ $f->display(); |
1203 |
+ |
1204 |
+ __DATA__ |
1205 |
+ <form |
1206 |
+ title="FORM_TITLE" |
1207 |
+ header="/etc/e-smith/web/common/head.tmpl" |
1208 |
+ footer="/etc/e-smith/web/common/foot.tmpl"> |
1209 |
+ |
1210 |
+ <page name="First" pre-event="print_status_message()" |
1211 |
+ post-event="transfer_page()"> |
1212 |
+ <subroutine src="show_users()" /> |
1213 |
+ <subroutine src="show_group()" /> |
1214 |
+ <subroutine src="print_message('GREETING')" /> |
1215 |
+ </page> |
1216 |
+ |
1217 |
+ <page name="DisplayDetails" pre-event="turn_off_buttons()" |
1218 |
+ post-event="modify_user()"> |
1219 |
+ |
1220 |
+ <subroutine src="display_user_details()" /> |
1221 |
+ |
1222 |
+ <field type="text" id="Username" size="8" validation="nonblank, my_username, unique_username_modify"> |
1223 |
+ <label>USERNAME</label> |
1224 |
+ </field> |
1225 |
+ |
1226 |
+ <field type="text" id="Fullname" validation="nonblank, fullname"> |
1227 |
+ <label>FULLNAME</label> |
1228 |
+ </field> |
1229 |
+ |
1230 |
+ <field type="text" id="EmailAddress" size="30" validation="nonblank, email_simple, unique_email_modify"> |
1231 |
+ <label>EMAILADDRESS</label> |
1232 |
+ </field> |
1233 |
+ |
1234 |
+ <field type="select" id="Admin" options="'yes' => 'Oui', 'no' => 'Non'" validation="nonblank"> |
1235 |
+ <label>ADMIN</label> |
1236 |
+ </field> |
1237 |
+ |
1238 |
+ <field type="select" id="auto_meeting_req" options="'yes' => 'Oui', 'no' => 'Non'" validation="nonblank"> |
1239 |
+ <label>AUTO_ACCEPT_MEETING</label> |
1240 |
+ </field> |
1241 |
+ |
1242 |
+ <field type="select" id="dbl_meeting" options="'yes' => 'Oui', 'no' => 'Non'" validation="nonblank"> |
1243 |
+ <label>DECLINE_DLB_REQ</label> |
1244 |
+ </field> |
1245 |
+ |
1246 |
+ <field type="select" id="decline_recur_meeting" options="'yes' => 'Oui', 'no' => 'Non'" validation="nonblank"> |
1247 |
+ <label>DECLINE_RECUR_REQ</label> |
1248 |
+ </field> |
1249 |
+ |
1250 |
+ <field type="select" id="quota" options="'yes' => 'Oui', 'no' => 'Non'" validation="nonblank"> |
1251 |
+ <label>QUOTA_OVERR</label> |
1252 |
+ </field> |
1253 |
+ |
1254 |
+ <field type="text" id="Warnlvl" size="8" validation="quota_test"> |
1255 |
+ <label>WARN_LVL</label> |
1256 |
+ </field> |
1257 |
+ |
1258 |
+ <field type="text" id="Softlvl" size="8" validation="quota_test, sup_quota_inter"> |
1259 |
+ <label>SOFT_LVL</label> |
1260 |
+ </field> |
1261 |
+ |
1262 |
+ <field type="text" id="Hardlvl" size="8" validation="quota_test, sup_quota_hard"> |
1263 |
+ <label>HARD_LVL</label> |
1264 |
+ </field> |
1265 |
+ |
1266 |
+ <field type="password" id="new_password" validation="my_password(6)"> |
1267 |
+ <label>CHANGE_PSSWD</label> |
1268 |
+ </field> |
1269 |
+ |
1270 |
+ <subroutine src="display_user_groups()" /> |
1271 |
+ <subroutine src="display_modify_button()" /> |
1272 |
+ <subroutine src="print_message('GREETING')" /> |
1273 |
+ </page> |
1274 |
+ |
1275 |
+ <page name="DisplayCreate" pre-event="turn_off_buttons()" |
1276 |
+ post-event="Create_user()"> |
1277 |
+ |
1278 |
+ <field type="text" id="Username" size="8" validation="nonblank, my_username, unique_username"> |
1279 |
+ <label>USERNAME</label> |
1280 |
+ </field> |
1281 |
+ |
1282 |
+ <field type="text" id="Fullname" validation="nonblank, fullname"> |
1283 |
+ <label>FULLNAME</label> |
1284 |
+ </field> |
1285 |
+ |
1286 |
+ <field type="password" id="Password" validation="nonblank, my_password(6)"> |
1287 |
+ <label>PASSWORD</label> |
1288 |
+ </field> |
1289 |
+ |
1290 |
+ <field type="text" id="EmailAddress" size="30" validation="nonblank, email_simple, unique_email"> |
1291 |
+ <label>EMAILADDRESS</label> |
1292 |
+ </field> |
1293 |
+ |
1294 |
+ <field type="select" id="Admin" options="'yes' => 'Oui', 'no' => 'Non'" validation="nonblank"> |
1295 |
+ <label>ADMIN</label> |
1296 |
+ </field> |
1297 |
+ |
1298 |
+ <field type="select" id="Active" options="'no' => 'Actif', 'yes' => 'Non-actif'" validation="nonblank"> |
1299 |
+ <label>ACTIVE_CREATE</label> |
1300 |
+ </field> |
1301 |
+ |
1302 |
+ <field type="select" id="quota" options="'yes' => 'Oui', 'no' => 'Non'" validation="nonblank"> |
1303 |
+ <label>QUOTA_OVERR</label> |
1304 |
+ </field> |
1305 |
+ |
1306 |
+ <field type="text" id="Warnlvl" size="8" value="0"> |
1307 |
+ <label>WARN_LVL</label> |
1308 |
+ </field> |
1309 |
+ |
1310 |
+ <field type="text" id="Softlvl" size="8" value="0" validation="sup_quota_inter"> |
1311 |
+ <label>SOFT_LVL</label> |
1312 |
+ </field> |
1313 |
+ |
1314 |
+ <field type="text" id="Hardlvl" size="8" value="0" validation="sup_quota_hard"> |
1315 |
+ <label>HARD_LVL</label> |
1316 |
+ </field> |
1317 |
+ |
1318 |
+ <subroutine src="display_create_user_group()" /> |
1319 |
+ <subroutine src="display_create_button()" /> |
1320 |
+ <subroutine src="print_message('GREETING')" /> |
1321 |
+ </page> |
1322 |
+ |
1323 |
+ <page name="DeleteUser" pre-event="turn_off_buttons()" |
1324 |
+ post-event="delete_user()"> |
1325 |
+ <description>DELETE_USER_TXT</description> |
1326 |
+ <subroutine src="display_delete_button()" /> |
1327 |
+ <subroutine src="print_message('GREETING')" /> |
1328 |
+ </page> |
1329 |
+ |
1330 |
+ <page name="DisplayCreateGroup" pre-event="turn_off_buttons()" |
1331 |
+ post-event="Create_group()"> |
1332 |
+ |
1333 |
+ <field type="text" id="Groupname" validation="nonblank, fullname, unique_groupname"> |
1334 |
+ <label>GROUP_NAME</label> |
1335 |
+ </field> |
1336 |
+ |
1337 |
+ <subroutine src="display_create_button()" /> |
1338 |
+ <subroutine src="print_message('GREETING')" /> |
1339 |
+ </page> |
1340 |
+ |
1341 |
+ <page name="DeleteGroup" pre-event="turn_off_buttons()" |
1342 |
+ post-event="delete_group()"> |
1343 |
+ <description>DELETE_GROUP_TXT</description> |
1344 |
+ <subroutine src="display_delete_group_button" /> |
1345 |
+ <subroutine src="print_message('GREETING')" /> |
1346 |
+ </page> |
1347 |
+ |
1348 |
+ <page name="DisplayGroupDetails" pre-event="turn_off_buttons()" |
1349 |
+ post-event="modify_user_group()"> |
1350 |
+ <subroutine src="display_user_in_group()" /> |
1351 |
+ <subroutine src="display_modify_group_button()" /> |
1352 |
+ <subroutine src="print_message('GREETING')" /> |
1353 |
+ </page> |
1354 |
+ |
1355 |
+ <page name="DisplayCompanyDetails" pre-event="print_status_message()" post-event="transfer_page()"> |
1356 |
+ |
1357 |
+ <subroutine src="show_company_users()" /> |
1358 |
+ <subroutine src="print_message('GREETING')" /> |
1359 |
+ </page> |
1360 |
+ |
1361 |
+ <page name="CreateCompany" pre-event="print_status_message()" post-event="create_company()"> |
1362 |
+ |
1363 |
+ <field type="text" id="createcompanyname" size="20" validation="nonblank"> |
1364 |
+ <label>COMPANY_NAME</label> |
1365 |
+ </field> |
1366 |
+ |
1367 |
+ <subroutine src="display_create_button()" /> |
1368 |
+ <subroutine src="print_message('GREETING')" /> |
1369 |
+ </page> |
1370 |
+ |
1371 |
+ <page name="DeleteCompany" pre-event="turn_off_buttons()" |
1372 |
+ post-event="delete_company()"> |
1373 |
+ |
1374 |
+ <description>DELETE_COMPANY_TXT</description> |
1375 |
+ |
1376 |
+ <subroutine src="display_delete_comp_button" /> |
1377 |
+ <subroutine src="print_message('GREETING')" /> |
1378 |
+ </page> |
1379 |
+ |
1380 |
+ </form> |
1381 |
\ No newline at end of file |
1382 |
diff -urN smeserver-zarafa-0.9.0.orig/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/zarafaCFG.pm smeserver-zarafa-0.9.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/zarafaCFG.pm |
1383 |
--- smeserver-zarafa-0.9.0.orig/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/zarafaCFG.pm 1970-01-01 10:00:00.000000000 +1000 |
1384 |
+++ smeserver-zarafa-0.9.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/zarafaCFG.pm 2009-06-01 21:15:18.000000000 +1000 |
1385 |
@@ -0,0 +1,964 @@ |
1386 |
+#!/usr/bin/perl -w |
1387 |
+ |
1388 |
+package esmith::FormMagick::Panel::zarafaCFG; |
1389 |
+ |
1390 |
+ use strict; |
1391 |
+ use warnings; |
1392 |
+ use esmith::FormMagick; |
1393 |
+ use esmith::cgi; |
1394 |
+ use esmith::util; |
1395 |
+ use Exporter; |
1396 |
+ use esmith::ConfigDB; |
1397 |
+ use utf8; |
1398 |
+ |
1399 |
+ our @ISA = qw(esmith::FormMagick Exporter); |
1400 |
+ |
1401 |
+ our @EXPORT = qw(); |
1402 |
+ |
1403 |
+ our $VERSION = sprintf '%d.%03d', q$Revision: 1.1 $ =~ /: (\d+).(\d+)/; |
1404 |
+ |
1405 |
+ our $configdb = esmith::ConfigDB->open(); |
1406 |
+ |
1407 |
+ # Longueur des clef de license pour vérification |
1408 |
+ our $licensekey = 24; |
1409 |
+ our $CALkey = 16; |
1410 |
+ |
1411 |
+# Ce fichier contient les fonction nécessaire pour gérer l'interface entre le serveur SME et la configuration de certain paramétres du module Zarafa. |
1412 |
+# Ce fichier regroupe des fonctions d'affichage, de modifications et de vérifications de données contenu dans Zarafa. |
1413 |
+##################################################################################################################################### |
1414 |
+# This file contains the required functions in order to handle the interface between SME server and Zarafa configuration module's. |
1415 |
+# It contains display, modify, create and verification functions for Zarafa. |
1416 |
+ |
1417 |
+ |
1418 |
+# display_config permet l'affichage d'options et le préremplissage de champs pour la configuration du serveur de messagerie |
1419 |
+########################################################################################################################### |
1420 |
+# display_config is used to display options and to fill many fields for the mail's server |
1421 |
+ |
1422 |
+sub display_config { |
1423 |
+ |
1424 |
+ my $self = shift; |
1425 |
+ my $cgi = $self->{cgi}; |
1426 |
+ |
1427 |
+ # Récupération des valeurs à inséré dans les champs |
1428 |
+ # Recovery of value to put into fields |
1429 |
+ my ($softdelete, $cache_cell, $cache_object, $cache_index, $quota_warn, $quota_soft, $quota_hard, $companyquota_warn, $multicompany); |
1430 |
+ open(LIRE, "/etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg"); |
1431 |
+ while(<LIRE>){ |
1432 |
+ my $ligne = $_; |
1433 |
+ if($ligne =~ m/^softdelete_lifetime/){ |
1434 |
+ $softdelete = $ligne; |
1435 |
+ $softdelete =~ s/softdelete_lifetime\s+\=\s{1}//g; |
1436 |
+ } |
1437 |
+ if($ligne =~ m/^cache_cell_size/){ |
1438 |
+ $cache_cell = $ligne; |
1439 |
+ $cache_cell =~ s/cache_cell_size\s+\=\s{1}//g; |
1440 |
+ } |
1441 |
+ if($ligne =~ m/^cache_object_size/){ |
1442 |
+ $cache_object = $ligne; |
1443 |
+ $cache_object =~ s/cache_object_size\s+\=\s{1}//g; |
1444 |
+ } |
1445 |
+ if($ligne =~ m/^cache_indexedobject_size/){ |
1446 |
+ $cache_index = $ligne; |
1447 |
+ $cache_index =~ s/cache_indexedobject_size\s+\=\s{1}//g; |
1448 |
+ } |
1449 |
+ if($ligne =~ m/^quota_warn/){ |
1450 |
+ $quota_warn = $ligne; |
1451 |
+ $quota_warn =~ s/quota_warn\s+\=\s{1}//g; |
1452 |
+ } |
1453 |
+ if($ligne =~ m/^quota_soft/){ |
1454 |
+ $quota_soft = $ligne; |
1455 |
+ $quota_soft =~ s/quota_soft\s+\=\s{1}//g; |
1456 |
+ } |
1457 |
+ if($ligne =~ m/^quota_hard/){ |
1458 |
+ $quota_hard = $ligne; |
1459 |
+ $quota_hard =~ s/quota_hard\s+\=\s{1}//g; |
1460 |
+ } |
1461 |
+ if($ligne =~ m/^companyquota_warn/){ |
1462 |
+ $companyquota_warn = $ligne; |
1463 |
+ $companyquota_warn =~ s/companyquota_warn\s+\=\s{1}//g; |
1464 |
+ } |
1465 |
+ if($ligne =~ m/^enable_hosted_zarafa/){ |
1466 |
+ $multicompany = $ligne; |
1467 |
+ $multicompany =~ s/enable_hosted_zarafa\s+\=\s//g; |
1468 |
+ } |
1469 |
+ } |
1470 |
+ close(LIRE); |
1471 |
+ |
1472 |
+ # Affichage des valeurs récupérées |
1473 |
+ # Display of the precedent values |
1474 |
+ $cgi->param(-name=>'Softdelete', -value=>$softdelete); |
1475 |
+ $cgi->param(-name=>'cache_cell', -value=>$cache_cell); |
1476 |
+ $cgi->param(-name=>'cache_object', -value=>$cache_object); |
1477 |
+ $cgi->param(-name=>'cache_index', -value=>$cache_index); |
1478 |
+ $cgi->param(-name=>'quota_warn', -value=>$quota_warn); |
1479 |
+ $cgi->param(-name=>'quota_soft', -value=>$quota_soft); |
1480 |
+ $cgi->param(-name=>'quota_hard', -value=>$quota_hard); |
1481 |
+ $cgi->param(-name=>'companyquota_warn', -value=>$companyquota_warn); |
1482 |
+ |
1483 |
+ # Localisation |
1484 |
+ my $multicomp = $self->localise('MULTICOMP'); |
1485 |
+ my $globalforward = $self->localise('GLOBALFORWARD'); |
1486 |
+ my $enabled = $self->localise('ENABLED'); |
1487 |
+ |
1488 |
+ |
1489 |
+ my $out = "<tr>\n <td class=\"sme-noborders-label\">" |
1490 |
+ . "$multicomp" |
1491 |
+ . "</td>\n <td>\n" |
1492 |
+ . " <table border='0' cellspacing='0' cellpadding='0'>\n"; |
1493 |
+ if($multicompany =~ m/true/){ |
1494 |
+ $out .="<td>$enabled</td><td><input type=\"checkbox\" name=\"multicompany\" checked" |
1495 |
+ ." value=\"enabled\"></td>" |
1496 |
+ ."</tr>\n"; |
1497 |
+ } |
1498 |
+ else { |
1499 |
+ $out .="<td>$enabled</td><td><input type=\"checkbox\" name=\"multicompany\"" |
1500 |
+ ." value=\"enabled\"></td>" |
1501 |
+ ."</tr>\n"; |
1502 |
+ } |
1503 |
+ $out .= " </table>\n </td>\n </tr>\n"; |
1504 |
+ |
1505 |
+ $out .= "<tr>\n <td class=\"sme-noborders-label\">" |
1506 |
+ . "$globalforward" |
1507 |
+ . "</td>\n <td>\n" |
1508 |
+ . " <table border='0' cellspacing='0' cellpadding='0'>\n"; |
1509 |
+ unless(!$configdb->get_prop("zarafa-server",'GlobalForward')){ |
1510 |
+ if($configdb->get_prop("zarafa-server",'GlobalForward') =~ m/enabled/){ |
1511 |
+ $out .="<td>$enabled</td><td><input type=\"checkbox\" name=\"globalforward\" checked" |
1512 |
+ ." value=\"enabled\"></td>" |
1513 |
+ ."</tr>\n"; |
1514 |
+ } |
1515 |
+ } |
1516 |
+ else { |
1517 |
+ $out .="<td>$enabled</td><td><input type=\"checkbox\" name=\"globalforward\"" |
1518 |
+ ." value=\"enabled\"></td>" |
1519 |
+ ."</tr>\n"; |
1520 |
+ } |
1521 |
+ $out .= " </table>\n </td>\n </tr>\n"; |
1522 |
+ |
1523 |
+return $out; |
1524 |
+} |
1525 |
+ |
1526 |
+# display_modify_button affiche un bouton avec le texte "Modifier" |
1527 |
+########################################################### |
1528 |
+# display_modify_button display a button with "Modify" text on it |
1529 |
+ |
1530 |
+sub display_modify_button { |
1531 |
+ |
1532 |
+ my ($self) = @_; |
1533 |
+ my $cgi = $self->{cgi}; |
1534 |
+ my $button = $self->localise('MODIFY_BUTTON'); |
1535 |
+ $self->print_button("$button"); |
1536 |
+} |
1537 |
+ |
1538 |
+# modify_config récupére les valeurs saisi dans l'interface pour les entrés dans le serveur |
1539 |
+########################################################################################### |
1540 |
+# modify_config recover the values enter in the interface to put them into the server configuration |
1541 |
+ |
1542 |
+sub modify_config { |
1543 |
+ |
1544 |
+ my $self = shift; |
1545 |
+ my $cgi = $self->{cgi}; |
1546 |
+ |
1547 |
+ # Récupération des valeurs |
1548 |
+ # Revover of the value |
1549 |
+ my $softdelete = $cgi->param('Softdelete'); |
1550 |
+ if ($softdelete =~ /^([-\@\w.]+)$/) { |
1551 |
+ $softdelete = $1; # $data now untainted |
1552 |
+ } |
1553 |
+ else { |
1554 |
+ die "bad data in $softdelete"; |
1555 |
+ } |
1556 |
+ |
1557 |
+ my $cache_cell = $cgi->param('cache_cell'); |
1558 |
+ if ($cache_cell =~ /^([-\@\w.]+)$/) { |
1559 |
+ $cache_cell = $1; # $data now untainted |
1560 |
+ } |
1561 |
+ else { |
1562 |
+ die "bad data in $cache_cell"; |
1563 |
+ } |
1564 |
+ |
1565 |
+ my $cache_object = $cgi->param('cache_object'); |
1566 |
+ if ($cache_object =~ /^([-\@\w.]+)$/) { |
1567 |
+ $cache_object = $1; # $data now untainted |
1568 |
+ } |
1569 |
+ else { |
1570 |
+ die "bad data in $cache_object"; |
1571 |
+ } |
1572 |
+ |
1573 |
+ my $cache_index = $cgi->param('cache_index'); |
1574 |
+ if ($cache_index =~ /^([-\@\w.]+)$/) { |
1575 |
+ $cache_index = $1; # $data now untainted |
1576 |
+ } |
1577 |
+ else { |
1578 |
+ die "bad data in $cache_index"; |
1579 |
+ } |
1580 |
+ |
1581 |
+ my $quota_warn = $cgi->param('quota_warn'); |
1582 |
+ if ($quota_warn =~ /^([-\@\w.]+)$/) { |
1583 |
+ $quota_warn = $1; # $data now untainted |
1584 |
+ } |
1585 |
+ else { |
1586 |
+ die "bad data in $quota_warn"; |
1587 |
+ } |
1588 |
+ |
1589 |
+ my $quota_soft = $cgi->param('quota_soft'); |
1590 |
+ if ($quota_soft =~ /^([-\@\w.]+)$/) { |
1591 |
+ $quota_soft = $1; # $data now untainted |
1592 |
+ } |
1593 |
+ else { |
1594 |
+ die "bad data in $quota_soft"; |
1595 |
+ } |
1596 |
+ |
1597 |
+ my $quota_hard = $cgi->param('quota_hard'); |
1598 |
+ if ($quota_hard =~ /^([-\@\w.]+)$/) { |
1599 |
+ $quota_hard = $1; # $data now untainted |
1600 |
+ } |
1601 |
+ else { |
1602 |
+ die "bad data in $quota_hard"; |
1603 |
+ } |
1604 |
+ |
1605 |
+ my $companyquota_warn = $cgi->param('companyquota_warn'); |
1606 |
+ if ($companyquota_warn =~ /^([-\@\w.]+)$/) { |
1607 |
+ $companyquota_warn = $1; # $data now untainted |
1608 |
+ } |
1609 |
+ else { |
1610 |
+ die "bad data in $companyquota_warn"; |
1611 |
+ } |
1612 |
+ |
1613 |
+ my $multicompany = $cgi->param('multicompany'); |
1614 |
+ |
1615 |
+ |
1616 |
+ # Récupération du contenu de server.cfg |
1617 |
+ # Recovery of the content of server.cfg |
1618 |
+ open(RECUP, "/etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg"); |
1619 |
+ my @contenu = <RECUP>; |
1620 |
+ close(RECUP); |
1621 |
+ |
1622 |
+ # Remplacement des valeurs |
1623 |
+ # Replacement of values |
1624 |
+ foreach my $ligne (@contenu){ |
1625 |
+ unless ($ligne =~ m/^#/){ |
1626 |
+ if ($ligne =~ m/^softdelete_lifetime/){ |
1627 |
+ $ligne =~ s/\w+$/$softdelete/g; |
1628 |
+ } |
1629 |
+ |
1630 |
+ if($ligne =~ m/^cache_cell_size/){ |
1631 |
+ $ligne =~ s/\w+$/$cache_cell/g; |
1632 |
+ } |
1633 |
+ |
1634 |
+ if($ligne =~ m/^cache_object_size/){ |
1635 |
+ $ligne =~ s/\w+$/$cache_object/g; |
1636 |
+ } |
1637 |
+ |
1638 |
+ if($ligne =~ m/^cache_indexedobject_size/){ |
1639 |
+ $ligne =~ s/\w+$/$cache_index/g; |
1640 |
+ } |
1641 |
+ if($ligne =~ m/^quota_warn/){ |
1642 |
+ $ligne =~ s/\w+$/$quota_warn/g; |
1643 |
+ } |
1644 |
+ if($ligne =~ m/^quota_soft/){ |
1645 |
+ $ligne =~ s/\w+$/$quota_soft/g; |
1646 |
+ } |
1647 |
+ if($ligne =~ m/^quota_hard/){ |
1648 |
+ $ligne =~ s/\w+$/$quota_hard/g; |
1649 |
+ } |
1650 |
+ if($ligne =~ m/^companyquota_warn/){ |
1651 |
+ $ligne =~ s/\w+$/$companyquota_warn/g; |
1652 |
+ } |
1653 |
+ if($ligne =~ m/^enable_hosted_zarafa/ && !$multicompany){ |
1654 |
+ $ligne =~ s/\w+$/false/g; |
1655 |
+ } |
1656 |
+ elsif($ligne =~ m/^enable_hosted_zarafa/ && $multicompany eq 'enabled'){ |
1657 |
+ $ligne =~ s/\w+$/true/g; |
1658 |
+ } |
1659 |
+ } |
1660 |
+ } |
1661 |
+ |
1662 |
+ # Ecriture du fichier |
1663 |
+ # File written |
1664 |
+ open(ECRIRE, ">/etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg"); |
1665 |
+ foreach my $ligne (@contenu) { |
1666 |
+ chomp $ligne; |
1667 |
+ print ECRIRE "$ligne\n"; |
1668 |
+ } |
1669 |
+ close(ECRIRE); |
1670 |
+ |
1671 |
+ my $globalforward = $cgi->param('globalforward'); |
1672 |
+ |
1673 |
+ |
1674 |
+ if(!$globalforward || $globalforward =~ m/disabled/) { |
1675 |
+ system("/sbin/e-smith/db configuration delprop \"zarafa-server\" GlobalForward"); |
1676 |
+ } |
1677 |
+ elsif($globalforward =~ m/enabled/){ |
1678 |
+ system("/sbin/e-smith/db configuration setprop \"zarafa-server\" GlobalForward enabled"); |
1679 |
+ } |
1680 |
+ |
1681 |
+ |
1682 |
+ |
1683 |
+ $self->success('MODIFY_CONFIG_SUCCESS'); |
1684 |
+ |
1685 |
+ # creation du fichier de configuration |
1686 |
+ # config file creation |
1687 |
+ system("/sbin/e-smith/expand-template /etc/zarafa/server.cfg") == 0 |
1688 |
+ or die "Impossible d'extend le template"; |
1689 |
+ system("/etc/e-smith/events/actions/zarafa-services stop > /dev/null"); |
1690 |
+ system("/etc/e-smith/events/actions/zarafa-services start > /dev/null"); |
1691 |
+ system("/etc/e-smith/events/actions/qmail-update-user"); |
1692 |
+} |
1693 |
+ |
1694 |
+# display_buttons permet d'afficher les trois bouttons pour les différentes sections de configuration |
1695 |
+##################################################################################################### |
1696 |
+# display_buttons allow you to display three buttons for the different parts of the configuration |
1697 |
+ |
1698 |
+sub display_buttons { |
1699 |
+ |
1700 |
+ my $self = shift; |
1701 |
+ my $q = $self->{cgi}; |
1702 |
+ |
1703 |
+ # Récupération version de zarafa |
1704 |
+ # Recovery of Zarafa version |
1705 |
+ my $product_version; |
1706 |
+ open(VERS,"zarafa-admin -V |"); |
1707 |
+ while(<VERS>){ |
1708 |
+ my $ligne = $_; |
1709 |
+ if($ligne =~ m/^Product version/){ |
1710 |
+ $ligne =~ s/\w+\s\w+:\t//g; |
1711 |
+ $product_version = $ligne; |
1712 |
+ } |
1713 |
+ } |
1714 |
+ close(VERS); |
1715 |
+ |
1716 |
+ # Récupération du systéme de BD |
1717 |
+ # Recovery of DB system |
1718 |
+ my $zarafa_plugin = $configdb->get_prop("zarafa-server",'Plugin'); |
1719 |
+ unless($zarafa_plugin){ |
1720 |
+ $zarafa_plugin = $self->localise('ZARAFA_PLUGIN_CAUTION'); |
1721 |
+ } |
1722 |
+ |
1723 |
+ # Version communautaire ou enregistré ? |
1724 |
+ # Registered or enregistered version ? |
1725 |
+ my $registered; |
1726 |
+ if(-e "/etc/zarafa/license/base"){ |
1727 |
+ $registered = $self->localise('REGISTERED'); |
1728 |
+ } |
1729 |
+ else { |
1730 |
+ $registered = $self->localise('UNREGISTERED'); |
1731 |
+ } |
1732 |
+ |
1733 |
+ # Récupération du nombre d'utilisateur maximum |
1734 |
+ # Recovery of maximum users |
1735 |
+ my $nbrusermax; |
1736 |
+ open(REVERSE, "/var/log/zarafa/licensed.log") or die "Impossible d'ouvrir licensed.log"; |
1737 |
+ foreach my $ligne (reverse(<REVERSE> )) { |
1738 |
+ if($ligne =~ m/License is for/){ |
1739 |
+ $nbrusermax = $ligne; |
1740 |
+ $nbrusermax =~ s/.+License is for //g; |
1741 |
+ $nbrusermax =~ s/ Win32 MAPI users$//g; |
1742 |
+ $nbrusermax =~ s/ total users$//g; |
1743 |
+ last; |
1744 |
+ } |
1745 |
+ } |
1746 |
+ close(REVERSE); |
1747 |
+ |
1748 |
+ # Localisation |
1749 |
+ my $version = $self->localise('VERSION'); |
1750 |
+ my $sys_auth = $self->localise('SYS_AUTH'); |
1751 |
+ my $maxuser = $self->localise('MAX_USERS'); |
1752 |
+ |
1753 |
+ |
1754 |
+ # Affichage des info |
1755 |
+ # Information display |
1756 |
+ print "$version $product_version - $sys_auth $zarafa_plugin - $registered - $nbrusermax $maxuser \n"; |
1757 |
+ |
1758 |
+ # Localisation |
1759 |
+ my $CFGbutton = $self->localise('CFG_BUTTON'); |
1760 |
+ my $CFGbutton_bubble = $self->localise('CFG_BUTTON_BUBBLE'); |
1761 |
+ |
1762 |
+ # Affichage bouton configuration |
1763 |
+ # Display the configuration button |
1764 |
+ my $out ="<p><a class=\"button-like\" |
1765 |
+ href=\"zarafaCFG?page=0&wherenext=Config\" title=\"$CFGbutton_bubble\">$CFGbutton</a>"; |
1766 |
+ |
1767 |
+ # Localisation |
1768 |
+ my $KEYbutton = $self->localise('KEY_BUTTON'); |
1769 |
+ my $KEYbutton_bubble = $self->localise('KEY_BUTTON_BUBBLE'); |
1770 |
+ |
1771 |
+ if(-e "/etc/zarafa/license/base"){ |
1772 |
+ # Affichage bouton de gestion des clef pour une version enregistrée |
1773 |
+ # Display the key management button for a registered version |
1774 |
+ $out .="<a class=\"button-like\" |
1775 |
+ href=\"zarafaCFG?page=0&wherenext=KEYSUNeed\" title=\"$KEYbutton_bubble\">$KEYbutton</a>"; |
1776 |
+ } |
1777 |
+ else{ |
1778 |
+ # Affichage bouton de validation de la version |
1779 |
+ # Display the version validation button |
1780 |
+ $out .="<a class=\"button-like\" |
1781 |
+ href=\"zarafaCFG?page=0&wherenext=KEYSNeed\" title=\"$KEYbutton_bubble\">$KEYbutton</a>"; |
1782 |
+ } |
1783 |
+ |
1784 |
+ # Localisation |
1785 |
+ my $MYSQLbutton = $self->localise('MYSQL_BUTTON'); |
1786 |
+ my $MYSQLbutton_bubble = $self->localise('MYSQL_BUTTON_BUBBLE'); |
1787 |
+ |
1788 |
+ # Affichage bouton MySQL |
1789 |
+ # Display the MySQL button |
1790 |
+ $out .="<a class=\"button-like\" |
1791 |
+ href=\"zarafaCFG?page=0&wherenext=MYSQL\" title=\"$MYSQLbutton_bubble\">$MYSQLbutton</a></p>"; |
1792 |
+ |
1793 |
+ return $out; |
1794 |
+} |
1795 |
+ |
1796 |
+# add_cdkey est utilisé pour ajouter une clé-CD pour authentifier Zarafa |
1797 |
+####################################################################### |
1798 |
+# add_cdkey is used to add a CD-key to authenticate Zarafa |
1799 |
+ |
1800 |
+sub add_cdkey{ |
1801 |
+ |
1802 |
+ my $self = shift; |
1803 |
+ my $cgi = $self->{cgi}; |
1804 |
+ |
1805 |
+ # Récupération de la clef saisi par l'utilisateur |
1806 |
+ # Recovery of the key enter by the user |
1807 |
+ my $cd_key = $cgi->param('clef-cd'); |
1808 |
+ if ($cd_key =~ /^([-\@\w.]+)$/) { |
1809 |
+ $cd_key = $1; # $data now untainted |
1810 |
+ } |
1811 |
+ else { |
1812 |
+ die "bad data in $cd_key"; |
1813 |
+ } |
1814 |
+ |
1815 |
+ # Ecriture du fichier base |
1816 |
+ # Writing of the base file |
1817 |
+ $cd_key = uc($cd_key); |
1818 |
+ open(ECRIRE, ">/etc/zarafa/license/base"); |
1819 |
+ print ECRIRE "$cd_key"; |
1820 |
+ close(ECRIRE); |
1821 |
+ |
1822 |
+ $self->success('ADD_LICENSE_SUCCESS'); |
1823 |
+ |
1824 |
+ # Redémarage des services zarafa |
1825 |
+ # Restart of Zarafa services |
1826 |
+ system("/etc/e-smith/events/actions/zarafa-services restart > /dev/null"); |
1827 |
+} |
1828 |
+ |
1829 |
+# display_key_info permet d'afficher la clef-cd de la version en cours de zarafa ainsi que le nombre maximum d'utilisateurs pouvant être créé. |
1830 |
+############################################################################################################################################## |
1831 |
+# display_key_info is used to display the CD-key of zarafa current version and the maximum number of Zarafa user's could be created. |
1832 |
+ |
1833 |
+sub display_key_info { |
1834 |
+ |
1835 |
+ my $self = shift; |
1836 |
+ my $cgi = $self->{cgi}; |
1837 |
+ |
1838 |
+ # Récupération de la clé-CD |
1839 |
+ # Recovery of the CD-key |
1840 |
+ open(KEYS,"/etc/zarafa/license/base"); |
1841 |
+ my $key = <KEYS>; |
1842 |
+ close(KEYS); |
1843 |
+ # Localisation |
1844 |
+ my $clef = $self->localise('CD_KEY'); |
1845 |
+ my $nbrusertxt = $self->localise('NBRUSERTXT'); |
1846 |
+ |
1847 |
+ # Récupération du nombre maximum d'utilisateurs |
1848 |
+ # Recovery of the maximum users number |
1849 |
+ my $nbrusermax; |
1850 |
+ open(REVERSE, "/var/log/zarafa/licensed.log") or die "Impossible d'ouvrir licensed.log"; |
1851 |
+ foreach my $ligne (reverse(<REVERSE> )) { |
1852 |
+ if($ligne =~ m/License is for/){ |
1853 |
+ $nbrusermax = $ligne; |
1854 |
+ $nbrusermax =~ s/.+License is for //g; |
1855 |
+ $nbrusermax =~ s/ Win32 MAPI users$//g; |
1856 |
+ $nbrusermax =~ s/ total users$//g; |
1857 |
+ last; |
1858 |
+ } |
1859 |
+ } |
1860 |
+ close(REVERSE); |
1861 |
+ |
1862 |
+ # Affichage |
1863 |
+ # Display |
1864 |
+ print "$clef $key - $nbrusermax $nbrusertxt"; |
1865 |
+ return 0; |
1866 |
+} |
1867 |
+ |
1868 |
+# valid_keys est utilisé pour vérifier si la clef-CD rentré pour renregistré zarafa est valide |
1869 |
+############################################################################################## |
1870 |
+# valid_keys is used to verify if the CD-key enter for registered Zarafa is correct |
1871 |
+ |
1872 |
+sub valid_keys { |
1873 |
+ |
1874 |
+ my ($fm, $cd_key) = @_; |
1875 |
+ my $self = shift; |
1876 |
+ my $return_error = $self->localise('INVALID_KEY'); |
1877 |
+ |
1878 |
+ if($cd_key =~ m/^\w{$licensekey}$/){ |
1879 |
+ return "OK"; |
1880 |
+ } |
1881 |
+ else { |
1882 |
+ return $return_error; |
1883 |
+ } |
1884 |
+} |
1885 |
+ |
1886 |
+# display_cal sert à afficher un tableau contenant le nom des CAL ainsi que la clef associée |
1887 |
+############################################################################################ |
1888 |
+# display_cal is used to display an array which contain all CAl and the key associated |
1889 |
+ |
1890 |
+sub display_cal { |
1891 |
+ |
1892 |
+ my $self = shift; |
1893 |
+ my $q = $self->{cgi}; |
1894 |
+ |
1895 |
+ # Localisation |
1896 |
+ my $calname = $self->localise('CALNAME'); |
1897 |
+ my $calkey = $self->localise('CALKEY'); |
1898 |
+ my $caldelete = $self->localise('DELETE'); |
1899 |
+ |
1900 |
+ # Affichage de l'en-tête du tableau |
1901 |
+ # Display of the header |
1902 |
+ print " <tr>\n <td colspan=\"2\">\n "; |
1903 |
+ print $q->start_table ({-CLASS => "sme-border"}),"\n "; |
1904 |
+ print $q->Tr( |
1905 |
+ esmith::cgi::genSmallCell($q, $calname,"header"), |
1906 |
+ esmith::cgi::genSmallCell($q, $calkey,"header")); |
1907 |
+ |
1908 |
+ |
1909 |
+ # Récupération du nom des fichiers CAL |
1910 |
+ # Recovery of the CAL file name |
1911 |
+ my $filekey; |
1912 |
+ opendir(OPENDIR, "/etc/zarafa/license") or die "Impossible d'ouvrir /etc/zarafa/license"; |
1913 |
+ my @all_files = readdir (OPENDIR); |
1914 |
+ close(OPENDIR); |
1915 |
+ |
1916 |
+ # Affichage du nom et de la clef |
1917 |
+ # Display of the name and the key |
1918 |
+ my @out = sort @all_files; |
1919 |
+ foreach my $file (@out) { |
1920 |
+ unless($file eq 'base' or $file eq '..' or $file eq '.'){ |
1921 |
+ open(FILE, "/etc/zarafa/license/$file") or die "Impossible d'ouvrir $file"; |
1922 |
+ $filekey = <FILE>; |
1923 |
+ print $q->Tr( |
1924 |
+ esmith::cgi::genSmallCell($q, $file,"normal"), |
1925 |
+ esmith::cgi::genSmallCell($q, $filekey,"normal")); |
1926 |
+ close(FILE); |
1927 |
+ } |
1928 |
+ } |
1929 |
+ |
1930 |
+ print qq(</table></td></tr>\n); |
1931 |
+ |
1932 |
+ # Localisation |
1933 |
+ my $createCal = $self->localise('CAL_BUTTON'); |
1934 |
+ my $createCal_bubble = $self->localise('CAL_BUTTON_BUBBLE'); |
1935 |
+ |
1936 |
+ # Affichage bouton ajouter CAL |
1937 |
+ # Display the CAL's create button |
1938 |
+ my $out ="<p><a class=\"button-like\" |
1939 |
+ href=\"zarafaCFG?page=0&wherenext=CreateCal\" title=\"$createCal_bubble\">$createCal</a>"; |
1940 |
+ |
1941 |
+return $out; |
1942 |
+} |
1943 |
+ |
1944 |
+# display_create_button permet d'afficher un bouton avec le texte "Ajouter Clé" |
1945 |
+############################################################################### |
1946 |
+# display_create_button is used to display a button with "Add key" text |
1947 |
+ |
1948 |
+sub display_create_button { |
1949 |
+ |
1950 |
+ my ($self) = @_; |
1951 |
+ my $cgi = $self->{cgi}; |
1952 |
+ |
1953 |
+ my $button = $self->localise('CREATE_BUTTON'); |
1954 |
+ $self->print_button("$button"); |
1955 |
+} |
1956 |
+ |
1957 |
+# create_cal permet de rajouter un CAL à zarafa |
1958 |
+############################################### |
1959 |
+# create_cal is used to add a CAL to zarafa |
1960 |
+ |
1961 |
+sub create_cal { |
1962 |
+ |
1963 |
+ my $self = shift; |
1964 |
+ my $cgi = $self->{cgi}; |
1965 |
+ |
1966 |
+ # Récupération du nom du CAL et de la clef |
1967 |
+ # Recovery of the CAL name and the key |
1968 |
+ my $calname = $cgi->param('user_name_cal'); |
1969 |
+ if ($calname =~ /^([-\@\w.]+)$/) { |
1970 |
+ $calname = $1; # $data now untainted |
1971 |
+ } |
1972 |
+ else { |
1973 |
+ die "bad data in $calname"; |
1974 |
+ } |
1975 |
+ |
1976 |
+ my $calkey = $cgi->param('user_key_cal'); |
1977 |
+ if ($calkey =~ /^([-\@\w.]+)$/) { |
1978 |
+ $calkey = $1; # $data now untainted |
1979 |
+ } |
1980 |
+ else { |
1981 |
+ die "bad data in $calkey"; |
1982 |
+ } |
1983 |
+ |
1984 |
+ # Ecriture du fichier |
1985 |
+ # Writing of the file |
1986 |
+ open(CREATE, ">/etc/zarafa/license/$calname"); |
1987 |
+ print CREATE $calkey; |
1988 |
+ close(CREATE); |
1989 |
+ |
1990 |
+ $self->success('MODIFY_CONFIG_SUCCESS'); |
1991 |
+ |
1992 |
+ # Redémarrage des services Zarafa |
1993 |
+ # Restart of the zarafa services |
1994 |
+ system("/etc/e-smith/events/actions/zarafa-services restart > /dev/null"); |
1995 |
+} |
1996 |
+ |
1997 |
+# unique_cal sert a vérifier si le nom du CAL est déjà pris |
1998 |
+########################################################### |
1999 |
+# unique_cal is used to verify if the CAL name is already taken |
2000 |
+ |
2001 |
+sub unique_name { |
2002 |
+ |
2003 |
+ my ($fm, $calname) = @_; |
2004 |
+ my $self = shift; |
2005 |
+ my $return_error = $self->localise('EXIST_CALNAME'); |
2006 |
+ |
2007 |
+ # Récupération des noms des CAL existant |
2008 |
+ # Recovery of all existing CAL names |
2009 |
+ opendir(OPENDIR, "/etc/zarafa/license") or die "Impossible d'ouvrir /etc/zarafa/license"; |
2010 |
+ my @all_files = readdir (OPENDIR); |
2011 |
+ close(OPENDIR); |
2012 |
+ |
2013 |
+ # On vérifie si le nom est déja pris |
2014 |
+ # CAL name have been already taken ? |
2015 |
+ my $exist = 0; |
2016 |
+ foreach my $file (@all_files){ |
2017 |
+ if($file eq $calname){ |
2018 |
+ $exist = 1; |
2019 |
+ } |
2020 |
+ } |
2021 |
+ if($exist == 1){ |
2022 |
+ return $return_error; |
2023 |
+ } |
2024 |
+ else { |
2025 |
+ return "OK"; |
2026 |
+ } |
2027 |
+} |
2028 |
+ |
2029 |
+# unique_key sert a vérifier si la clef du CAL est déjà prise |
2030 |
+############################################################# |
2031 |
+# unique_key is used to verify if the CAL key is already taken |
2032 |
+ |
2033 |
+sub unique_key { |
2034 |
+ |
2035 |
+ |
2036 |
+ my ($fm, $calkey) = @_; |
2037 |
+ my $self = shift; |
2038 |
+ my $return_error = $self->localise('EXIST_CALKEY'); |
2039 |
+ |
2040 |
+ my $exist = 0; |
2041 |
+ my $filekey; |
2042 |
+ |
2043 |
+ # Récupération des noms des CAL existant |
2044 |
+ # Recovery of all existing CAL names |
2045 |
+ opendir(OPENDIR, "/etc/zarafa/license") or die "Impossible d'ouvrir /etc/zarafa/license"; |
2046 |
+ my @all_files = readdir (OPENDIR); |
2047 |
+ close(OPENDIR); |
2048 |
+ |
2049 |
+ # Parcours de chaque fichier |
2050 |
+ # Read of all files |
2051 |
+ foreach my $file (@all_files) { |
2052 |
+ # Vérification |
2053 |
+ # Verification |
2054 |
+ open(FILE, "/etc/zarafa/license/$file") or die "Impossible d'ouvrir $file"; |
2055 |
+ $filekey = <FILE>; |
2056 |
+ if($filekey =~ m/$calkey/){ |
2057 |
+ $exist = 1; |
2058 |
+ } |
2059 |
+ close(FILE); |
2060 |
+ } |
2061 |
+ |
2062 |
+ if($exist == 1){ |
2063 |
+ return $return_error; |
2064 |
+ } |
2065 |
+ else { |
2066 |
+ return "OK"; |
2067 |
+ } |
2068 |
+} |
2069 |
+ |
2070 |
+# valid_cal est utilisé pour vérifier si la clef rentré est valide lors de la création d'un CAL |
2071 |
+############################################################################################### |
2072 |
+# valid_cal is used to verify if the key enter for create a CAL is correct |
2073 |
+ |
2074 |
+sub valid_cal { |
2075 |
+ |
2076 |
+ my ($fm, $cd_key) = @_; |
2077 |
+ my $self = shift; |
2078 |
+ my $return_error = $self->localise('INVALID_KEY'); |
2079 |
+ |
2080 |
+ if($cd_key =~ m/^\w{$CALkey}$/){ |
2081 |
+ return "OK"; |
2082 |
+ } |
2083 |
+ else { |
2084 |
+ return $return_error; |
2085 |
+ } |
2086 |
+} |
2087 |
+ |
2088 |
+# display_value est utilisé pour affiché les valeurs de fichiers de configuration MySQL dans l'interface |
2089 |
+######################################################################################################## |
2090 |
+# display_value is used to display MySQL configuration values into the interface |
2091 |
+ |
2092 |
+sub display_value { |
2093 |
+ |
2094 |
+ my $self = shift; |
2095 |
+ my $cgi = $self->{cgi}; |
2096 |
+ |
2097 |
+ # Affichage d'une checkbox pour la fonction InnoDB |
2098 |
+ # Display of a checkbox for the InnoDB function |
2099 |
+ my $enabled = $self->localise('ENABLED'); |
2100 |
+ my $out = "<tr>\n <td class=\"sme-noborders-label\">" |
2101 |
+ . "InnoDB" |
2102 |
+ . "</td>\n <td>\n" |
2103 |
+ . " <table border='0' cellspacing='0' cellpadding='0'>\n"; |
2104 |
+ if($configdb->get_prop('mysqld','InnoDB')){ |
2105 |
+ $out .="<td>$enabled</td><td><input type=\"checkbox\" name=\"InnoDB\" checked" |
2106 |
+ ." value=\"enabled\"></td>" |
2107 |
+ ."</tr>\n"; |
2108 |
+ } |
2109 |
+ else { |
2110 |
+ $out .="<td>$enabled</td><td><input type=\"checkbox\" name=\"InnoDB\"" |
2111 |
+ ." value=\"enabled\"></td>" |
2112 |
+ ."</tr>\n"; |
2113 |
+ } |
2114 |
+ $out .= " </table>\n </td>\n </tr>\n"; |
2115 |
+ |
2116 |
+ # Récupération et affichage des valeurs du fichier de configuration |
2117 |
+ # Recovery and display of the configuration file values |
2118 |
+ my $ligne; |
2119 |
+ open(MYCNF, "/etc/e-smith/templates/etc/my.cnf/009innodb") or die "Impossible d'ouvrir 0009innodb"; |
2120 |
+ while(<MYCNF>){ |
2121 |
+ $ligne = $_; |
2122 |
+ if($ligne =~ m/buffer_pool_size/){ |
2123 |
+ $ligne =~ s/^\s+\$OUT\s\.\=\s\"\w+\s\=\s//g; |
2124 |
+ $ligne =~ s/M\\n\"\;$//g; |
2125 |
+ $cgi->param(-name=>'buffer_pool_size', -value=>$ligne); |
2126 |
+ } |
2127 |
+ elsif($ligne =~ m/additional_mem_pool_size/){ |
2128 |
+ $ligne =~ s/^\s+\$OUT\s\.\=\s\"\w+\s\=\s//g; |
2129 |
+ $ligne =~ s/M\\n\"\;$//g; |
2130 |
+ $cgi->param(-name=>'additional_mem_pool_size', -value=>$ligne); |
2131 |
+ } |
2132 |
+ elsif($ligne =~ m/log_file_size/){ |
2133 |
+ $ligne =~ s/^\s+\$OUT\s\.\=\s\"\w+\s\=\s//g; |
2134 |
+ $ligne =~ s/M\\n\"\;$//g; |
2135 |
+ $cgi->param(-name=>'log_file_size', -value=>$ligne); |
2136 |
+ } |
2137 |
+ elsif($ligne =~ m/log_buffer_size/){ |
2138 |
+ $ligne =~ s/^\s+\$OUT\s\.\=\s\"\w+\s\=\s//g; |
2139 |
+ $ligne =~ s/M\\n\"\;$//g; |
2140 |
+ $cgi->param(-name=>'log_buffer_size', -value=>$ligne); |
2141 |
+ } |
2142 |
+ } |
2143 |
+ close(MYCNF); |
2144 |
+ |
2145 |
+return $out; |
2146 |
+} |
2147 |
+ |
2148 |
+# modify_mysql permet de modifier les valeurs du fichier de configuration MySQL |
2149 |
+############################################################################### |
2150 |
+# modify_mysql is used to modify the value of the MySQL configuration file |
2151 |
+ |
2152 |
+sub modify_mysql { |
2153 |
+ |
2154 |
+ my $self = shift; |
2155 |
+ my $cgi = $self->{cgi}; |
2156 |
+ |
2157 |
+ # Récupération de la valeur courante et du réglage utilisateur de InnoDB |
2158 |
+ # Recovery of the current value and user value of InnoDB |
2159 |
+ my $innodb = $cgi->param('InnoDB'); |
2160 |
+ my $current_innodb = $configdb->get_prop('mysqld','InnoDB'); |
2161 |
+ |
2162 |
+ # Si l'utilisateur désactive le service InnoDB |
2163 |
+ # If the user disable the InnoDB service |
2164 |
+ if($current_innodb eq 'enabled' && !$innodb){ |
2165 |
+ # Arrêt des services MySQL et Zarafa |
2166 |
+ # Stop of MySQL and Zarafa services |
2167 |
+ system("/etc/e-smith/events/actions/zarafa-services stop > /dev/null"); |
2168 |
+ system("/sbin/service mysqld stop > /dev/null"); |
2169 |
+ # Suppression des fichiers MySQL |
2170 |
+ # Deleting MySQL file |
2171 |
+ system("rm -R -f /var/lib/mysql/ib_logfile0"); |
2172 |
+ system("rm -R -f /var/lib/mysql/ib_logfile1"); |
2173 |
+ system("rm -R -f /var/lib/mysql/ibdata1"); |
2174 |
+ |
2175 |
+ # Rechargement des paramêtres par défaut de MySQL |
2176 |
+ # Reload MySQL defaults adjustements |
2177 |
+ open(MYCNF, "/etc/e-smith/templates/etc/my.cnf/009innodb") or die "Impossible d'ouvrir 0009innodb"; |
2178 |
+ my @contenu = <MYCNF>; |
2179 |
+ close(MYCNF); |
2180 |
+ |
2181 |
+ foreach my $ligne (@contenu){ |
2182 |
+ if($ligne =~ m/buffer_pool_size/){ |
2183 |
+ $ligne =~ s/\d+/16/g; |
2184 |
+ } |
2185 |
+ elsif($ligne =~ m/additional_mem_pool_size/){ |
2186 |
+ $ligne =~ s/\d+/2/g; |
2187 |
+ } |
2188 |
+ elsif($ligne =~ m/log_file_size/){ |
2189 |
+ $ligne =~ s/\d+/5/g; |
2190 |
+ } |
2191 |
+ elsif($ligne =~ m/log_buffer_size/){ |
2192 |
+ $ligne =~ s/\d+/8/g; |
2193 |
+ } |
2194 |
+ } |
2195 |
+ open(ECRIRE, ">/etc/e-smith/templates/etc/my.cnf/009innodb"); |
2196 |
+ foreach my $ligne (@contenu) { |
2197 |
+ chomp $ligne; |
2198 |
+ print ECRIRE "$ligne\n"; |
2199 |
+ } |
2200 |
+ close(ECRIRE); |
2201 |
+ |
2202 |
+ # Suppression de l'InnoDB et redémarrage des services |
2203 |
+ # Delete of InnoDB and restart services |
2204 |
+ system("/sbin/e-smith/db configuration delprop mysqld InnoDB"); |
2205 |
+ system("/sbin/e-smith/expand-template /etc/my.cnf"); |
2206 |
+ system("/sbin/service mysqld start > /dev/null"); |
2207 |
+ system("/etc/e-smith/events/actions/zarafa-services start > /dev/null"); |
2208 |
+ |
2209 |
+ $self->success('MODIFY_CONFIG_SUCCESS'); |
2210 |
+ } |
2211 |
+ # Activation du service InnoDB |
2212 |
+ # Activation of InnoDB service |
2213 |
+ elsif(!$current_innodb && $innodb eq 'enabled'){ |
2214 |
+ # Ajout de l'InnoDB, arrêt des services MySQL et Zarafa et suppression des fichiers MySQL |
2215 |
+ # Add the InnoDB, stop MySQL and Zarafa service and delete MySQL file |
2216 |
+ system("/sbin/e-smith/db configuration setprop mysqld InnoDB enabled"); |
2217 |
+ system("/etc/e-smith/events/actions/zarafa-services stop > /dev/null"); |
2218 |
+ system("/sbin/service mysqld stop > /dev/null"); |
2219 |
+ system("rm -R -f /var/lib/mysql/ib_logfile0"); |
2220 |
+ system("rm -R -f /var/lib/mysql/ib_logfile1"); |
2221 |
+ system("rm -R -f /var/lib/mysql/ibdata1"); |
2222 |
+ |
2223 |
+ # Récupération du contenu du fichier configuration MySQL, modification des valeurs et écriture |
2224 |
+ # Recovery of the MysQL configuration file, values modification and writing |
2225 |
+ open(MYCNF, "/etc/e-smith/templates/etc/my.cnf/009innodb") or die "Impossible d'ouvrir 0009innodb"; |
2226 |
+ my @contenu = <MYCNF>; |
2227 |
+ close(MYCNF); |
2228 |
+ |
2229 |
+ my $buffer_pool_size = $cgi->param('buffer_pool_size'); |
2230 |
+ my $additional_mem_pool_size = $cgi->param('additional_mem_pool_size'); |
2231 |
+ my $log_file_size = $cgi->param('log_file_size'); |
2232 |
+ my $log_buffer_size = $cgi->param('log_buffer_size'); |
2233 |
+ |
2234 |
+ foreach my $ligne (@contenu){ |
2235 |
+ if($ligne =~ m/buffer_pool_size/){ |
2236 |
+ $ligne =~ s/\d+/$buffer_pool_size/g; |
2237 |
+ } |
2238 |
+ elsif($ligne =~ m/additional_mem_pool_size/){ |
2239 |
+ $ligne =~ s/\d+/$additional_mem_pool_size/g; |
2240 |
+ } |
2241 |
+ elsif($ligne =~ m/log_file_size/){ |
2242 |
+ $ligne =~ s/\d+/$log_file_size/g; |
2243 |
+ } |
2244 |
+ elsif($ligne =~ m/log_buffer_size/){ |
2245 |
+ $ligne =~ s/\d+/$log_buffer_size/g; |
2246 |
+ } |
2247 |
+ } |
2248 |
+ |
2249 |
+ open(ECRIRE, ">/etc/e-smith/templates/etc/my.cnf/009innodb"); |
2250 |
+ foreach my $ligne (@contenu) { |
2251 |
+ chomp $ligne; |
2252 |
+ print ECRIRE "$ligne\n"; |
2253 |
+ } |
2254 |
+ close(ECRIRE); |
2255 |
+ |
2256 |
+ # Génération du fichier configuration et redémarrage des services |
2257 |
+ # Configuration file generation and restart services |
2258 |
+ system("/sbin/e-smith/expand-template /etc/my.cnf"); |
2259 |
+ system("/sbin/service mysqld start > /dev/null"); |
2260 |
+ system("/etc/e-smith/events/actions/zarafa-services start > /dev/null"); |
2261 |
+ |
2262 |
+ $self->success('MODIFY_CONFIG_SUCCESS'); |
2263 |
+ } |
2264 |
+ # Simple modifications des valeurs |
2265 |
+ # Only values modifications |
2266 |
+ elsif($current_innodb eq 'enabled' && $innodb eq 'enabled'){ |
2267 |
+ # Arrêt des services MySQL et Zarafa |
2268 |
+ # Stop of MySQL and Zarafa services |
2269 |
+ system("/etc/e-smith/events/actions/zarafa-services stop > /dev/null"); |
2270 |
+ system("/sbin/service mysqld stop > /dev/null"); |
2271 |
+ # Suppression des fichiers MySQL |
2272 |
+ # Deleting MySQL file |
2273 |
+ system("rm -R -f /var/lib/mysql/ib_logfile0"); |
2274 |
+ system("rm -R -f /var/lib/mysql/ib_logfile1"); |
2275 |
+ system("rm -R -f /var/lib/mysql/ibdata1"); |
2276 |
+ |
2277 |
+ |
2278 |
+ # Récupération du contenu du fichier configuration MySQL, modification des valeurs et écriture |
2279 |
+ # Recovery of the MysQL configuration file, values modification and writing |
2280 |
+ open(MYCNF, "/etc/e-smith/templates/etc/my.cnf/009innodb") or die "Impossible d'ouvrir 0009innodb"; |
2281 |
+ my @contenu = <MYCNF>; |
2282 |
+ close(MYCNF); |
2283 |
+ |
2284 |
+ my $buffer_pool_size = $cgi->param('buffer_pool_size'); |
2285 |
+ my $additional_mem_pool_size = $cgi->param('additional_mem_pool_size'); |
2286 |
+ my $log_file_size = $cgi->param('log_file_size'); |
2287 |
+ my $log_buffer_size = $cgi->param('log_buffer_size'); |
2288 |
+ |
2289 |
+ foreach my $ligne (@contenu){ |
2290 |
+ if($ligne =~ m/buffer_pool_size/){ |
2291 |
+ $ligne =~ s/\d+/$buffer_pool_size/g; |
2292 |
+ } |
2293 |
+ elsif($ligne =~ m/additional_mem_pool_size/){ |
2294 |
+ $ligne =~ s/\d+/$additional_mem_pool_size/g; |
2295 |
+ } |
2296 |
+ elsif($ligne =~ m/log_file_size/){ |
2297 |
+ $ligne =~ s/\d+/$log_file_size/g; |
2298 |
+ } |
2299 |
+ elsif($ligne =~ m/log_buffer_size/){ |
2300 |
+ $ligne =~ s/\d+/$log_buffer_size/g; |
2301 |
+ } |
2302 |
+ } |
2303 |
+ |
2304 |
+ open(ECRIRE, ">/etc/e-smith/templates/etc/my.cnf/009innodb"); |
2305 |
+ foreach my $ligne (@contenu) { |
2306 |
+ chomp $ligne; |
2307 |
+ print ECRIRE "$ligne\n"; |
2308 |
+ } |
2309 |
+ close(ECRIRE); |
2310 |
+ |
2311 |
+ # Génération du fichier configuration et redémarrage des services |
2312 |
+ # Configuration file generation and restart services |
2313 |
+ system("/sbin/e-smith/expand-template /etc/my.cnf"); |
2314 |
+ system("/sbin/service mysqld start > /dev/null"); |
2315 |
+ system("/etc/e-smith/events/actions/zarafa-services start > /dev/null"); |
2316 |
+ |
2317 |
+ $self->success('MODIFY_CONFIG_SUCCESS'); |
2318 |
+ } |
2319 |
+ else { |
2320 |
+ $self->success('NO_MODIFICATION_ASKED'); |
2321 |
+ } |
2322 |
+} |
2323 |
+ |
2324 |
+# only_num permet de vérifier si une valeur ne contient bien que des chiffres |
2325 |
+############################################################################# |
2326 |
+# only_num is used to verify if a value is only a numeric value |
2327 |
+ |
2328 |
+sub only_num { |
2329 |
+ |
2330 |
+ my ($fm, $value) = @_; |
2331 |
+ my $self = shift; |
2332 |
+ my $return_error = $self->localise('NOT_NUM'); |
2333 |
+ |
2334 |
+ if ($value =~ /^\d+$/){ |
2335 |
+ return "OK"; |
2336 |
+ } |
2337 |
+ else { |
2338 |
+ return $return_error; |
2339 |
+ } |
2340 |
+} |
2341 |
+ |
2342 |
+sub print_message { |
2343 |
+ |
2344 |
+ my ($fm, $word) = @_; |
2345 |
+ $word = $fm->localise($word); |
2346 |
+ print qq(<tr><td colspan=2>$word</td></tr>); |
2347 |
+ return undef; |
2348 |
+ |
2349 |
+} |
2350 |
\ No newline at end of file |
2351 |
diff -urN smeserver-zarafa-0.9.0.orig/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/zarafaUI.pm smeserver-zarafa-0.9.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/zarafaUI.pm |
2352 |
--- smeserver-zarafa-0.9.0.orig/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/zarafaUI.pm 1970-01-01 10:00:00.000000000 +1000 |
2353 |
+++ smeserver-zarafa-0.9.0/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/zarafaUI.pm 2009-06-01 21:15:18.000000000 +1000 |
2354 |
@@ -0,0 +1,1934 @@ |
2355 |
+#!/usr/bin/perl -w |
2356 |
+ |
2357 |
+package esmith::FormMagick::Panel::zarafaUI; |
2358 |
+ |
2359 |
+ use strict; |
2360 |
+ use warnings; |
2361 |
+ use esmith::ConfigDB; |
2362 |
+ use esmith::AccountsDB; |
2363 |
+ use esmith::FormMagick; |
2364 |
+ use esmith::cgi; |
2365 |
+ use File::Basename; |
2366 |
+ use esmith::util; |
2367 |
+ use Exporter; |
2368 |
+ use esmith::DB; |
2369 |
+ |
2370 |
+ our $accountdb = esmith::AccountsDB->open(); |
2371 |
+ our $configdb = esmith::ConfigDB->open(); |
2372 |
+ |
2373 |
+ our @ISA = qw(esmith::FormMagick Exporter); |
2374 |
+ |
2375 |
+ our @EXPORT = qw(); |
2376 |
+ |
2377 |
+ our $VERSION = sprintf '%d.%03d', q$Revision: 1.1 $ =~ /: (\d+).(\d+)/; |
2378 |
+ |
2379 |
+ |
2380 |
+ our $multicompany_enabled; |
2381 |
+ open(LIRE, "/etc/e-smith/templates/etc/zarafa/server.cfg/server.cfg"); |
2382 |
+ while(<LIRE>){ |
2383 |
+ my $ligne = $_; |
2384 |
+ if($ligne =~ m/^enable_hosted_zarafa/){ |
2385 |
+ $multicompany_enabled = $ligne; |
2386 |
+ $multicompany_enabled =~ s/enable_hosted_zarafa\s+\=\s//g; |
2387 |
+ } |
2388 |
+ } |
2389 |
+ close(LIRE); |
2390 |
+ |
2391 |
+ |
2392 |
+# Ce fichier contient les fonction nécessaire pour gérer l'interface entre le serveur SME et la configuration des utilisateurs |
2393 |
+# et des groupes du module Zarafa. |
2394 |
+# Ce fichier regroupe des fonctions d'affichage, de modifications et de vérifications de données contenu dans Zarafa. |
2395 |
+################################################################################################################################# |
2396 |
+# This file contains the required functions in order to handle the interface between SME server and Zarafa configuration module's |
2397 |
+# for users and groups. |
2398 |
+# It contains display, modify, create and verification functions for Zarafa. |
2399 |
+ |
2400 |
+ |
2401 |
+# La fonction show_users permet d'afficher un tableaux reprenant l'enssemble des utilisateurs de Zarafa sur la page principale |
2402 |
+# avec possibilité de supprimer et de modifier les utilisateurs présents. |
2403 |
+############################################################################################################################################## |
2404 |
+# The show_users function allow you to display an array which contains all the users of zarafa with links to modify and delete users functions |
2405 |
+ |
2406 |
+sub show_users { |
2407 |
+ |
2408 |
+ my $self = shift; |
2409 |
+ my $q = $self->{cgi}; |
2410 |
+ |
2411 |
+ if ($multicompany_enabled =~ m/false/){ |
2412 |
+ |
2413 |
+ # Initialisation |
2414 |
+ my $ligne = 5; |
2415 |
+ my $nbrligne = `zarafa-admin -l | wc -l`; |
2416 |
+ my $scriptname = basename($0); |
2417 |
+ |
2418 |
+ # Localisation |
2419 |
+ my $username = $self->localise('USERNAME'); |
2420 |
+ my $fullname = $self->localise('FULLNAME'); |
2421 |
+ my $delete = $self->localise('DELETE'); |
2422 |
+ |
2423 |
+ # Affichage de l'en-tête du tableau |
2424 |
+ # Display of the header |
2425 |
+ print " <tr>\n <td colspan=\"2\">\n "; |
2426 |
+ print $q->start_table ({-CLASS => "sme-border"}),"\n "; |
2427 |
+ print $q->Tr( |
2428 |
+ esmith::cgi::genSmallCell($q, $username,"header"), |
2429 |
+ esmith::cgi::genSmallCell($q, $fullname,"header"), |
2430 |
+ esmith::cgi::genSmallCell($q, $delete,"header")); |
2431 |
+ |
2432 |
+ |
2433 |
+ # Affichage des utilisateurs et des liens correspondants |
2434 |
+ # Display users and corresponding links |
2435 |
+ my @usertab; |
2436 |
+ my $nbr = 0; |
2437 |
+ while ($ligne < $nbrligne) { |
2438 |
+ $usertab[$nbr] = `zarafa-admin -l | cut -f2 | awk 'NR == $ligne'`; |
2439 |
+ $ligne ++; |
2440 |
+ $nbr ++; |
2441 |
+ } |
2442 |
+ my @out = sort @usertab; |
2443 |
+ foreach my $user (@out){ |
2444 |
+ chomp $user; |
2445 |
+ if ($user =~ /^([-\@\w.]+)$/) { |
2446 |
+ $user = $1; # $data now untainted |
2447 |
+ } |
2448 |
+ else { |
2449 |
+ die "bad data in $user"; |
2450 |
+ } |
2451 |
+ my $modify = "<a href=\"$scriptname?page=0&wherenext=DisplayDetails&actUsr=$user\">$user</a>"; |
2452 |
+ my $delete_user = "<a href=\"$scriptname?page=0&wherenext=DeleteUser&actUsr=$user\">$delete</a>"; |
2453 |
+ print $q->Tr( |
2454 |
+ esmith::cgi::genSmallCell($q,$modify ,"normal")," ", |
2455 |
+ esmith::cgi::genSmallCell($q, `zarafa-admin --details \"$user\" | cut -f3 | awk 'NR == 2'`,"normal"), |
2456 |
+ esmith::cgi::genSmallCell($q,$delete_user,"normal")); |
2457 |
+ } |
2458 |
+ |
2459 |
+ |
2460 |
+ print qq(</table></td></tr>\n); |
2461 |
+ |
2462 |
+ # Localisation |
2463 |
+ my $add_user = $self->localise('ADD_USER'); |
2464 |
+ my $add_user_bubble = $self->localise('ADD_USER_BUBBLE'); |
2465 |
+ |
2466 |
+ # Affichage bouton ajouter utilisateur |
2467 |
+ # Display the user's create button |
2468 |
+ my $out ="<p><a class=\"button-like\" |
2469 |
+ href=\"zarafaUI?page=0&wherenext=DisplayCreate\" title=\"$add_user_bubble\">$add_user</a></p>"; |
2470 |
+ |
2471 |
+ |
2472 |
+ return $out; |
2473 |
+ } |
2474 |
+ |
2475 |
+ elsif ($multicompany_enabled =~ m/true/){ |
2476 |
+ |
2477 |
+ # Initialisation |
2478 |
+ my $ligne = 4; |
2479 |
+ my $nbrligne = `zarafa-admin --list-companies | wc -l`; |
2480 |
+ $nbrligne ++; |
2481 |
+ my $scriptname = basename($0); |
2482 |
+ |
2483 |
+ # Localisation |
2484 |
+ my $companyname = $self->localise('COMPANYNAME'); |
2485 |
+ my $delete = $self->localise('DELETE'); |
2486 |
+ |
2487 |
+ # Affichage de l'en-tête du tableau |
2488 |
+ # Display of the header |
2489 |
+ print " <tr>\n <td colspan=\"2\">\n "; |
2490 |
+ print $q->start_table ({-CLASS => "sme-border"}),"\n "; |
2491 |
+ print $q->Tr( |
2492 |
+ esmith::cgi::genSmallCell($q, $companyname,"header"), |
2493 |
+ esmith::cgi::genSmallCell($q, $delete,"header")); |
2494 |
+ |
2495 |
+ # Affichage des utilisateurs et des liens correspondants |
2496 |
+ # Display users and corresponding links |
2497 |
+ my @usertab; |
2498 |
+ my $nbr = 0; |
2499 |
+ while ($ligne < $nbrligne) { |
2500 |
+ $usertab[$nbr] = `zarafa-admin --list-companies | cut -f2 | awk 'NR == $ligne'`; |
2501 |
+ $ligne ++; |
2502 |
+ $nbr ++; |
2503 |
+ } |
2504 |
+ my @out = sort @usertab; |
2505 |
+ foreach my $company (@out){ |
2506 |
+ chomp $company; |
2507 |
+ if ($company =~ /^([-\@\w.]+)$/) { |
2508 |
+ $company = $1; # $data now untainted |
2509 |
+ } |
2510 |
+ else { |
2511 |
+ die "bad data in $company"; |
2512 |
+ } |
2513 |
+ my $modify = "<a href=\"$scriptname?page=0&wherenext=DisplayCompanyDetails&actComp=$company\">$company</a>"; |
2514 |
+ my $delete_company = "<a href=\"$scriptname?page=0&wherenext=DeleteCompany&actComp=$company\">$delete</a>"; |
2515 |
+ print $q->Tr( |
2516 |
+ esmith::cgi::genSmallCell($q,$modify ,"normal")," ", |
2517 |
+ esmith::cgi::genSmallCell($q,$delete_company,"normal")); |
2518 |
+ } |
2519 |
+ |
2520 |
+ |
2521 |
+ print qq(</table></td></tr>\n); |
2522 |
+ |
2523 |
+ # Localisation |
2524 |
+ my $add_comp = $self->localise('ADD_COMP'); |
2525 |
+ my $add_comp_bubble = $self->localise('ADD_COMP_BUBBLE'); |
2526 |
+ |
2527 |
+ # Affichage bouton ajouter utilisateur |
2528 |
+ # Display the user's create button |
2529 |
+ my $out ="<p><a class=\"button-like\" |
2530 |
+ href=\"zarafaUI?page=0&wherenext=CreateCompany\" title=\"$add_comp_bubble\">$add_comp</a></p>"; |
2531 |
+ |
2532 |
+ return $out; |
2533 |
+ } |
2534 |
+} |
2535 |
+ |
2536 |
+# La fonction transfer_page est requise lors de l'utilisation de lien afin de renvoyer l'utilisateur sur la bonne page. |
2537 |
+# Elle récupére le nom de la page demandé et redirige automatiquement l'utilisateur. |
2538 |
+############################################################################################################################# |
2539 |
+# The transfer_page function is use when the user do an action which need another page in order to redirect to the next page. |
2540 |
+ |
2541 |
+sub transfer_page { |
2542 |
+ |
2543 |
+ my ($self, $next_page) = @_; |
2544 |
+ |
2545 |
+ $self->{cgi}->param(-name => 'wherenext', -value => $next_page); |
2546 |
+ |
2547 |
+} |
2548 |
+ |
2549 |
+# display_user_details affiche les détails de l'utilisateur passé en paramétre dans des champs modifiables |
2550 |
+########################################################################################################## |
2551 |
+# display_user_details display the details of the username pass in parameter into editable fields. |
2552 |
+ |
2553 |
+sub display_user_details { |
2554 |
+ |
2555 |
+ |
2556 |
+ my $self = shift; |
2557 |
+ my $cgi = $self->{cgi}; |
2558 |
+ |
2559 |
+ # Récupération du nom de l'utilisateur et vérification de sa fiabilité |
2560 |
+ # recovery of the username and test is reliability |
2561 |
+ my $recept_user = $cgi->param('actUsr'); |
2562 |
+ if ($recept_user =~ /^([-\@\w.]+)$/) { |
2563 |
+ $recept_user = $1; # $data now untainted |
2564 |
+ } |
2565 |
+ else { |
2566 |
+ die "Bad data in '$recept_user'"; |
2567 |
+ } |
2568 |
+ my ($user, $Emailaddress, $active, $admin, $meeting_req, $quota_overr, |
2569 |
+ $warnlvl, $softlvl, $hardlvl, $store_size, $decline_dbl, $decline_recur); |
2570 |
+ |
2571 |
+ # Récupération des informations de l'utilisateur |
2572 |
+ # recovery of user's information |
2573 |
+ open(DETAILS, "zarafa-admin --details \"$recept_user\" |") or die "probléme ouverture fichier"; |
2574 |
+ while (<DETAILS>){ |
2575 |
+ if(m/^Fullname/){ |
2576 |
+ $user = $_; |
2577 |
+ $user =~ s/^\w+:\t*//; |
2578 |
+ } |
2579 |
+ if(m/^Emailaddress/){ |
2580 |
+ $Emailaddress = $_; |
2581 |
+ $Emailaddress =~ s/^\w+:\t*//; |
2582 |
+ } |
2583 |
+ if(m/^Active/){ |
2584 |
+ $active = $_; |
2585 |
+ chomp $active; |
2586 |
+ $active =~ s/^\w+:\t*//; |
2587 |
+ } |
2588 |
+ if(m/^Administrator/){ |
2589 |
+ $admin = $_; |
2590 |
+ chomp $admin; |
2591 |
+ $admin =~ s/^\w+:\t*//; |
2592 |
+ } |
2593 |
+ if(m/^Auto-accept/){ |
2594 |
+ $meeting_req = $_; |
2595 |
+ chomp $meeting_req; |
2596 |
+ $meeting_req =~ s/.+://; |
2597 |
+ } |
2598 |
+ if(m/^Decline dbl/){ |
2599 |
+ $decline_dbl = $_; |
2600 |
+ chomp $decline_dbl; |
2601 |
+ $decline_dbl =~ s/Decline dbl meetingreq:\t*//; |
2602 |
+ } |
2603 |
+ if(m/^Decline recur/){ |
2604 |
+ $decline_recur = $_; |
2605 |
+ chomp $decline_recur; |
2606 |
+ $decline_recur =~ s/Decline recur meet\.req:\t*//; |
2607 |
+ } |
2608 |
+ if(m/^Quota overrides/){ |
2609 |
+ $quota_overr = $_; |
2610 |
+ chomp $quota_overr; |
2611 |
+ $quota_overr =~ s/Quota overrides:\t*//; |
2612 |
+ } |
2613 |
+ if(m/^Warning level/){ |
2614 |
+ $warnlvl = $_; |
2615 |
+ chomp $warnlvl; |
2616 |
+ $warnlvl =~ s/Warning level:\t*//; |
2617 |
+ if($warnlvl =~ m/KB/){ |
2618 |
+ $warnlvl =~ s/.{3}$//g; |
2619 |
+ $warnlvl = $warnlvl / 1024; |
2620 |
+ } |
2621 |
+ } |
2622 |
+ if(m/^Soft level/){ |
2623 |
+ $softlvl = $_; |
2624 |
+ chomp $softlvl; |
2625 |
+ $softlvl =~ s/Soft level:\t*//; |
2626 |
+ if($softlvl =~ m/KB/){ |
2627 |
+ $softlvl =~ s/.{3}$//g; |
2628 |
+ $softlvl = $softlvl / 1024; |
2629 |
+ } |
2630 |
+ } |
2631 |
+ if(m/^Hard level/){ |
2632 |
+ $hardlvl = $_; |
2633 |
+ chomp $hardlvl; |
2634 |
+ $hardlvl =~ s/Hard level:\t*//; |
2635 |
+ if($hardlvl =~ m/KB/){ |
2636 |
+ $hardlvl =~ s/.{3}$//g; |
2637 |
+ $hardlvl = $hardlvl / 1024; |
2638 |
+ } |
2639 |
+ } |
2640 |
+ if(m/^Current store size/){ |
2641 |
+ $store_size = $_; |
2642 |
+ chomp $store_size; |
2643 |
+ $store_size =~ s/Current store size:\t*//; |
2644 |
+ if($store_size =~ m/B/){ |
2645 |
+ $store_size =~ s/\sB//i; |
2646 |
+ $store_size /= 1048576; |
2647 |
+ $store_size =~ s/(\.\d{5})\d*/$1/; |
2648 |
+ $store_size .= " Mo"; |
2649 |
+ } |
2650 |
+ if($store_size =~ m/KB/){ |
2651 |
+ $store_size =~ s/\sKB//i; |
2652 |
+ $store_size /= 1024; |
2653 |
+ $store_size .= " Mo"; |
2654 |
+ } |
2655 |
+ } |
2656 |
+ } |
2657 |
+ close(DETAILS); |
2658 |
+ |
2659 |
+ # Vérification de la présence de l'utilisateur dans la BD serveur |
2660 |
+ # Verify if the user is in the Server's DB |
2661 |
+ my $zarafa_text = $self->localise('CAUTION_NOT_DB'); |
2662 |
+ my $present = 0; |
2663 |
+ |
2664 |
+ my $test = $accountdb->get("$recept_user"); |
2665 |
+ if($test){ |
2666 |
+ $zarafa_text = $self->localise('IN_DB'); |
2667 |
+ $present = 1; |
2668 |
+ } |
2669 |
+ |
2670 |
+ # Remplissage des champs de l'interface avec les données récupérés |
2671 |
+ # Filling of user's field with the previous data |
2672 |
+ $cgi->param(-name=>'Username', -value=>$recept_user); |
2673 |
+ $cgi->param(-name=>'Fullname', -value=>$user); |
2674 |
+ $cgi->param(-name=>'EmailAddress', -value=>$Emailaddress); |
2675 |
+ $cgi->param(-name=>'Admin', -value=>$admin); |
2676 |
+ $cgi->param(-name=>'quota', -value=>$quota_overr); |
2677 |
+ $cgi->param(-name=>'Warnlvl', -value=>$warnlvl); |
2678 |
+ $cgi->param(-name=>'Softlvl', -value=>$softlvl); |
2679 |
+ $cgi->param(-name=>'Hardlvl', -value=>$hardlvl); |
2680 |
+ $cgi->param(-name=>'auto_meeting_req', -value=>$meeting_req); |
2681 |
+ $cgi->param(-name=>'dbl_meeting', -value=>$decline_dbl); |
2682 |
+ $cgi->param(-name=>'decline_recur_meeting', -value=>$decline_recur); |
2683 |
+ |
2684 |
+ # Localisation |
2685 |
+ my $enabled = $self->localise('ENABLED'); |
2686 |
+ my $disabled = $self->localise('DISABLED'); |
2687 |
+ |
2688 |
+ |
2689 |
+ # Affichage de l'option zarafa pour ceux qui sont dans la BD |
2690 |
+ # Display of the zarafa's button if the user is in the server's DB |
2691 |
+ my $zarafa_status; |
2692 |
+ my $out; |
2693 |
+ if($present == 1){ |
2694 |
+ unless($configdb->get_prop("zarafa-server",'GlobalForward')){ |
2695 |
+ $zarafa_status = $accountdb->get_prop("$recept_user",'zarafa'); |
2696 |
+ |
2697 |
+ $out = "<tr>\n <td class=\"sme-noborders-label\">" |
2698 |
+ . "Zarafa" |
2699 |
+ . "</td>\n <td>\n" |
2700 |
+ . " <table border='0' cellspacing='0' cellpadding='0'>\n"; |
2701 |
+ if($zarafa_status){ |
2702 |
+ $out .="<td>$enabled</td><td><input type=\"radio\" name=\"zarafa\" checked=\"checked\"" |
2703 |
+ ." value=\"enabled\"></td>" |
2704 |
+ ."<td>$disabled</td><td><input type=\"radio\" name=\"zarafa\"" |
2705 |
+ ." value=\"disabled\"></td>\n" |
2706 |
+ ."</tr>\n"; |
2707 |
+ } |
2708 |
+ else { |
2709 |
+ $out .="<td>$enabled</td><td><input type=\"radio\" name=\"zarafa\"" |
2710 |
+ ." value=\"enabled\"></td>" |
2711 |
+ ."<td>$disabled</td><td><input type=\"radio\" name=\"zarafa\" checked=\"checked\"" |
2712 |
+ ." value=\"disabled\"></td>\n" |
2713 |
+ ."</tr>\n"; |
2714 |
+ } |
2715 |
+ $out .= " </table>\n </td>\n </tr>\n"; |
2716 |
+ } |
2717 |
+ |
2718 |
+ |
2719 |
+ # Affichage de l'option SortSpam pour ceux qui sont dans la BD |
2720 |
+ # Display of the SortSpam's button if the user is in the server's DB |
2721 |
+ my $sortspam = $accountdb->get_prop("$recept_user",'SortSpam'); |
2722 |
+ $out .= "<tr>\n <td class=\"sme-noborders-label\">" |
2723 |
+ . "SortSpam" |
2724 |
+ . "</td>\n <td>\n" |
2725 |
+ . " <table border='0' cellspacing='0' cellpadding='0'>\n"; |
2726 |
+ if($sortspam){ |
2727 |
+ $out .="<td>$enabled</td><td><input type=\"checkbox\" name=\"sortspam\" checked" |
2728 |
+ ." value=\"enabled\"></td>" |
2729 |
+ ."</tr>\n"; |
2730 |
+ } |
2731 |
+ else { |
2732 |
+ $out .="<td>$enabled</td><td><input type=\"checkbox\" name=\"sortspam\"" |
2733 |
+ ." value=\"disabled\"></td>" |
2734 |
+ ."</tr>\n"; |
2735 |
+ } |
2736 |
+ $out .= " </table>\n </td>\n </tr>\n"; |
2737 |
+ } |
2738 |
+ |
2739 |
+ |
2740 |
+ # Localisation |
2741 |
+ # Localization |
2742 |
+ my $details = $self->localise('DETAILS'); |
2743 |
+ my $stock_use = $self->localise('STOCK_USE'); |
2744 |
+ my $active_user = $self->localise('ACTIVE_USER'); |
2745 |
+ |
2746 |
+ print "$details $recept_user - $user - $stock_use $store_size $active_user $active - $zarafa_text"; |
2747 |
+ |
2748 |
+return $out; |
2749 |
+} |
2750 |
+ |
2751 |
+# display_modify_button permet l'affichage d'un bouton 'Modify' |
2752 |
+############################################################################ |
2753 |
+# display_modify_button is use to display a button with 'modify' text inside |
2754 |
+ |
2755 |
+sub display_modify_button { |
2756 |
+ |
2757 |
+ my ($self) = @_; |
2758 |
+ |
2759 |
+ my $cgi = $self->{cgi}; |
2760 |
+ |
2761 |
+ my $button = $self->localise('MODIFY_BUTTON'); |
2762 |
+ |
2763 |
+ $self->print_button("$button"); |
2764 |
+ |
2765 |
+} |
2766 |
+ |
2767 |
+# display_create_button permet l'affichage d'un bouton 'Create' |
2768 |
+############################################################################ |
2769 |
+# display_create_button is use to display a button with 'Create' text inside |
2770 |
+ |
2771 |
+sub display_create_button { |
2772 |
+ |
2773 |
+ my ($self) = @_; |
2774 |
+ my $cgi = $self->{cgi}; |
2775 |
+ |
2776 |
+ my $button = $self->localise('CREATE_BUTTON'); |
2777 |
+ $self->print_button("$button"); |
2778 |
+} |
2779 |
+ |
2780 |
+# display_delete_button permet l'affichage d'information sur l'utilisateur ainsi qu'un bouton 'Delete' |
2781 |
+###################################################################################################### |
2782 |
+# display_delete_button is use to display some user information and a button with 'Delete' text inside |
2783 |
+ |
2784 |
+sub display_delete_button { |
2785 |
+ |
2786 |
+ my ($self) = @_; |
2787 |
+ my $cgi = $self->{cgi}; |
2788 |
+ |
2789 |
+ my $recept_user = $cgi->param('actUsr'); |
2790 |
+ if ($recept_user =~ /^([-\@\w.]+)$/) { |
2791 |
+ $recept_user = $1; # $data now untainted |
2792 |
+ } |
2793 |
+ else { |
2794 |
+ die "Bad data in '$recept_user'"; |
2795 |
+ } |
2796 |
+ |
2797 |
+ my $user = `zarafa-admin --details $recept_user | awk 'NR == 2'`; |
2798 |
+ $user =~ s/Fullname:\t\t//g; |
2799 |
+ |
2800 |
+ my $store_size = `zarafa-admin --details $recept_user | awk 'NR == 11'`; |
2801 |
+ $store_size =~ s/Current store size:\t//g; |
2802 |
+ if($store_size =~ m/B/){ |
2803 |
+ $store_size =~ s/\sB//i; |
2804 |
+ $store_size /= 1048576; |
2805 |
+ $store_size .= " Mb"; |
2806 |
+ } |
2807 |
+ if($store_size =~ m/KB/){ |
2808 |
+ $store_size =~ s/\sKB//i; |
2809 |
+ $store_size /= 1024; |
2810 |
+ $store_size .= " Mb"; |
2811 |
+ } |
2812 |
+ |
2813 |
+ |
2814 |
+ my $active = `zarafa-admin --details $recept_user | awk 'NR == 4'`; |
2815 |
+ $active =~ s/Active:\t\t\t//g; |
2816 |
+ |
2817 |
+ |
2818 |
+ # Localisation |
2819 |
+ # Localization |
2820 |
+ my $details = $self->localise('DETAILS'); |
2821 |
+ my $stock_use = $self->localise('STOCK_USE'); |
2822 |
+ my $active_user = $self->localise('ACTIVE_USER'); |
2823 |
+ my $button = $self->localise('DELETE_BUTTON'); |
2824 |
+ |
2825 |
+ print "$details $recept_user - $user - $stock_use $store_size - $active_user $active"; |
2826 |
+ |
2827 |
+ $self->print_button("$button"); |
2828 |
+} |
2829 |
+ |
2830 |
+# La fonction modify_user récupére le contenu de multiple champs afin de mettre à jour le contenu de Zarafa |
2831 |
+########################################################################################################### |
2832 |
+# The modify_user function recover the content of multiple fields in order to update Zarafa's content |
2833 |
+ |
2834 |
+sub modify_user { |
2835 |
+ |
2836 |
+ my ($self) = @_; |
2837 |
+ my $cgi = $self->{cgi}; |
2838 |
+ |
2839 |
+ # Récupération de l'utilisateur à modifier |
2840 |
+ # Recovery of the user for modified |
2841 |
+ my $user = $cgi->param('actUsr'); |
2842 |
+ if ($user =~ /^([-\@\w.]+)$/) { |
2843 |
+ $user = $1; # $data now untainted |
2844 |
+ } |
2845 |
+ else { |
2846 |
+ die "bad data in $user"; |
2847 |
+ } |
2848 |
+ |
2849 |
+ # Récupération du contenu des champs |
2850 |
+ # Recovery of fields contents |
2851 |
+ my $user_id = $self->{cgi}->param('Username'); |
2852 |
+ if ($user_id =~ /^([-\@\w.]+)$/) { |
2853 |
+ $user_id = $1; # $data now untainted |
2854 |
+ } |
2855 |
+ else { |
2856 |
+ die "Bad data in '$user_id'"; |
2857 |
+ } |
2858 |
+ |
2859 |
+ my $user_fullname = $self->{cgi}->param('Fullname'); |
2860 |
+ chomp $user_fullname; |
2861 |
+ $user_fullname =~ s/ /@/g; |
2862 |
+ if ($user_fullname =~ /^([-\@\w.]+)$/) { |
2863 |
+ $user_fullname = $1; # $data now untainted |
2864 |
+ } |
2865 |
+ else { |
2866 |
+ die "Bad data in '$user_fullname'"; |
2867 |
+ } |
2868 |
+ $user_fullname =~ s/@/ /g; |
2869 |
+ $user_fullname = "\"".$user_fullname."\""; |
2870 |
+ |
2871 |
+ my $user_address = $self->{cgi}->param('EmailAddress'); |
2872 |
+ if ($user_address =~ /^([-\@\w.]+)$/) { |
2873 |
+ $user_address = $1; # $data now untainted |
2874 |
+ } |
2875 |
+ else { |
2876 |
+ die "Bad data in '$user_address'"; |
2877 |
+ } |
2878 |
+ |
2879 |
+ my $user_admin = $self->{cgi}->param('Admin'); |
2880 |
+ if ($user_admin =~ /^([-\@\w.]+)$/) { |
2881 |
+ $user_admin = $1; # $data now untainted |
2882 |
+ } |
2883 |
+ else { |
2884 |
+ die "Bad data in '$user_admin'"; |
2885 |
+ } |
2886 |
+ |
2887 |
+ my $user_quota = $self->{cgi}->param('quota'); |
2888 |
+ if ($user_quota =~ /^([-\@\w.]+)$/) { |
2889 |
+ $user_quota = $1; # $data now untainted |
2890 |
+ } |
2891 |
+ else { |
2892 |
+ die "Bad data in '$user_quota'"; |
2893 |
+ } |
2894 |
+ |
2895 |
+ my $user_warnlvl = $self->{cgi}->param('Warnlvl'); |
2896 |
+ unless ($user_warnlvl) |
2897 |
+ {$user_warnlvl = 0;} |
2898 |
+ if ($user_warnlvl =~ /^([-\@\w.]+)$/) { |
2899 |
+ $user_warnlvl = $1; # $data now untainted |
2900 |
+ } |
2901 |
+ else { |
2902 |
+ die "Bad data in '$user_warnlvl'"; |
2903 |
+ } |
2904 |
+ |
2905 |
+ my $user_softlvl = $self->{cgi}->param('Softlvl'); |
2906 |
+ unless ($user_softlvl) |
2907 |
+ {$user_softlvl = 0;} |
2908 |
+ if ($user_softlvl =~ /^([-\@\w.]+)$/) { |
2909 |
+ $user_softlvl = $1; # $data now untainted |
2910 |
+ } |
2911 |
+ else { |
2912 |
+ die "Bad data in '$user_softlvl'"; |
2913 |
+ } |
2914 |
+ |
2915 |
+ |
2916 |
+ my $user_hardlvl = $self->{cgi}->param('Hardlvl'); |
2917 |
+ unless ($user_hardlvl) |
2918 |
+ {$user_hardlvl = 0;} |
2919 |
+ if ($user_hardlvl =~ /^([-\@\w.]+)$/) { |
2920 |
+ $user_hardlvl = $1; # $data now untainted |
2921 |
+ } |
2922 |
+ else { |
2923 |
+ die "Bad data in '$user_hardlvl'"; |
2924 |
+ } |
2925 |
+ |
2926 |
+ |
2927 |
+ my $user_meeting = $self->{cgi}->param('auto_meeting_req'); |
2928 |
+ if ($user_meeting =~ /^([-\@\w.]+)$/) { |
2929 |
+ $user_meeting = $1; # $data now untainted |
2930 |
+ } |
2931 |
+ else { |
2932 |
+ die "Bad data in '$user_meeting'"; |
2933 |
+ } |
2934 |
+ |
2935 |
+ my $user_dbl = $self->{cgi}->param('dbl_meeting'); |
2936 |
+ if ($user_dbl =~ /^([-\@\w.]+)$/) { |
2937 |
+ $user_dbl = $1; |
2938 |
+ } |
2939 |
+ else { |
2940 |
+ die "Bad data in '$user_dbl'"; |
2941 |
+ } |
2942 |
+ |
2943 |
+ my $user_recur_meeting = $self->{cgi}->param('decline_recur_meeting'); |
2944 |
+ if ($user_recur_meeting =~ /^([-\@\w.]+)$/) { |
2945 |
+ $user_recur_meeting = $1; |
2946 |
+ } |
2947 |
+ else { |
2948 |
+ die "Bad data in '$user_recur_meeting'"; |
2949 |
+ } |
2950 |
+ |
2951 |
+ |
2952 |
+ # Récupération d'un nouveau mot de passe et remplacement de l'ancien |
2953 |
+ # Recovery of a new password and replacement of the old password |
2954 |
+ my $user_new_password = $self->{cgi}->param('new_password'); |
2955 |
+ if ($user_new_password){ |
2956 |
+ if ($user_new_password =~ /^([-\@\w.]+)$/) { |
2957 |
+ $user_new_password = $1; |
2958 |
+ } |
2959 |
+ else { |
2960 |
+ die "Bad data in '$user_new_password'"; |
2961 |
+ } |
2962 |
+ system("zarafa-admin -u $user -p $user_new_password > /dev/null") == 0 |
2963 |
+ or die "Une erreur est survenue lors du changement de password de l'utilisateur $user"; |
2964 |
+ } |
2965 |
+ |
2966 |
+ my $fm = shift; |
2967 |
+ my $q = $fm->{'cgi'}; |
2968 |
+ |
2969 |
+ my $zarafa_enabled = $q->param('zarafa'); |
2970 |
+ if($zarafa_enabled){ |
2971 |
+ if($zarafa_enabled eq 'enabled'){ |
2972 |
+ system("/sbin/e-smith/db accounts setprop \"$user_id\" zarafa enabled"); |
2973 |
+ system("/etc/e-smith/events/actions/qmail-update-user"); |
2974 |
+ |
2975 |
+ } |
2976 |
+ elsif($zarafa_enabled eq 'disabled'){ |
2977 |
+ system("/sbin/e-smith/db accounts delprop \"$user_id\" zarafa"); |
2978 |
+ system("/etc/e-smith/events/actions/qmail-update-user"); |
2979 |
+ } |
2980 |
+ } |
2981 |
+ |
2982 |
+ # Ajout des modifications dans la base de données Zarafa |
2983 |
+ # Modify information added into Zarafa database |
2984 |
+ if ($user eq $user_id){ |
2985 |
+ system("zarafa-admin -u $user -f $user_fullname -e $user_address -a $user_admin --qo $user_quota --qw $user_warnlvl --qs $user_softlvl --qh $user_hardlvl --mr-accept $user_meeting --mr-decline-conflict $user_dbl --mr-decline-recurring $user_recur_meeting > /dev/null") == 0 |
2986 |
+ or die "Une erreur est survenue lors de la modification de l'utilisateur"; |
2987 |
+ } |
2988 |
+ else { |
2989 |
+ system("zarafa-admin -u $user -U $user_id -f $user_fullname -e $user_address -a $user_admin --qo $user_quota --qw $user_warnlvl --qs $user_softlvl --qh $user_hardlvl --mr-accept $user_meeting --mr-decline-conflict $user_dbl --mr-decline-recurring $user_recur_meeting> /dev/null") == 0 |
2990 |
+ or die "Une erreur est survenue lors de la modificatoin de l'utilisateur"; |
2991 |
+ } |
2992 |
+ |
2993 |
+ |
2994 |
+ my $sortspam = $q->param('sortspam'); |
2995 |
+ if($sortspam eq 'enabled'){ |
2996 |
+ system("/sbin/e-smith/db accounts setprop \"$user_id\" SortSpam disabled"); |
2997 |
+ system("/sbin/e-smith/signal-event user-modify \"$user_id\""); |
2998 |
+ } |
2999 |
+ else{ |
3000 |
+ system("/sbin/e-smith/db accounts delprop \"$user_id\" SortSpam"); |
3001 |
+ system("/sbin/e-smith/signal-event user-modify \"$user_id\""); |
3002 |
+ } |
3003 |
+ |
3004 |
+ # Opération sur les groupes d'utilisateurs |
3005 |
+ # Operation on user's groups |
3006 |
+ my $eval = ""; |
3007 |
+ # Parcours de la liste des groupes |
3008 |
+ # Browse of the group liste |
3009 |
+ open(LISTGRP, "zarafa-admin -L | awk 'NR > 4' |"); |
3010 |
+ while(<LISTGRP>){ |
3011 |
+ my $groupeparam = $_; |
3012 |
+ $groupeparam =~ s/^\t//g; |
3013 |
+ chomp $groupeparam; |
3014 |
+ $groupeparam =~ s/ /_/g; |
3015 |
+ if ($groupeparam =~ /^([-\@\w.]+)$/) { |
3016 |
+ $groupeparam = $1; |
3017 |
+ } |
3018 |
+ else { |
3019 |
+ $groupeparam = $1; |
3020 |
+ } |
3021 |
+ |
3022 |
+ my $present = 0; |
3023 |
+ if($groupeparam){ |
3024 |
+ $groupeparam =~ s/_/ /g; |
3025 |
+ unless ($eval eq $groupeparam){ |
3026 |
+ # Si le bouton radio est sur oui ... |
3027 |
+ # If the radio button is 'on' ... |
3028 |
+ my $yesNo = $q->param("$groupeparam"); |
3029 |
+ if($yesNo eq 'Yes'){ |
3030 |
+ # On regarde si l'utilisateur est déja dans le groupe ... |
3031 |
+ # The user is allready in the group ? ... |
3032 |
+ open(ADDUSR, "zarafa-admin -l --details \"$groupeparam\" --type group |"); |
3033 |
+ while(<ADDUSR>){ |
3034 |
+ if(m/^\t$user/){ |
3035 |
+ $present = 1; |
3036 |
+ } |
3037 |
+ } |
3038 |
+ # Si il n'y est pas on le rajoute |
3039 |
+ # If it's not in the group, add it |
3040 |
+ unless($present == 1){ |
3041 |
+ system("zarafa-admin -b $user -i \"$groupeparam\" > /dev/null") == 0 |
3042 |
+ or die "Impossible de rajouter l'utilisateur $user dans le groupe $groupeparam"; |
3043 |
+ } |
3044 |
+ } |
3045 |
+ close(ADDUSR); |
3046 |
+ # Si le bouton radio est sur non ... |
3047 |
+ # If the radio button is 'off'... |
3048 |
+ if($yesNo eq 'No'){ |
3049 |
+ # On regarde si l'utilisateur est dans le groupe ... |
3050 |
+ # Is the user in the group ? ... |
3051 |
+ open(DELUSR, "zarafa-admin -l --details \"$groupeparam\" --type group |"); |
3052 |
+ while(<DELUSR>){ |
3053 |
+ if(m/^\t$user/){ |
3054 |
+ $present = 1; |
3055 |
+ } |
3056 |
+ } |
3057 |
+ # Si il y est on l'en enléve |
3058 |
+ # If it's in, remove it |
3059 |
+ if($present == 1){ |
3060 |
+ system("zarafa-admin -B $user -i \"$groupeparam\" > /dev/null") == 0 |
3061 |
+ or die "Impossible de supprimer l'utilisateur $user du groupe $groupeparam"; |
3062 |
+ } |
3063 |
+ close(DELUSR); |
3064 |
+ } |
3065 |
+ $eval = $groupeparam; |
3066 |
+ } |
3067 |
+ } |
3068 |
+ } |
3069 |
+ close(LISTGRP); |
3070 |
+ |
3071 |
+ $self->success('MODIFY_USER_SUCCESS'); |
3072 |
+ |
3073 |
+# Option possible pour mettre à jour ou créer des utilisateurs avec zarafa-admin |
3074 |
+# Zarafa-admin option for update and creation for users |
3075 |
+#-U username |
3076 |
+#-p password |
3077 |
+#-f fullname |
3078 |
+#-e emailaddress |
3079 |
+#-a admin |
3080 |
+#-n active user |
3081 |
+#--qo quota override |
3082 |
+#--qw quota warning |
3083 |
+#--qs quota soft |
3084 |
+#--qh quota hard |
3085 |
+#--mr-accept meeting request |
3086 |
+#--mr-decline-conflict |
3087 |
+#--mr-decline-recurring |
3088 |
+} |
3089 |
+ |
3090 |
+# La fonction Create_user récupére le contenu de plusieurs champs afin de créer un utilisateurs zarafa avec ces derniers |
3091 |
+######################################################################################################################## |
3092 |
+# The Create_user function recover the content of many fields in order to create a zarafa's user with them |
3093 |
+ |
3094 |
+sub Create_user { |
3095 |
+ |
3096 |
+ my ($self) = @_; |
3097 |
+ my $cgi = $self->{cgi}; |
3098 |
+ |
3099 |
+ # Récuperation du contenu des champs |
3100 |
+ # Recovery of content's fields |
3101 |
+ my $user_id = $self->{cgi}->param('Username'); |
3102 |
+ if ($user_id =~ /^([-\@\w.]+)$/) { |
3103 |
+ $user_id = $1; # $data now untainted |
3104 |
+ } |
3105 |
+ else { |
3106 |
+ die "Bad data in $user_id"; |
3107 |
+ } |
3108 |
+ |
3109 |
+ my $user_fullname = $self->{cgi}->param('Fullname'); |
3110 |
+ chomp $user_fullname; |
3111 |
+ $user_fullname =~ s/ /@/g; |
3112 |
+ if ($user_fullname =~ /^([-\@\w.]+)$/) { |
3113 |
+ $user_fullname = $1; # $data now untainted |
3114 |
+ } |
3115 |
+ else { |
3116 |
+ die "Bad data in '$user_fullname'"; |
3117 |
+ } |
3118 |
+ $user_fullname =~ s/@/ /g; |
3119 |
+ $user_fullname = "\"".$user_fullname."\""; |
3120 |
+ |
3121 |
+ my $user_psswrd = $self->{cgi}->param('Password'); |
3122 |
+ if ($user_psswrd =~ /^([-\@\w.]+)$/) { |
3123 |
+ $user_psswrd = $1; # $data now untainted |
3124 |
+ } |
3125 |
+ else { |
3126 |
+ die "Bad data in '$user_psswrd'"; |
3127 |
+ } |
3128 |
+ |
3129 |
+ my $user_address = $self->{cgi}->param('EmailAddress'); |
3130 |
+ if ($user_address =~ /^([-\@\w.]+)$/) { |
3131 |
+ $user_address = $1; # $data now untainted |
3132 |
+ } |
3133 |
+ else { |
3134 |
+ die "Bad data in '$user_address'"; |
3135 |
+ } |
3136 |
+ |
3137 |
+ my $user_admin = $self->{cgi}->param('Admin'); |
3138 |
+ if ($user_admin =~ /^([-\@\w.]+)$/) { |
3139 |
+ $user_admin = $1; # $data now untainted |
3140 |
+ } |
3141 |
+ else { |
3142 |
+ die "Bad data in '$user_admin'"; |
3143 |
+ } |
3144 |
+ |
3145 |
+ my $user_quota = $self->{cgi}->param('quota'); |
3146 |
+ if ($user_quota =~ /^([-\@\w.]+)$/) { |
3147 |
+ $user_quota = $1; # $data now untainted |
3148 |
+ } |
3149 |
+ else { |
3150 |
+ die "Bad data in '$user_quota'"; |
3151 |
+ } |
3152 |
+ |
3153 |
+ my $user_warnlvl = $self->{cgi}->param('Warnlvl'); |
3154 |
+ unless ($user_warnlvl) |
3155 |
+ {$user_warnlvl = 0;} |
3156 |
+ if ($user_warnlvl =~ /^([-\@\w.]+)$/) { |
3157 |
+ $user_warnlvl = $1; # $data now untainted |
3158 |
+ } |
3159 |
+ else { |
3160 |
+ die "Bad data in '$user_warnlvl'"; |
3161 |
+ } |
3162 |
+ |
3163 |
+ |
3164 |
+ my $user_softlvl = $self->{cgi}->param('Softlvl'); |
3165 |
+ unless ($user_softlvl) |
3166 |
+ {$user_softlvl = 0;} |
3167 |
+ if ($user_softlvl =~ /^([-\@\w.]+)$/) { |
3168 |
+ $user_softlvl = $1; # $data now untainted |
3169 |
+ } |
3170 |
+ else { |
3171 |
+ die "Bad data in '$user_softlvl'"; |
3172 |
+ } |
3173 |
+ |
3174 |
+ |
3175 |
+ my $user_hardlvl = $self->{cgi}->param('Hardlvl'); |
3176 |
+ unless ($user_hardlvl) |
3177 |
+ {$user_hardlvl = 0;} |
3178 |
+ if ($user_hardlvl =~ /^([-\@\w.]+)$/) { |
3179 |
+ $user_hardlvl = $1; # $data now untainted |
3180 |
+ } |
3181 |
+ else { |
3182 |
+ die "Bad data in '$user_hardlvl'"; |
3183 |
+ } |
3184 |
+ |
3185 |
+ my $user_active = $self->{cgi}->param('Active'); |
3186 |
+ if ($user_active =~ /^([-\@\w.]+)$/) { |
3187 |
+ $user_active = $1; # $data now untainted |
3188 |
+ } |
3189 |
+ else { |
3190 |
+ die "Bad data in '$user_active'"; |
3191 |
+ } |
3192 |
+ |
3193 |
+ # Création de l'utilisateur |
3194 |
+ # User's creation |
3195 |
+ system("zarafa-admin -c $user_id -f $user_fullname -p $user_psswrd -e $user_address -a $user_admin -n $user_active --qo $user_quota --qw $user_warnlvl --qs $user_softlvl --qh $user_hardlvl > /dev/null") == 0 |
3196 |
+ or die "Une erreur est survenue lors de la création de l'utilisateur"; |
3197 |
+ |
3198 |
+ # Ajout dans la BD Accounts du serveur SME |
3199 |
+ system("/sbin/e-smith/db accounts setprop \"$user_id\" zarafa enabled"); |
3200 |
+ system("/etc/e-smith/events/actions/qmail-update-user"); |
3201 |
+ |
3202 |
+ |
3203 |
+ # Attribution des groupes |
3204 |
+ # groups allocation |
3205 |
+ my $fm = shift; |
3206 |
+ my $q = $fm->{'cgi'}; |
3207 |
+ |
3208 |
+ my $eval = ""; |
3209 |
+ # Parcours de la liste des groupes |
3210 |
+ # Browse groups' list |
3211 |
+ open(LISTGRP, "zarafa-admin -L | awk 'NR > 4' |"); |
3212 |
+ while(<LISTGRP>){ |
3213 |
+ my $groupeparam = $_; |
3214 |
+ $groupeparam =~ s/^\t//g; |
3215 |
+ chomp $groupeparam; |
3216 |
+ $groupeparam =~ s/ /_/g; |
3217 |
+ if ($groupeparam =~ /^([-\@\w.]+)$/) { |
3218 |
+ $groupeparam = $1; |
3219 |
+ } |
3220 |
+ else { |
3221 |
+ $groupeparam = $1; |
3222 |
+ } |
3223 |
+ $groupeparam =~ s/_/ /g; |
3224 |
+ if($groupeparam){ |
3225 |
+ unless ($eval eq $groupeparam){ |
3226 |
+ my $yesNo = $q->param("$groupeparam"); |
3227 |
+ # Si le bouton radio est sur oui, on ajoute l'utilisateur au groupe |
3228 |
+ # If the radio button is 'on', the user is added to the group |
3229 |
+ if($yesNo eq 'Yes'){ |
3230 |
+ system("zarafa-admin -b $user_id -i \"$groupeparam\" > /dev/null") == 0 |
3231 |
+ or die "Impossible de rajouter l'utilisateur $user_id dans le groupe $groupeparam"; |
3232 |
+ } |
3233 |
+ } |
3234 |
+ $eval = $groupeparam; |
3235 |
+ } |
3236 |
+ } |
3237 |
+ close(LISTGRP); |
3238 |
+ |
3239 |
+ $self->success('CREATE_USER_SUCCESS'); |
3240 |
+ |
3241 |
+} |
3242 |
+ |
3243 |
+# delete_user permet de supprimer un utilisateur de la base de données Zarafa |
3244 |
+############################################################################# |
3245 |
+# delete_user is use to delete an user from the Zarafa database |
3246 |
+ |
3247 |
+sub delete_user { |
3248 |
+ |
3249 |
+ my ($self) = @_; |
3250 |
+ my $cgi = $self->{cgi}; |
3251 |
+ |
3252 |
+ my $user = $cgi->param('actUsr'); |
3253 |
+ if ($user =~ /^([-\@\w.]+)$/) { |
3254 |
+ $user = $1; # $data now untainted |
3255 |
+ } |
3256 |
+ else { |
3257 |
+ die "Bad data in '$user'"; |
3258 |
+ } |
3259 |
+ |
3260 |
+ system("zarafa-admin -d $user > /dev/null") == 0 |
3261 |
+ or die "Impossible de supprimer cet utilisateur."; |
3262 |
+ |
3263 |
+ # Suppression dans la BD Accounts du serveur SME |
3264 |
+ system("/sbin/e-smith/db accounts delprop \"$user\" zarafa enabled"); |
3265 |
+ system("/etc/e-smith/events/actions/qmail-update-user"); |
3266 |
+ |
3267 |
+ $self->success('DELETE_USER_SUCCESS'); |
3268 |
+ |
3269 |
+} |
3270 |
+ |
3271 |
+# modify_user_groups affiche une liste de tout les groupes et indique si l'utilisateur dont il est question appartient au groupe ou non |
3272 |
+####################################################################################################################################### |
3273 |
+# modify_user_groups display a list of all groups and show if the user belongs to groups or not |
3274 |
+ |
3275 |
+sub display_user_groups { |
3276 |
+ |
3277 |
+ my ($self) = @_; |
3278 |
+ my $cgi = $self->{cgi}; |
3279 |
+ |
3280 |
+if ($multicompany_enabled =~ m/false/){ |
3281 |
+ # Récupération du nom d'utilisateur |
3282 |
+ # Recover username |
3283 |
+ my $user = $cgi->param('actUsr'); |
3284 |
+ if ($user =~ /^([-\@\w.]+)$/) { |
3285 |
+ $user = $1; # $data now untainted |
3286 |
+ } |
3287 |
+ else { |
3288 |
+ die "Bad data in '$user'"; |
3289 |
+ } |
3290 |
+ |
3291 |
+ my $fm = shift; |
3292 |
+ my $groups; |
3293 |
+ my $eval = ""; |
3294 |
+ my $checkedYes = ""; |
3295 |
+ my $display_group = $self->localise('GROUP_TEXT_DISPLAY'); |
3296 |
+ |
3297 |
+ my $out = "<tr>\n <td class=\"sme-noborders-label\">" |
3298 |
+ . "$display_group" |
3299 |
+ . "</td>\n <td>\n" |
3300 |
+ . " <table border='0' cellspacing='0' cellpadding='0'>\n"; |
3301 |
+ |
3302 |
+ # Parcours de la liste des groupes |
3303 |
+ # Browse groups' list |
3304 |
+ open(LIRE, "zarafa-admin -L | awk 'NR > 3' |"); |
3305 |
+ while(<LIRE>){ |
3306 |
+ $groups = $_; |
3307 |
+ $groups =~ s/^\t//g; |
3308 |
+ $groups =~ s/ /_/g; |
3309 |
+ chomp $groups; |
3310 |
+ if($groups){ |
3311 |
+ # Si groupe existe ... |
3312 |
+ # If group exist ... |
3313 |
+ if ($groups =~ /^([-\@\w.]+)$/) { |
3314 |
+ $groups = $1; # $data now untainted |
3315 |
+ } |
3316 |
+ else { |
3317 |
+ $groups = $1; |
3318 |
+ } |
3319 |
+ $groups =~ s/_/ /g; |
3320 |
+ # On ne soccupe pas du groupe 'Everyone' |
3321 |
+ # The 'Everyone' group doesn't be display |
3322 |
+ unless($groups eq 'Everyone'){ |
3323 |
+ # Si l'utilisateur est dans le groupe alors le bouton sera 'checked' |
3324 |
+ # If the user is in the group, the button will be 'checked' |
3325 |
+ open(GRP, "zarafa-admin --details \"$groups\" --type group |"); |
3326 |
+ while(<GRP>){ |
3327 |
+ if(m/$user\t{1}/){ |
3328 |
+ $checkedYes = "checked"; |
3329 |
+ } |
3330 |
+ } |
3331 |
+ close(GRP); |
3332 |
+ unless($eval =~ m/$groups/){ |
3333 |
+ my $yes = $self->localise('CHECKED_YES'); |
3334 |
+ my $no = $self->localise('CHECKED_NO'); |
3335 |
+ # Affichage si le bouton 'oui' est 'checked' |
3336 |
+ # Display if the 'yes' button is 'checked' |
3337 |
+ if($checkedYes eq "checked") { |
3338 |
+ $out .="<tr>\n <td>$groups : </td>\n" |
3339 |
+ ."<td>$yes</td><td><input type=\"radio\" name=\"$groups\" checked=\"checked\"" |
3340 |
+ ." value=\"Yes\"></td>" |
3341 |
+ ."<td>$no</td><td><input type=\"radio\" name=\"$groups\"" |
3342 |
+ ." value=\"No\"></td>\n" |
3343 |
+ ."</tr>\n"; |
3344 |
+ } |
3345 |
+ # Affichage si le bouton 'non' est 'checked' |
3346 |
+ # Display if the 'no' button is 'checked' |
3347 |
+ else { |
3348 |
+ $out .="<tr>\n <td>$groups : </td>\n" |
3349 |
+ ."<td>$yes</td><td><input type=\"radio\" name=\"$groups\"" |
3350 |
+ ." value=\"Yes\"></td>" |
3351 |
+ ."<td>$no</td><td><input type=\"radio\" name=\"$groups\" checked=\"checked\"" |
3352 |
+ ." value=\"No\"></td>\n" |
3353 |
+ ."</tr>\n"; |
3354 |
+ } |
3355 |
+ $checkedYes = ""; |
3356 |
+ } |
3357 |
+ $eval = $groups; |
3358 |
+ } |
3359 |
+ } |
3360 |
+ } |
3361 |
+ |
3362 |
+ $out .= " </table>\n </td>\n </tr>\n"; |
3363 |
+ close(LIRE); |
3364 |
+ return $out; |
3365 |
+ } |
3366 |
+ |
3367 |
+elsif ($multicompany_enabled =~ m/true/){ |
3368 |
+ |
3369 |
+ # Récupération du nom d'utilisateur |
3370 |
+ # Recover username |
3371 |
+ my $user = $cgi->param('actUsr'); |
3372 |
+ if ($user =~ /^([-\@\w.]+)$/) { |
3373 |
+ $user = $1; # $data now untainted |
3374 |
+ } |
3375 |
+ else { |
3376 |
+ die "Bad data in '$user'"; |
3377 |
+ } |
3378 |
+ |
3379 |
+ my $fm = shift; |
3380 |
+ my $groups; |
3381 |
+ my $eval = ""; |
3382 |
+ my $checkedYes = ""; |
3383 |
+ my $display_group = $self->localise('GROUP_TEXT_DISPLAY'); |
3384 |
+ |
3385 |
+ my $out = "<tr>\n <td class=\"sme-noborders-label\">" |
3386 |
+ . "$display_group" |
3387 |
+ . "</td>\n <td>\n" |
3388 |
+ . " <table border='0' cellspacing='0' cellpadding='0'>\n"; |
3389 |
+ |
3390 |
+ # Parcours de la liste des groupes |
3391 |
+ # Browse groups' list |
3392 |
+ open(LIRE, "zarafa-admin -L |"); |
3393 |
+ while(<LIRE>){ |
3394 |
+ $groups = $_; |
3395 |
+ $groups =~ s/^\t//g; |
3396 |
+ $groups =~ s/ /_/g; |
3397 |
+ chomp $groups; |
3398 |
+ if($groups){ |
3399 |
+ # Si groupe existe ... |
3400 |
+ # If group exist ... |
3401 |
+ if ($groups =~ /^([-\@\w.]+)$/) { |
3402 |
+ $groups = $1; # $data now untainted |
3403 |
+ } |
3404 |
+ else { |
3405 |
+ $groups = $1; |
3406 |
+ } |
3407 |
+ $groups =~ s/_/ /g; |
3408 |
+ # On ne soccupe pas du groupe 'Everyone' |
3409 |
+ # The 'Everyone' group doesn't be display |
3410 |
+ unless($groups =~ m/Everyone/ or $groups =~ m/Group list for/ or $groups =~ m/------/ or !$groups or $groups =~ m/groupname/){ |
3411 |
+ # Si l'utilisateur est dans le groupe alors le bouton sera 'checked' |
3412 |
+ # If the user is in the group, the button will be 'checked' |
3413 |
+ open(GRP, "zarafa-admin --details \"$groups\" --type group |"); |
3414 |
+ while(<GRP>){ |
3415 |
+ if(m/$user/){ |
3416 |
+ $checkedYes = "checked"; |
3417 |
+ } |
3418 |
+ } |
3419 |
+ close(GRP); |
3420 |
+ unless($eval =~ m/$groups/){ |
3421 |
+ my $yes = $self->localise('CHECKED_YES'); |
3422 |
+ my $no = $self->localise('CHECKED_NO'); |
3423 |
+ # Affichage si le bouton 'oui' est 'checked' |
3424 |
+ # Display if the 'yes' button is 'checked' |
3425 |
+ if($checkedYes eq "checked") { |
3426 |
+ $out .="<tr>\n <td>$groups : </td>\n" |
3427 |
+ ."<td>$yes</td><td><input type=\"radio\" name=\"$groups\" checked=\"checked\"" |
3428 |
+ ." value=\"Yes\"></td>" |
3429 |
+ ."<td>$no</td><td><input type=\"radio\" name=\"$groups\"" |
3430 |
+ ." value=\"No\"></td>\n" |
3431 |
+ ."</tr>\n"; |
3432 |
+ } |
3433 |
+ # Affichage si le bouton 'non' est 'checked' |
3434 |
+ # Display if the 'no' button is 'checked' |
3435 |
+ else { |
3436 |
+ $out .="<tr>\n <td>$groups : </td>\n" |
3437 |
+ ."<td>$yes</td><td><input type=\"radio\" name=\"$groups\"" |
3438 |
+ ." value=\"Yes\"></td>" |
3439 |
+ ."<td>$no</td><td><input type=\"radio\" name=\"$groups\" checked=\"checked\"" |
3440 |
+ ." value=\"No\"></td>\n" |
3441 |
+ ."</tr>\n"; |
3442 |
+ } |
3443 |
+ $checkedYes = ""; |
3444 |
+ } |
3445 |
+ $eval = $groups; |
3446 |
+ } |
3447 |
+ } |
3448 |
+ } |
3449 |
+ |
3450 |
+ $out .= " </table>\n </td>\n </tr>\n"; |
3451 |
+ close(LIRE); |
3452 |
+ return $out; |
3453 |
+ } |
3454 |
+ |
3455 |
+} |
3456 |
+ |
3457 |
+# Create_group permet la création de groupe d'utilisateur en récupérant un nom saisi par l'utilisateur |
3458 |
+###################################################################################################### |
3459 |
+# Create_group allow to create an user's group with a name recover from the user |
3460 |
+ |
3461 |
+sub Create_group { |
3462 |
+ |
3463 |
+ my ($self) = @_; |
3464 |
+ my $cgi = $self->{cgi}; |
3465 |
+ |
3466 |
+ # Récuperation du nom de groupe |
3467 |
+ # Recover the groupname |
3468 |
+ my $group = $self->{cgi}->param('Groupname'); |
3469 |
+ $group =~ s/ /_/g; |
3470 |
+ if ($group =~ /^([-\@\w.]+)$/) { |
3471 |
+ $group = $1; # $data now untainted |
3472 |
+ } |
3473 |
+ else { |
3474 |
+ die "Bad data in '$group'"; |
3475 |
+ } |
3476 |
+ $group =~ s/_/ /g; |
3477 |
+ |
3478 |
+ |
3479 |
+ # Création du groupe |
3480 |
+ # Group creation |
3481 |
+ system("zarafa-admin -g \"$group\" > /dev/null") == 0 |
3482 |
+ or die "Impossible de créer le groupe"; |
3483 |
+ |
3484 |
+ $self->success('CREATE_GROUP_SUCCESS'); |
3485 |
+ |
3486 |
+} |
3487 |
+ |
3488 |
+# show_group affiche une liste de tout les groupe dans un tableau avec un lien pour les modifier et un autre pour les supprimer |
3489 |
+############################################################################################################################### |
3490 |
+# show_group display a list of all groups into an array with two links in order to modify an delete them |
3491 |
+ |
3492 |
+sub show_group { |
3493 |
+ |
3494 |
+ my $self = shift; |
3495 |
+ my $q = $self->{cgi}; |
3496 |
+ |
3497 |
+ |
3498 |
+ if ($multicompany_enabled =~ m/false/){ |
3499 |
+ |
3500 |
+ my $nbrligne = `zarafa-admin -L | wc -l`; |
3501 |
+ my $scriptname = basename($0); |
3502 |
+ my $ligne = 4; |
3503 |
+ |
3504 |
+ # Localisation |
3505 |
+ # Localization |
3506 |
+ my $groupname = $self->localise('GROUP_NAME_ARRAY'); |
3507 |
+ my $suppr = $self->localise('DELETE'); |
3508 |
+ |
3509 |
+ # Affichage de l'en-tête du tableau |
3510 |
+ # Display the header |
3511 |
+ print " <tr>\n <td colspan=\"2\">\n "; |
3512 |
+ print $q->start_table ({-CLASS => "sme-border"}),"\n "; |
3513 |
+ print $q->Tr( |
3514 |
+ esmith::cgi::genSmallCell($q, $groupname,"header"), |
3515 |
+ esmith::cgi::genSmallCell($q, $suppr,"header")); |
3516 |
+ |
3517 |
+ # Parcours de la liste des groupes avec affichage dans le tableau de chacun, création et affichage des liens correspondant |
3518 |
+ # Browse the group's list and display them into the array, create and diplay the links |
3519 |
+ my @grouptab; |
3520 |
+ my $nbr = 0; |
3521 |
+ while ($ligne < $nbrligne) { |
3522 |
+ $grouptab[$nbr] = `zarafa-admin -L | awk 'NR == $ligne'`; |
3523 |
+ $nbr ++; |
3524 |
+ $ligne ++; |
3525 |
+ } |
3526 |
+ |
3527 |
+ my @out = sort @grouptab; |
3528 |
+ foreach my $group (@out){ |
3529 |
+ unless($group =~ m/^\tEveryone/){ |
3530 |
+ my $delete = "<a href=\"$scriptname?page=0&wherenext=DeleteGroup&actGrp=$group\">$suppr</a>"; |
3531 |
+ my $modify = "<a href=\"$scriptname?page=0&wherenext=DisplayGroupDetails&actGrp=$group\">$group</a>"; |
3532 |
+ print $q->Tr( |
3533 |
+ esmith::cgi::genSmallCell($q,$modify ,"normal")," ", |
3534 |
+ esmith::cgi::genSmallCell($q,$delete,"normal")); |
3535 |
+ } |
3536 |
+ } |
3537 |
+ |
3538 |
+ print qq(</table></td></tr>\n); |
3539 |
+ |
3540 |
+ my $add_group = $self->localise('ADD_GROUP'); |
3541 |
+ my $add_group_bubble = $self->localise('ADD_GROUP_BUBBLE'); |
3542 |
+ |
3543 |
+ my $out ="<p><a class=\"button-like\" |
3544 |
+ href=\"zarafaUI?page=0&wherenext=DisplayCreateGroup\" title=\"$add_group_bubble\">$add_group</a></p>"; |
3545 |
+ |
3546 |
+ |
3547 |
+ return $out; |
3548 |
+ } |
3549 |
+ |
3550 |
+ else { |
3551 |
+ return 0; |
3552 |
+ } |
3553 |
+} |
3554 |
+ |
3555 |
+# delete_group permet de supprimer un groupe passé en paramétre |
3556 |
+############################################################### |
3557 |
+# delete_group is use to delete the group passed in parameter |
3558 |
+ |
3559 |
+sub delete_group { |
3560 |
+ |
3561 |
+ my ($self) = @_; |
3562 |
+ my $cgi = $self->{cgi}; |
3563 |
+ |
3564 |
+ # Récupération du nom du groupe |
3565 |
+ # Recover the groupname |
3566 |
+ my $group = $cgi->param('actGrp'); |
3567 |
+ $group =~ s/ /_/g; |
3568 |
+ if ($group =~ /^([-\@\w.]+)$/) { |
3569 |
+ $group = $1; # $data now untainted |
3570 |
+ } |
3571 |
+ else { |
3572 |
+ die "Bad data in '$group'"; |
3573 |
+ } |
3574 |
+ $group =~ s/_/ /g; |
3575 |
+ |
3576 |
+ # Suppression du groupe |
3577 |
+ # Deleting group |
3578 |
+ system("zarafa-admin -G \"$group\" > /dev/null") == 0 |
3579 |
+ or die "Impossible de supprimer ce groupe."; |
3580 |
+ |
3581 |
+ $self->success('DELETE_GROUP_SUCCESS'); |
3582 |
+ |
3583 |
+} |
3584 |
+ |
3585 |
+# Cette fonction affiche un bouton contenant le texte 'Delete' |
3586 |
+############################################################# |
3587 |
+# Thus function dispay a button with 'Delete' text inside |
3588 |
+ |
3589 |
+sub display_delete_group_button { |
3590 |
+ |
3591 |
+ my ($self) = @_; |
3592 |
+ my $cgi = $self->{cgi}; |
3593 |
+ |
3594 |
+ my $group = $cgi->param('actGrp'); |
3595 |
+ $group =~ s/ /_/g; |
3596 |
+ if ($group =~ /^([-\@\w.]+)$/) { |
3597 |
+ $group = $1; # $data now untainted |
3598 |
+ } |
3599 |
+ else { |
3600 |
+ die "Bad data in '$group'"; |
3601 |
+ } |
3602 |
+ $group =~ s/_/ /g; |
3603 |
+ $self->print_button("DELETE"); |
3604 |
+ |
3605 |
+} |
3606 |
+ |
3607 |
+# display_user_in_group affiche la liste de tout les utilisateurs et indique ceux qui appartiennent au groupe passé en paramétre |
3608 |
+################################################################################################################################ |
3609 |
+# display_user_in_group display a list of all users and show those are in the group passed in parameter, or not |
3610 |
+ |
3611 |
+sub display_user_in_group { |
3612 |
+ |
3613 |
+ my $self = shift; |
3614 |
+ my $cgi = $self->{cgi}; |
3615 |
+ |
3616 |
+ # Récupération du nom du groupe |
3617 |
+ # Recovery of the groupename |
3618 |
+ my $group = $cgi->param('actGrp'); |
3619 |
+ $group =~ s/ /_/g; |
3620 |
+ if ($group =~ /^([-\@\w.]+)$/) { |
3621 |
+ $group = $1; # $data now untainted |
3622 |
+ } |
3623 |
+ else { |
3624 |
+ die "Bad data in '$group'"; |
3625 |
+ } |
3626 |
+ $group =~ s/_/ /g; |
3627 |
+ |
3628 |
+ my $grouptext = $self->localise('MODIFY_GROUP_TEXT'); |
3629 |
+ print "$grouptext $group"; |
3630 |
+ my ($user, $fullname); |
3631 |
+ my $out = "<tr>\n <td class=\"sme-noborders-label\">" |
3632 |
+ . "$group" |
3633 |
+ . "</td>\n <td>\n" |
3634 |
+ . " <table border='0' cellspacing='0' cellpadding='0'>\n"; |
3635 |
+ |
3636 |
+ $group = "\"".$group."\""; |
3637 |
+ # Parcours de la liste des utilisateurs |
3638 |
+ # Browse the user list |
3639 |
+ open(USER, "zarafa-admin -l | awk 'NR > 4' |"); |
3640 |
+ while(<USER>){ |
3641 |
+ my $ligne = $_; |
3642 |
+ chomp $ligne; |
3643 |
+ my $checked = ""; |
3644 |
+ $user = $ligne; |
3645 |
+ $fullname = $ligne; |
3646 |
+ $fullname =~ s/^.*\t{2}//g; |
3647 |
+ $user =~ s/\t{2}.*$//g; |
3648 |
+ $user =~ s/^\t{1}//g; |
3649 |
+ if($fullname){ |
3650 |
+ # Si l'utilisateur est dans le groupe alors il est 'checked' |
3651 |
+ # If the user is in the group, he is 'checked' |
3652 |
+ open(INGRP, "zarafa-admin --details $group --type group |"); |
3653 |
+ while(<INGRP>){ |
3654 |
+ if(m/$user\t{1}/){ |
3655 |
+ $checked = "checked"; |
3656 |
+ } |
3657 |
+ } |
3658 |
+ close(INGRP); |
3659 |
+ |
3660 |
+ # Affichage si l'utilisateur est 'checked' |
3661 |
+ # Display if the user is 'checked' |
3662 |
+ my $yes = $self->localise('CHECKED_YES'); |
3663 |
+ my $no = $self->localise('CHECKED_NO'); |
3664 |
+ if($checked eq 'checked'){ |
3665 |
+ $out .="<tr>\n <td>$fullname : </td>\n" |
3666 |
+ ."<td>$yes</td><td><input type=\"radio\" name=\"$user\" checked=\"checked\"" |
3667 |
+ ." value=\"yes\"></td>" |
3668 |
+ ."<td>$no</td><td><input type=\"radio\" name=\"$user\"" |
3669 |
+ ." value=\"no\"></td>\n" |
3670 |
+ ."</tr>\n"; |
3671 |
+ } |
3672 |
+ # Affichage si l'utilisateur n'est pas 'checked' |
3673 |
+ # Display if the user is not 'checked' |
3674 |
+ else { |
3675 |
+ $out .="<tr>\n <td>$fullname : </td>\n" |
3676 |
+ ."<td>$yes</td><td><input type=\"radio\" name=\"$user\"" |
3677 |
+ ." value=\"yes\"></td>" |
3678 |
+ ."<td>$no</td><td><input type=\"radio\" name=\"$user\" checked=\"checked\"" |
3679 |
+ ." value=\"no\"></td>\n" |
3680 |
+ ."</tr>\n"; |
3681 |
+ } |
3682 |
+ } |
3683 |
+ } |
3684 |
+ close(USER); |
3685 |
+ $out .= " </table>\n </td>\n </tr>\n"; |
3686 |
+ |
3687 |
+ return $out; |
3688 |
+ |
3689 |
+} |
3690 |
+ |
3691 |
+# display_modify_group_button affiche un bouton contenant 'Modify' pour la gestion des groupes |
3692 |
+################################################################################################## |
3693 |
+# display_modify_group_button display a button with 'Modify' text specially for group's management |
3694 |
+ |
3695 |
+sub display_modify_group_button { |
3696 |
+ |
3697 |
+ my ($self) = @_; |
3698 |
+ |
3699 |
+ my $cgi = $self->{cgi}; |
3700 |
+ |
3701 |
+ $self->print_button("MODIFY_BUTTON"); |
3702 |
+ |
3703 |
+} |
3704 |
+ |
3705 |
+# Cette fonction permet de modifier les utilisateurs appartenant a un groupe passé en paramétre |
3706 |
+############################################################################################### |
3707 |
+# This function is use to modify the users belong to a group passed in parameter |
3708 |
+ |
3709 |
+sub modify_user_group { |
3710 |
+ |
3711 |
+ my ($self) = @_; |
3712 |
+ my $cgi = $self->{cgi}; |
3713 |
+ my $group = $cgi->param('actGrp'); |
3714 |
+ |
3715 |
+ my $fm = shift; |
3716 |
+ my $q = $fm->{'cgi'}; |
3717 |
+ |
3718 |
+ # Parcours de la liste des utilisateurs |
3719 |
+ # Browse the user list |
3720 |
+ open(LISTUSR, "zarafa-admin -l | awk 'NR > 4' |"); |
3721 |
+ while(<LISTUSR>){ |
3722 |
+ my $user = $_; |
3723 |
+ $user =~ s/\t{2}.*$//g; |
3724 |
+ $user =~ s/^\t//g; |
3725 |
+ chomp $user; |
3726 |
+ chomp $group; |
3727 |
+ |
3728 |
+ if($user){ |
3729 |
+ if ($user =~ /^([-\@\w.]+)$/) { |
3730 |
+ $user = $1; |
3731 |
+ } |
3732 |
+ else { |
3733 |
+ die "bad data in $user"; |
3734 |
+ } |
3735 |
+ |
3736 |
+ my $present = 0; |
3737 |
+ my $yesNo = $q->param("$user"); |
3738 |
+ # Si le bouton radio est sur 'oui' ... |
3739 |
+ # If the radio button is 'on' ... |
3740 |
+ if($yesNo eq 'yes'){ |
3741 |
+ open(ADDUSR, "zarafa-admin -l --details \"$group\" --type group |"); |
3742 |
+ while(<ADDUSR>){ |
3743 |
+ if(m/^\t$user/){ |
3744 |
+ $present = 1; |
3745 |
+ } |
3746 |
+ } |
3747 |
+ # Et si l'utilisateur n'est pas dans le groupe, alors on le rajoute |
3748 |
+ # And if the user is not in the group, then add him into the group |
3749 |
+ unless($present == 1){ |
3750 |
+ system("zarafa-admin -b $user -i \"$group\" > /dev/null") == 0 |
3751 |
+ or die "Impossible de rajouter l'utilisateur $user dans le groupe $group"; |
3752 |
+ } |
3753 |
+ close(ADDUSR); |
3754 |
+ } |
3755 |
+ # Si le bouton radio est sur 'non' ... |
3756 |
+ # If the radio button is 'off' ... |
3757 |
+ if($yesNo eq 'no'){ |
3758 |
+ open(DELUSR, "zarafa-admin -l --details $user |"); |
3759 |
+ while(<DELUSR>){ |
3760 |
+ # Et si l'utilisateur appartient au groupe, alors on le supprime du groupe |
3761 |
+ # And if the user is in the group, then delete him from the group |
3762 |
+ if(m/^\t$group$/){ |
3763 |
+ system("zarafa-admin -B $user -i \"$group\" > /dev/null") == 0 |
3764 |
+ or die "Impossible de supprimer l'utilisateur $user du groupe $group"; |
3765 |
+ } |
3766 |
+ } |
3767 |
+ close(DELUSR); |
3768 |
+ } |
3769 |
+ } |
3770 |
+ } |
3771 |
+ close(LISTUSR); |
3772 |
+ |
3773 |
+ $self->success('MODIFY_GROUP_SUCCESS'); |
3774 |
+} |
3775 |
+ |
3776 |
+# display_create_user_group permet d'afficher la liste de tout les groupes en précochant l'apartenance de l'utilisateur à tout les groupes. |
3777 |
+# Utilisé pour l'affichage de la création d'un utilisateur. |
3778 |
+##################################################################################################################################################### |
3779 |
+# display_create_user_group is use to display a list of all group set to 'no' by default for the user. It will be use into the display of create user. |
3780 |
+ |
3781 |
+sub display_create_user_group { |
3782 |
+ |
3783 |
+ my ($self) = @_; |
3784 |
+ my $cgi = $self->{cgi}; |
3785 |
+ |
3786 |
+ my $fm = shift; |
3787 |
+ my $groups; |
3788 |
+ my $eval = ""; |
3789 |
+ |
3790 |
+ my $exist_group = $self->localise('EXIST_GROUP'); |
3791 |
+ my $out = "<tr>\n <td class=\"sme-noborders-label\">" |
3792 |
+ . $exist_group |
3793 |
+ . "</td>\n <td>\n" |
3794 |
+ . " <table border='0' cellspacing='0' cellpadding='0'>\n"; |
3795 |
+ |
3796 |
+ # Parcours de la liste des groupes |
3797 |
+ # Browse group's list |
3798 |
+ open(LIRE, "zarafa-admin -L | awk 'NR > 3' |"); |
3799 |
+ while(<LIRE>){ |
3800 |
+ $groups = $_; |
3801 |
+ $groups =~ s/^\t//g; |
3802 |
+ chomp $groups; |
3803 |
+ $groups =~ s/ /_/g; |
3804 |
+ if ($groups =~ /^([-\@\w.]+)$/) { |
3805 |
+ $groups = $1; # $data now untainted |
3806 |
+ } |
3807 |
+ else { |
3808 |
+ $groups = $1; |
3809 |
+ } |
3810 |
+ $groups =~ s/_/ /g; |
3811 |
+ if($groups){ |
3812 |
+ # Tant que le groupe n'est pas 'Everyone' ... |
3813 |
+ # Unless the group is 'Everyone' ... |
3814 |
+ my $yes = $self->localise('CHECKED_YES'); |
3815 |
+ my $no = $self->localise('CHECKED_NO'); |
3816 |
+ unless($groups eq 'Everyone'){ |
3817 |
+ # Affichage des boutons radio du groupe |
3818 |
+ # Display the radio button's group |
3819 |
+ unless($eval eq $groups){ |
3820 |
+ $out .="<tr>\n <td>$groups : </td>\n" |
3821 |
+ ."<td>$yes</td><td><input type=\"radio\" name=\"$groups\"" |
3822 |
+ ." value=\"Yes\"></td>" |
3823 |
+ ."<td>$no</td><td><input type=\"radio\" name=\"$groups\"" |
3824 |
+ ." value=\"No\" checked =\"checked\"></td>\n" |
3825 |
+ ."</tr>\n"; |
3826 |
+ } |
3827 |
+ $eval = $groups; |
3828 |
+ } |
3829 |
+ } |
3830 |
+ } |
3831 |
+ |
3832 |
+ $out .= " </table>\n </td>\n </tr>\n"; |
3833 |
+ close(LIRE); |
3834 |
+ return $out; |
3835 |
+} |
3836 |
+ |
3837 |
+# Les fonctions suivantes servent à vérifié se que l'utilisateur saisi dans divers champs, afin d'éviter toute erreur de sa part ou tentative de sabotage de la part de personne malveillante. |
3838 |
+############################################################################################################################################################################################## |
3839 |
+# The functions below is use to analyse and find error in the fields the user have fill in order to securise the software. |
3840 |
+ |
3841 |
+# Cette fonction est principalement utilisé pour vérifié la composition d'un Nom complet rentré par l'utilisateur, ou bien pour le nom des groupes. |
3842 |
+################################################################################################################################################### |
3843 |
+# This function is mainly use to verify the composition of a Fullname enter by an user or a group name. |
3844 |
+ |
3845 |
+sub fullname { |
3846 |
+ |
3847 |
+ my ($fm, $fullname) = @_; |
3848 |
+ my $self = shift; |
3849 |
+ |
3850 |
+ my $return_error = $self->localise('FULLNAME_VERIF_ERROR'); |
3851 |
+ if ($fullname =~ m/^\w+((\.|\-|\s+)?\w+)*$/){ |
3852 |
+ return "OK"; |
3853 |
+ } |
3854 |
+ else { |
3855 |
+ return $return_error; |
3856 |
+ } |
3857 |
+} |
3858 |
+ |
3859 |
+# Cette fonction est principalement utilisé pour vérifié la composition d'un mot de passe saisi par l'utilisateur |
3860 |
+################################################################################################################# |
3861 |
+# This function is mainly use to verify the composition of a password enter by an user. |
3862 |
+ |
3863 |
+sub my_password { |
3864 |
+ |
3865 |
+ my ($fm, $password, $minlength) = @_; |
3866 |
+ my $self = shift; |
3867 |
+ my $return_error = $self->localise('MY_PASSWORD_VERIF_ERROR'); |
3868 |
+ if ($password =~ /^\w+$/i and length($password) >= $minlength){ |
3869 |
+ return "OK"; |
3870 |
+ } |
3871 |
+ elsif($password eq ''){ |
3872 |
+ return "OK"; |
3873 |
+ } |
3874 |
+ else { |
3875 |
+ return $return_error; |
3876 |
+ } |
3877 |
+} |
3878 |
+ |
3879 |
+# quota_test est utilisé pour testé si la valeur des quota saisi par l'utilisateur sont des valeurs correcte. |
3880 |
+############################################################################################################# |
3881 |
+# quota_test is use in order to test if the user has enter a correct value into quota fields |
3882 |
+ |
3883 |
+sub quota_test { |
3884 |
+ |
3885 |
+ my ($fm, $quotalvl) = @_; |
3886 |
+ my $self = shift; |
3887 |
+ my $return_error = $self->localise('QUOTA_TEST_VERIF_ERROR'); |
3888 |
+ if ($quotalvl =~ /^\d*$/ or $quotalvl =~ m/unlimited/i){ |
3889 |
+ return "OK"; |
3890 |
+ } |
3891 |
+ else { |
3892 |
+ return $return_error; |
3893 |
+ } |
3894 |
+} |
3895 |
+ |
3896 |
+# sup_quota_inter test si la valeur saisi dans le soft level est bien supérieur à celle du warning level ou équivalente |
3897 |
+# dans le cas d'une valeur à zéro ou bien d'un unlimited |
3898 |
+######################################################################################################################### |
3899 |
+# sup_quota_inter is use to test if the value of the soft level is superior to the value of the warning level or the same |
3900 |
+# in case of an 'unlimited' or a value at 0. |
3901 |
+ |
3902 |
+sub sup_quota_inter { |
3903 |
+ |
3904 |
+ my ($fm, $softlvl) = @_; |
3905 |
+ my $self = shift; |
3906 |
+ my $return_error = $self->localise('SOFT_INF_WARN'); |
3907 |
+ my $cgi = $self->{cgi}; |
3908 |
+ my $warnlvl = $cgi->param('Warnlvl'); |
3909 |
+ |
3910 |
+ if (!$softlvl && !$warnlvl){ |
3911 |
+ return "OK"; |
3912 |
+ } |
3913 |
+ elsif ($softlvl eq 'unlimited' && $warnlvl eq 'unlimited'){ |
3914 |
+ return "OK"; |
3915 |
+ } |
3916 |
+ elsif ($softlvl == '0' && $warnlvl == '0'){ |
3917 |
+ return "OK"; |
3918 |
+ } |
3919 |
+ elsif ($softlvl > $warnlvl){ |
3920 |
+ return "OK"; |
3921 |
+ } |
3922 |
+ else { |
3923 |
+ return $return_error; |
3924 |
+ } |
3925 |
+} |
3926 |
+ |
3927 |
+# sup_quota_inter test si la valeur saisi dans le hard level est bien supérieur à celle du soft level ou équivalente |
3928 |
+# dans le cas d'une valeur à zéro ou bien d'un unlimited |
3929 |
+####################################################################################################################### |
3930 |
+# sup_quota_inter is used to test if the value of the hard level is superior to the value of the soft level or the same |
3931 |
+# in case of an 'unlimited' or a value at 0. |
3932 |
+ |
3933 |
+sub sup_quota_hard { |
3934 |
+ |
3935 |
+ my ($fm, $hardlvl) = @_; |
3936 |
+ my $self = shift; |
3937 |
+ my $return_error = $self->localise('HARD_INF_OTHER'); |
3938 |
+ my $cgi = $self->{cgi}; |
3939 |
+ my $warnlvl = $cgi->param('Warnlvl'); |
3940 |
+ my $softlvl = $cgi->param('Softlvl'); |
3941 |
+ |
3942 |
+ if (!$softlvl && !$hardlvl){ |
3943 |
+ return "OK"; |
3944 |
+ } |
3945 |
+ elsif ($softlvl eq 'unlimited' && $warnlvl eq 'unlimited') { |
3946 |
+ return "OK"; |
3947 |
+ } |
3948 |
+ elsif ($softlvl == '0' && $hardlvl == '0'){ |
3949 |
+ return "OK"; |
3950 |
+ } |
3951 |
+ elsif ($hardlvl > $softlvl){ |
3952 |
+ return "OK"; |
3953 |
+ } |
3954 |
+ else { |
3955 |
+ return $return_error; |
3956 |
+ } |
3957 |
+} |
3958 |
+ |
3959 |
+# unique_username est utilisé pour vérifié si le nom d'utilisateur est bien unique dans le cas d'une création d'utilisateur |
3960 |
+################################################################################################################################ |
3961 |
+# unique_username is used to verify if the username in the username's field is already taken or notin case of an user's creation |
3962 |
+ |
3963 |
+sub unique_username { |
3964 |
+ |
3965 |
+ my ($fm, $user_get) = @_; |
3966 |
+ my $self = shift; |
3967 |
+ my $return_error = $self->localise('MULTIPLE_USERNAME'); |
3968 |
+ my $present = 0; |
3969 |
+ open(USER, "zarafa-admin -l | awk 'NR > 4' |"); |
3970 |
+ while(<USER>){ |
3971 |
+ my $user = $_; |
3972 |
+ if ($user =~ m/$user_get\t/){ |
3973 |
+ $present = 1; |
3974 |
+ } |
3975 |
+ } |
3976 |
+ close(USER); |
3977 |
+ if($present == 1){ |
3978 |
+ return $return_error; |
3979 |
+ } |
3980 |
+ else { |
3981 |
+ return "OK"; |
3982 |
+ } |
3983 |
+} |
3984 |
+ |
3985 |
+# unique_email est utilisé pour vérifié si l'email de l'utilisateur est bien unique dans le cas d'une création d'utilisateur |
3986 |
+############################################################################################################################ |
3987 |
+# unique_email is used to verify if the email in the email's field is already taken or not in case of an user's creation |
3988 |
+ |
3989 |
+sub unique_email { |
3990 |
+ |
3991 |
+ my ($fm, $email_get) = @_; |
3992 |
+ my $self = shift; |
3993 |
+ my $return_error = $self->localise('MULTIPLE_EMAIL'); |
3994 |
+ my $cgi = $self->{cgi}; |
3995 |
+ my $present = 0; |
3996 |
+ open(USER, "zarafa-admin -l | awk 'NR > 3' |"); |
3997 |
+ while(<USER>){ |
3998 |
+ my $user = $_; |
3999 |
+ $user =~ s/\t{2}.*$//g; |
4000 |
+ $user =~ s/^\t{1}//g; |
4001 |
+ chomp $user; |
4002 |
+ if($user) { |
4003 |
+ if ($user =~ /^([-\@\w.]+)$/) { |
4004 |
+ $user = $1; # $data now untainted |
4005 |
+ } |
4006 |
+ else { |
4007 |
+ die "Bad data in '$user'"; |
4008 |
+ } |
4009 |
+ open(EMAIL, "zarafa-admin --details \"$user\" |"); |
4010 |
+ while(<EMAIL>){ |
4011 |
+ my $ligne = $_; |
4012 |
+ if ($ligne =~ m/$email_get/){ |
4013 |
+ $present = 1; |
4014 |
+ } |
4015 |
+ } |
4016 |
+ } |
4017 |
+ close(EMAIL); |
4018 |
+ } |
4019 |
+ close(USER); |
4020 |
+ if($present == 1){ |
4021 |
+ return $return_error; |
4022 |
+ } |
4023 |
+ else { |
4024 |
+ return "OK"; |
4025 |
+ } |
4026 |
+} |
4027 |
+ |
4028 |
+# unique_username_modify est utilisé pour vérifié si le nom d'utilisateur est bien unique dans le cas d'une modification |
4029 |
+######################################################################################################################################### |
4030 |
+# unique_username_modify is used to verify if the username in the username's field is already taken or not in case of user's modification |
4031 |
+ |
4032 |
+sub unique_username_modify { |
4033 |
+ |
4034 |
+ my ($fm, $user_get) = @_; |
4035 |
+ my $self = shift; |
4036 |
+ my $return_error = $self->localise('MULTIPLE_USERNAME'); |
4037 |
+ my $cgi = $self->{cgi}; |
4038 |
+ my $param_user = $cgi->param('actUsr'); |
4039 |
+ my $present = 0; |
4040 |
+ |
4041 |
+ if($user_get eq $param_user){ |
4042 |
+ return "OK"; |
4043 |
+ } |
4044 |
+ else { |
4045 |
+ open(USER, "zarafa-admin -l | awk 'NR > 4' |"); |
4046 |
+ while(<USER>){ |
4047 |
+ my $user = $_; |
4048 |
+ if ($user =~ m/$user_get\t/){ |
4049 |
+ $present = 1; |
4050 |
+ } |
4051 |
+ } |
4052 |
+ close(USER); |
4053 |
+ if($present == 1){ |
4054 |
+ return $return_error; |
4055 |
+ } |
4056 |
+ else { |
4057 |
+ return "OK"; |
4058 |
+ } |
4059 |
+ } |
4060 |
+} |
4061 |
+ |
4062 |
+# unique_email_modify est utilisé pour vérifié si l'email utilisateur est bien unique dans le cas d'une modification |
4063 |
+################################################################################################################################ |
4064 |
+# unique_email_modify is used to verify if the email in the email's field is already taken or not in case of user's modification |
4065 |
+ |
4066 |
+sub unique_email_modify { |
4067 |
+ |
4068 |
+ my ($fm, $email_get) = @_; |
4069 |
+ my $self = shift; |
4070 |
+ my $return_error = $self->localise('MULTIPLE_EMAIL'); |
4071 |
+ my $cgi = $self->{cgi}; |
4072 |
+ my $param_user = $cgi->param('actUsr'); |
4073 |
+ my $present = 0; |
4074 |
+ |
4075 |
+ open(MAIL, "zarafa-admin --details \"$param_user\" |"); |
4076 |
+ while(<MAIL>){ |
4077 |
+ my $ligne = $_; |
4078 |
+ if ($ligne =~ m/$email_get/){ |
4079 |
+ return "OK"; |
4080 |
+ } |
4081 |
+ } |
4082 |
+ close(MAIL); |
4083 |
+ |
4084 |
+ open(USER, "zarafa-admin -l | awk 'NR > 3' |"); |
4085 |
+ while(<USER>){ |
4086 |
+ my $user = $_; |
4087 |
+ $user =~ s/\t{2}.*$//g; |
4088 |
+ $user =~ s/^\t{1}//g; |
4089 |
+ chomp $user; |
4090 |
+ if($user) { |
4091 |
+ if ($user =~ /^([-\@\w.]+)$/) { |
4092 |
+ $user = $1; # $data now untainted |
4093 |
+ } |
4094 |
+ else { |
4095 |
+ die "Bad data in '$user'"; |
4096 |
+ } |
4097 |
+ open(EMAIL, "zarafa-admin --details \"$user\" |"); |
4098 |
+ while(<EMAIL>){ |
4099 |
+ my $mail = $_; |
4100 |
+ if ($mail =~ m/$email_get/){ |
4101 |
+ $present = 1; |
4102 |
+ } |
4103 |
+ } |
4104 |
+ } |
4105 |
+ close(EMAIL); |
4106 |
+ } |
4107 |
+ close(USER); |
4108 |
+ |
4109 |
+ if($present == 1){ |
4110 |
+ return $return_error; |
4111 |
+ } |
4112 |
+ else { |
4113 |
+ return "OK"; |
4114 |
+ } |
4115 |
+} |
4116 |
+ |
4117 |
+# unique_groupname est utilisé pour vérifié si le nom du groupe est bien unique dans le cas d'une création de groupe |
4118 |
+#################################################################################################################### |
4119 |
+# unique_groupname is used to verify if the groupnamed is already taken or not in case of an group's creation |
4120 |
+ |
4121 |
+sub unique_groupname { |
4122 |
+ |
4123 |
+ my ($fm, $groupname) = @_; |
4124 |
+ my $self = shift; |
4125 |
+ my $return_error = $self->localise('MULTIPLE_GROUPNAME'); |
4126 |
+ my $present = 0; |
4127 |
+ |
4128 |
+ open(GROUP, "zarafa-admin -L | awk 'NR > 3' |"); |
4129 |
+ while(<GROUP>){ |
4130 |
+ my $ligne = $_; |
4131 |
+ if ($ligne =~ m/$groupname/i){ |
4132 |
+ $present = 1; |
4133 |
+ } |
4134 |
+ } |
4135 |
+ close(GROUP); |
4136 |
+ |
4137 |
+ if($present == 1){ |
4138 |
+ return $return_error; |
4139 |
+ } |
4140 |
+ else { |
4141 |
+ return "OK"; |
4142 |
+ } |
4143 |
+} |
4144 |
+ |
4145 |
+# Cette fonction est principalement utilisé pour vérifié la composition d'un nom d'utilisateur saisi par l'utilisateur |
4146 |
+###################################################################################################################### |
4147 |
+# This function is mainly use to verify the composition of an username enter by an user. |
4148 |
+ |
4149 |
+sub my_username { |
4150 |
+ |
4151 |
+ my ($fm, $username) = @_; |
4152 |
+ my $self = shift; |
4153 |
+ my $return_error = $self->localise('FALSE_USERNAME'); |
4154 |
+ |
4155 |
+ if ($username) { |
4156 |
+ if($username =~ m/^\w+((\.|\-|@)?\w+)*$/){ |
4157 |
+ return "OK"; |
4158 |
+ } |
4159 |
+ else { |
4160 |
+ return $return_error; |
4161 |
+ } |
4162 |
+ } |
4163 |
+ else { |
4164 |
+ return $return_error; |
4165 |
+ } |
4166 |
+} |
4167 |
+ |
4168 |
+sub show_company_users { |
4169 |
+ |
4170 |
+ my $self = shift; |
4171 |
+ my $q = $self->{cgi}; |
4172 |
+ |
4173 |
+ my $company = $q->param('actComp'); |
4174 |
+ if ($company =~ /^([-\@\w.]+)$/) { |
4175 |
+ $company = $1; # $data now untainted |
4176 |
+ } |
4177 |
+ else { |
4178 |
+ die "bad data in $company"; |
4179 |
+ } |
4180 |
+ my $scriptname = basename($0); |
4181 |
+ |
4182 |
+ # Localisation |
4183 |
+ # Localization |
4184 |
+ my $username = $self->localise('USER_NAME_ARRAY'); |
4185 |
+ my $suppr = $self->localise('DELETE'); |
4186 |
+ |
4187 |
+ # Affichage de l'en-tête du tableau |
4188 |
+ # Display the header |
4189 |
+ print " <tr>\n <td colspan=\"2\">\n "; |
4190 |
+ print $q->start_table ({-CLASS => "sme-border"}),"\n "; |
4191 |
+ print $q->Tr( |
4192 |
+ esmith::cgi::genSmallCell($q, $username,"header"), |
4193 |
+ esmith::cgi::genSmallCell($q, $suppr,"header")); |
4194 |
+ |
4195 |
+ # Parcours de la liste des groupes avec affichage dans le tableau de chacun, création et affichage des liens correspondant |
4196 |
+ # Browse the group's list and display them into the array, create and diplay the links |
4197 |
+ open(LIRE, "zarafa-admin -l | cut -f2 |"); |
4198 |
+ my $user; |
4199 |
+ my $nbr = 0; |
4200 |
+ while (<LIRE>) { |
4201 |
+ if (m/\w+\@$company/) { |
4202 |
+ $user = $_; |
4203 |
+ my $delete = "<a href=\"$scriptname?page=0&wherenext=DeleteUser&actUsr=$user\">$suppr</a>"; |
4204 |
+ my $modify = "<a href=\"$scriptname?page=0&wherenext=DisplayDetails&actUsr=$user\">$user</a>"; |
4205 |
+ print $q->Tr( |
4206 |
+ esmith::cgi::genSmallCell($q,$modify ,"normal")," ", |
4207 |
+ esmith::cgi::genSmallCell($q,$delete,"normal")); |
4208 |
+ } |
4209 |
+ } |
4210 |
+ close(LIRE); |
4211 |
+ |
4212 |
+ print qq(</table></td></tr>\n); |
4213 |
+ |
4214 |
+ my $add_user = $self->localise('ADD_USER'); |
4215 |
+ my $add_user_bubble = $self->localise('ADD_USER_BUBBLE'); |
4216 |
+ |
4217 |
+ my $out ="<p><a class=\"button-like\" |
4218 |
+ href=\"zarafaUI?page=0&wherenext=DisplayCreateUser\" title=\"$add_user_bubble\">$add_user</a></p>"; |
4219 |
+ |
4220 |
+ |
4221 |
+return $out; |
4222 |
+} |
4223 |
+ |
4224 |
+sub print_message { |
4225 |
+ |
4226 |
+ my ($fm, $word) = @_; |
4227 |
+ $word = $fm->localise($word); |
4228 |
+ print qq(<tr><td colspan=2>$word</td></tr>); |
4229 |
+ return undef; |
4230 |
+ |
4231 |
+} |
4232 |
+ |
4233 |
+sub create_company { |
4234 |
+ |
4235 |
+ my ($self) = @_; |
4236 |
+ my $cgi = $self->{cgi}; |
4237 |
+ |
4238 |
+ my $companyname = $self->{cgi}->param('createcompanyname'); |
4239 |
+ if ($companyname =~ /^([-\@\w.]+)$/) { |
4240 |
+ $companyname = $1; # $data now untainted |
4241 |
+ } |
4242 |
+ else { |
4243 |
+ die "Bad data in '$companyname'"; |
4244 |
+ } |
4245 |
+ |
4246 |
+ |
4247 |
+ system("zarafa-admin --create-company \"$companyname\" > /dev/null") == 0 |
4248 |
+ or die "Impossible de créer la companie $companyname"; |
4249 |
+ |
4250 |
+ $self->success('CREATE_COMPANY_SUCCESS'); |
4251 |
+ |
4252 |
+} |
4253 |
+ |
4254 |
+sub delete_company { |
4255 |
+ |
4256 |
+ my ($self) = @_; |
4257 |
+ my $cgi = $self->{cgi}; |
4258 |
+ |
4259 |
+ my $companyname = $self->{cgi}->param('actComp'); |
4260 |
+ if ($companyname =~ /^([-\@\w.]+)$/) { |
4261 |
+ $companyname = $1; # $data now untainted |
4262 |
+ } |
4263 |
+ else { |
4264 |
+ die "Bad data in '$companyname'"; |
4265 |
+ } |
4266 |
+ |
4267 |
+ system("zarafa-admin --delete-company \"$companyname\" > /dev/null") == 0 |
4268 |
+ or die "Impossible de créer la companie $companyname"; |
4269 |
+ |
4270 |
+ $self->success('DELETE_COMPANY_SUCCESS'); |
4271 |
+} |
4272 |
+ |
4273 |
+sub display_delete_comp_button { |
4274 |
+ |
4275 |
+ my ($self) = @_; |
4276 |
+ my $cgi = $self->{cgi}; |
4277 |
+ |
4278 |
+ my $group = $cgi->param('actComp'); |
4279 |
+ if ($group =~ /^([-\@\w.]+)$/) { |
4280 |
+ $group = $1; # $data now untainted |
4281 |
+ } |
4282 |
+ else { |
4283 |
+ die "Bad data in '$group'"; |
4284 |
+ } |
4285 |
+ |
4286 |
+ $self->print_button("DELETE"); |
4287 |
+ |
4288 |
+} |
4289 |
\ No newline at end of file |