-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EvaServ.tcl
executable file
·5076 lines (4873 loc) · 185 KB
/
EvaServ.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
##############################################################
# ███████╗██╗ ██╗ █████╗ ███████╗███████╗██████╗ ██╗ ██╗ #
# ██╔════╝██║ ██║██╔══██╗██╔════╝██╔════╝██╔══██╗██║ ██║ #
# █████╗ ██║ ██║███████║███████╗█████╗ ██████╔╝██║ ██║ #
# ██╔══╝ ╚██╗ ██╔╝██╔══██║╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝ #
# ███████╗ ╚████╔╝ ██║ ██║███████║███████╗██║ ██║ ╚████╔╝ #
# ╚══════╝ ╚═══╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ #
##############################################################
#
# Auteur :
# -> ZarTek (ZarTek.Creole@GMail.Com)
#
# Website :
# -> github.com/ZarTek-Creole/TCL-EvaServ
#
# Support :
# -> github.com/ZarTek-Creole/TCL-EvaServ/issues
#
# Docs :
# -> github.com/ZarTek-Creole/TCL-EvaServ/wiki
#
# LICENSE :
# -> GNU General Public License v3.0
# -> github.com/ZarTek-Creole/TCL-EvaServ/blob/main/LICENSE.txt
#
# Code origine:
# -> TiSmA (TiSmA@eXolia.fr)
#
##############################################################
if { [info commands ::EvaServ::uninstall] eq "::EvaServ::uninstall" } { ::EvaServ::uninstall }
namespace eval ::EvaServ {
variable ::EvaServ::config
variable ::EvaServ::SCRIPT
set VARS_LIST [list \
"config" \
"SCRIPT" \
"UPLINK" \
"SERVICE" \
"SERVICE_BOT" \
];
array set config [list \
"timerco" "30" \
"timerdem" "5" \
"timerinit" "10" \
"counter" "0" \
"dem" "0" \
"init" "0" \
"console" "1" \
"login" "1" \
"protection" "1" \
"debug" "0" \
"aclient" "0" \
"putlog_info" "0" \
"smode" "ntsO" \
"chanmode" "qo" \
"prefix" "!" \
"rnick" "0" \
"Throttling" "5" \
"Flood_IgnoreTime" "30" \
"gline_duration" "86400" \
"rclient" "L'accès à ce t'chat est un privilège et non un droit. (CI)" \
"rhost" "L'accès à ce t'chat est un privilège et non un droit. (Ip refusé)" \
"rident" "L'accès à ce t'chat est un privilège et non un droit. (IR)" \
"rreal" "L'accès à ce t'chat est un privilège et non un droit. (BR)" \
"ruser" "L'accès à ce t'chat est un privilège et non un droit. (BN)" \
"<Raison>" "Maintenance Technique" \
"console_com" "02" \
"console_deco" "03" \
"console_txt" "01" \
];
set VARS_config [list \
"timerco" \
"timerdem" \
"timerinit" \
"counter" \
"dem" \
"init" \
"console" \
"login" \
"protection" \
"debug" \
"aclient" \
"putlog_info" \
"smode" \
"chanmode" \
"prefix" \
"rnick" \
"Throttling" \
"Flood_IgnoreTime" \
"gline_duration" \
"rclient" \
"rhost" \
"rident" \
"rreal" \
"ruser" \
"<Raison>" \
"console_com" \
"console_deco" \
"console_txt" \
"nick_length" \
"password_length" \
];
array set SCRIPT [list \
"name" "EvaServ Service" \
"version" "1.5.20220704" \
"auteur" "ZarTek" \
"path_dir" "[file dirname [info script]]" \
"need_ircs" "0.0.7" \
"need_zct" "0.0.4" \
];
set VARS_SCRIPT [list \
"name" \
"version" \
"auteur" \
"path_dir" \
];
set VARS_UPLINK [list \
"hostname" \
"mode_ssl" \
"port" \
"password" \
];
set VARS_SERVICE [list \
"hostname" \
"sid" \
"use_privmsg" \
"mode_debug" \
"hostname" \
];
set VARS_SERVICE_BOT [list \
"name" \
"hostname" \
"gecos" \
"mode_service" \
"channel" \
"mode_channel" \
"mode_user" \
"username" \
"channel_logs" \
];
set VARS_cmdhelp [list \
"prefix" \
"cmd" \
];
proc uninstall { } {
variable ::EvaServ::config
variable ::EvaServ::CONNECT_ID
variable ::EvaServ::SCRIPT
putlog "Désallocation des ressources de \002${SCRIPT(name)}\002..." info
${CONNECT_ID} destroy
foreach binding [lsearch -inline -all -regexp [binds *[set ns [::tcl::string::range [namespace current] 2 end]]*] " \{?(::)?${ns}"] {
unbind [lindex ${binding} 0] [lindex ${binding} 1] [lindex ${binding} 2] [lindex ${binding} 4]
}
# Arrêt des timers en cours.
foreach running_timer [timers] {
if { [::tcl::string::match "*[namespace current]::*" [lindex ${running_timer} 1]] } { killtimer [lindex ${running_timer} 2] }
}
namespace delete ::EvaServ
}
}
namespace eval ::EvaServ::DB_USER {
namespace import -force ::EvaServ::*
}
proc ::EvaServ::DB_USER::COUNT { } {
set USER_COUNT 0
foreach User [userlist] {
if { [getuser ${User} XTRA EvaServ] != "" } {
incr USER_COUNT
}
}
return ${USER_COUNT}
}
proc ::EvaServ::DB_USER::GET_LEVEL { USER_NAME } {
if {
![validuser ${USER_NAME}] || \
![dict exist [getuser ${USER_NAME}] XTRA EvaServ NIVEAU]
} {
return 0
}
return [dict get [getuser ${USER_NAME} XTRA EvaServ] NIVEAU]
}
proc ::EvaServ::DB_USER::ADD { USER_ADDER USER_NAME USER_PASS USER_NIVEAU } {
variable ::EvaServ::commands
variable ::EvaServ::config
if ![dict exists ${commands} ${USER_NIVEAU}] {
::EvaServ::SENT::MSG:TO:USER ${USER_ADDER} [format "Le niveau <b>%s</b> n'existe pas dans la configuration" ${USER_NIVEAU}]
return 0
}
if [validuser ${USER_NAME}] {
::EvaServ::SENT::MSG:TO:USER ${USER_ADDER} [format "L'utilisateur <b>%s</b> existe déjà. Opération échoué" ${USER_NAME}]
return 0
}
if {
[dict exists ${commands} ${USER_NIVEAU} attr] && \
[dict get ${commands} ${USER_NIVEAU} attr] != ""
} {
set USER_ATTR [dict get ${commands} ${USER_NIVEAU} attr] ;
} else {
::EvaServ::SENT::MSG:TO:USER ${USER_ADDER} [format "La valeur <b>attr</b> est absente pour le niveau <b>%s</b>" ${USER_NIVEAU}]
return 0
}
if {
[dict exists ${commands} ${USER_NIVEAU} name] && \
[dict get ${commands} ${USER_NIVEAU} name] != ""
} {
set NIVEAU_NAME [dict get ${commands} ${USER_NIVEAU} name];
} else {
::EvaServ::SENT::MSG:TO:USER ${USER_ADDER} [format "La valeur <b>name</b> est absente pour le niveau <b>%s</b>" ${USER_NIVEAU}]
return 0
}
if { [string length ${USER_NAME}] > ${::EvaServ::config(nick_length)} } {
::EvaServ::SENT::MSG:TO:USER ${USER_ADDER} [format "Le pseudo doit contenir maximum <b>%s</b> caractères." ${::EvaServ::config(nick_length)}];
return 0;
}
if { [string length ${USER_PASS}] < ${::EvaServ::config(password_length)} } {
::EvaServ::SENT::MSG:TO:USER ${USER_ADDER} [format "Le mot de passe doit contenir minimum <b>%s</b> caractères." ${::EvaServ::config(password_length)} ];
return 0;
}
set DATE_TODAY [strftime ${::EvaServ::config(date_format)}]
adduser ${USER_NAME};
setuser ${USER_NAME} PASS ${USER_PASS};
setuser ${USER_NAME} HOSTS ${USER_NAME}*!*@*;
setuser ${USER_NAME} HOSTS -telnet!*@*
setuser ${USER_NAME} XTRA EvaServ [list \
"ROLE" "${NIVEAU_NAME}" \
"NIVEAU" "${USER_NIVEAU}" \
"ADDED_BY" "${USER_ADDER}" \
"ADDED_AT" "${DATE_TODAY}" \
];
if { ${USER_ATTR} != "" } { chattr ${USER_NAME} ${USER_ATTR}; }
catch {save}
::EvaServ::SENT::MSG:TO:USER ${USER_ADDER} [format "<b>%s</b> a bien été ajouté dans la liste des <b>%ss</b>." ${USER_NAME} ${NIVEAU_NAME}]
::EvaServ::SHOW:INFO:TO:CHANLOG "auth_add" [format "Le compte <b>%s</b> à été creer au rang de <b>%s</b> par <b>%s</b>" ${USER_NAME} ${NIVEAU_NAME} ${USER_ADDER}];
return 1
}
namespace eval ::EvaServ::CMD {
namespace import -force ::EvaServ::*
namespace export *
}
proc ::EvaServ::CMD::GET_LIST { } {
variable ::EvaServ::commands
foreach level [dict keys ${commands}] {
lappend CMD_LIST {*}[dict get ${commands} ${level} cmd]
}
return ${CMD_LIST}
}
proc ::EvaServ::CMD::GET_LEVEL { CMD } {
variable ::EvaServ::commands
foreach level [dict keys ${commands}] {
if { [lsearch -nocase [dict get ${commands} ${level} cmd] ${CMD}] != "-1" } {
return ${level}
}
}
return -1
}
proc ::EvaServ::CMD::is_EXIST { CMD } {
if { [lsearch -nocase [::EvaServ::CMD::GET_LIST] ${CMD}] == "-1" } { return 0 }
return 1
}
proc ::EvaServ::CMD::SHOW_BY_LEVEL { DEST LEVEL } {
variable ::EvaServ::commands
set max 6;
set l_espace 13;
set CMD_LIST ""
::EvaServ::SENT::MSG:TO:USER ${DEST} "<c01>\[ Level [dict get ${commands} ${LEVEL} name] - Niveau ${LEVEL} \]"
foreach CMD [lsort [dict get ${commands} ${LEVEL} cmd]] {
lappend CMD_LIST "<c02>[::ZCT::TXT visuals espace ${CMD} ${l_espace}]<c01>"
if { [incr i] > ${max}-1 } {
unset i
::EvaServ::SENT::MSG:TO:USER ${DEST} [join ${CMD_LIST} " | "];
set CMD_LIST ""
}
}
::EvaServ::SENT::MSG:TO:USER ${DEST} [join ${CMD_LIST} " | "];
::EvaServ::SENT::MSG:TO:USER ${DEST} "<c>";
}
namespace eval ::EvaServ::command {
namespace import -force ::EvaServ::*
namespace export *
}
namespace eval ::EvaServ::command::irc {
namespace import -force ::EvaServ::*
namespace export *
}
proc ::EvaServ::command::irc::showcommands { IRC_USER IRC_CMD IRC_VALUE } {
variable ::EvaServ::SCRIPT
set IRC_USER_LOWER [string tolower ${IRC_USER}]
::EvaServ::SENT::MSG:TO:USER ${IRC_USER_LOWER} [format "<b><c01,01>--------------------------------------- <c00>Commandes de %s <c01>---------------------------------------" ${SCRIPT(name)}]
::EvaServ::SHOW:CMD:DESCRIPTION:BY:LEVEL ${IRC_USER_LOWER} 0
if {
[info exists admins(${IRC_USER_LOWER})] && \
[matchattr $admins(${IRC_USER_LOWER}) p]
} {
::EvaServ::SHOW:CMD:DESCRIPTION:BY:LEVEL ${IRC_USER_LOWER} 1
}
if {
[info exists admins(${IRC_USER_LOWER})] && \
[matchattr $admins(${IRC_USER_LOWER}) o]
} {
::EvaServ::SHOW:CMD:DESCRIPTION:BY:LEVEL ${USER_LOWER} 2
}
if {
[info exists admins(${IRC_USER_LOWER})] && \
[matchattr $admins(${USER_LIRC_USER_LOWEROWER}) m]
} {
::EvaServ::SHOW:CMD:DESCRIPTION:BY:LEVEL ${IRC_USER_LOWER} 3
}
if {
[info exists admins(${IRC_USER_LOWER})] && \
[matchattr $admins(${IRC_USER_LOWER}) n]
} {
::EvaServ::SHOW:CMD:DESCRIPTION:BY:LEVEL ${IRC_USER_LOWER} 4
}
::EvaServ::SENT::MSG:TO:USER ${IRC_USER_LOWER} [format "<c02>Aide sur une commande<c01> \[<c04> /msg %s help <la_commande> <c01>\]" ${::EvaServ::SERVICE_BOT(name)}]
if { [::EvaServ::ShowOnPartyLine 1] } {
::EvaServ::SHOW:INFO:TO:CHANLOG "Showcommands" "${IRC_USER}"
}
}
proc ::EvaServ::command::irc::help { IRC_USER IRC_CMD IRC_VALUE } {
variable ::EvaServ::cmdhelp
variable ::EvaServ::SERVICE_BOT
if {
[string tolower ${IRC_CMD}] == "help" && \
${IRC_VALUE} != ""
} {
set IRC_CMD [lindex ${IRC_VALUE}]
set IRC_VALUE [lrange ${IRC_VALUE} 1 end]
}
if { ${IRC_CMD} == "" } {
::EvaServ::command::irc::showcommands ${IRC_USER} ${IRC_CMD} ${IRC_VALUE}
return 1
}
# Verification que l'utilisateur a les droits a la commande,
# pour afficher seulement l'aide des commandes autoriser
if { ![::EvaServ::authed ${IRC_USER} ${IRC_CMD}] } {
return 0
}
# Verification de l'existance de la variable pour la commande
if { ![dict exists ${cmdhelp} cmd ${IRC_CMD}] } {
::EvaServ::SENT::MSG:TO:USER ${IRC_USER} [format "Aucune aide disponible pour la commande <b>%s</b>" ${IRC_CMD}];
return 0;
}
if { [dict exists ${cmdhelp} prefixe] } {
set MESSAGE [format [dict get ${cmdhelp} prefixe] ${IRC_CMD} ${::EvaServ::SERVICE_BOT(name)} ${IRC_CMD}];
if { [dict exists ${cmdhelp} cmd ${IRC_CMD} syntaxe] } {
append MESSAGE " [dict get ${cmdhelp} cmd ${IRC_CMD} syntaxe]";
}
::EvaServ::SENT::MSG:TO:USER ${IRC_USER} ${MESSAGE};
}
::EvaServ::SENT::MSG:TO:USER ${IRC_USER} [::EvaServ::command::help_GET_DESCRIPTION ${IRC_CMD}]
return 1
}
proc ::EvaServ::command::help_GET_DESCRIPTION { IRC_CMD } {
variable ::EvaServ::cmdhelp
set IRC_CMD [string tolower ${IRC_CMD}]
if { ![dict exists ${cmdhelp} cmd ${IRC_CMD} description_text] } {
return [format "<c07>Aucune description disponibles"];
}
if {
[dict exists ${cmdhelp} cmd ${IRC_CMD} description_val] && \
[dict get ${cmdhelp} cmd ${IRC_CMD} description_val] != ""
} {
return [subst [format [dict get ${cmdhelp} cmd ${IRC_CMD} description_text] {*}[subst [dict get ${cmdhelp} cmd ${IRC_CMD} description_val]]]]
} else {
return [subst [dict get ${cmdhelp} cmd ${IRC_CMD} description_text]]
}
}
proc ::EvaServ::command::irc::auth { IRC_USER IRC_CMD IRC_VALUE } {
set IRC_USER_LOWER [string tolower ${IRC_USER}]
# si aucun argument est fournis, on retourne l'aide
if { [lindex ${IRC_VALUE} 0] == "" } {
::EvaServ::command::irc::help ${IRC_USER} ${IRC_CMD} ${IRC_VALUE}
return 0
}
if { [lindex ${IRC_VALUE} 1] == "" } {
set USER_NAME ${IRC_USER}
set USER_PASS [lindex ${IRC_VALUE} 0]
} else {
set USER_NAME [lindex ${IRC_VALUE} 0]
set USER_PASS [lindex ${IRC_VALUE} 1]
}
# Verification si des utilisateurs 'eva' exists
if { [::EvaServ::DB_USER::COUNT] == 0 } {
# Si aucun utilisateurs Eva, nous creons le compte en tant que ircop supreme
if {
![validuser ${USER_NAME}] && \
[getchanhost ${USER_NAME} ${::EvaServ::SERVICE_BOT(channel)}] == ""
} {
::EvaServ::SENT::MSG:TO:USER ${IRC_USER} \
[format "<b>%s</b>, pour creer votre compte ircop, vous devez être operateur sur le salon <b>%s</b>." \
${USER_NAME} ${::EvaServ::SERVICE_BOT(channel)}];
return 0
}
if ![::EvaServ::DB_USER::ADD ${IRC_USER} ${USER_NAME} ${USER_PASS} 4] { return 0 }
}
if { ![passwdok ${USER_NAME} ${USER_PASS}] } {
::EvaServ::SENT::MSG:TO:USER ${IRC_USER} [format "L'authentification à échoué, un mauvais mot de passe à été fournis."];
::EvaServ::SHOW:INFO:TO:CHANLOG "auth" [format "L'authentification à échoué pour mauvais mot de passe pour le pseudonyme <b>%s</b> du compte de <b>%s</b> ." ${IRC_USER} ${USER_NAME}];
return 0;
}
if {
![matchattr ${USER_NAME} o] || \
![matchattr ${USER_NAME} m] || \
[matchattr ${USER_NAME} n]
} {
if { ${::EvaServ::config(login)} == 1 } {
foreach { pseudo login } [array get admins] {
if {
${login} == [string tolower ${USER_NAME}] && \
${pseudo} != ${IRC_USER_LOWER}
} {
::EvaServ::SENT::MSG:TO:USER ${IRC_USER} [format "Maximum de connexion est atteint pour <b>%s</b>." ${USER_NAME}];
return 0;
}
}
}
if { [info exists admins(${IRC_USER_LOWER})] } {
::EvaServ::SENT::MSG:TO:USER ${IRC_USER} "Vous êtes déjà authentifié.";
return 0;
}
set admins(${IRC_USER_LOWER}) [string tolower ${USER_NAME}]
if {
[info exists vhost(${IRC_USER_LOWER})] && \
![info exists protect($vhost(${IRC_USER_LOWER}))]
} {
::EvaServ::SHOW:INFO:TO:CHANLOG "Protecion du host" [format "<b>%s</b> de <b>%s</b> (Activé)" $vhost(${IRC_USER_LOWER}) ${USER_LOWER}]
set protect($vhost(${IRC_USER_LOWER})) 1
}
setuser [string tolower ${USER_NAME}] LASTON [unixtime]
::EvaServ::SENT::MSG:TO:USER ${IRC_USER} "Authentification Réussie."
::EvaServ::FCT:SENT:SERV INVITE ${IRC_USER} ${::EvaServ::SERVICE_BOT(channel_logs)};
if { [::EvaServ::ShowOnPartyLine 1] } {
::EvaServ::SHOW:INFO:TO:CHANLOG "Auth" [format "L'utilisateur <b>%s</b> s'est identifié au compte <b>%s</b>." ${IRC_USER} ${USER_NAME}]
}
return 0
} elseif { [matchattr ${USER_NAME} p] } {
::EvaServ::SENT::MSG:TO:USER ${IRC_USER} "Authentification Helpeur Refusée.";
return 0;
}
}
proc ::EvaServ::INIT { } {
variable ::EvaServ::SCRIPT
variable ::EvaServ::UPLINK
variable ::EvaServ::SERVICE
variable ::EvaServ::SERVICE_BOT
variable ::EvaServ::FloodControl
variable ::EvaServ::commands
variable ::EvaServ::cmdhelp
variable ::EvaServ::config
variable ::EvaServ::CMD
variable ::EvaServ::DB
if {
![file exists [Script:Get:Directory]/EvaServ.conf] && \
[file exists [Script:Get:Directory]/EvaServ.Example.conf]
} {
putlog "Vous devez configurer EvaServ. Renommer [Script:Get:Directory]/EvaServ.Example.conf en EvaServ.conf et editez-le" error
exit
}
if { [ catch { source [Script:Get:Directory]/EvaServ.conf } err ] } {
putlog "Probleme de chargement de '[Script:Get:Directory]/EvaServ.conf':\n${err}" error
foreach ERR [split $::errorInfo "\n"] {
putlog ${ERR}
}
exit
}
#TODO: Verifié les bind dcc (ancien code)
bind time - "00 00 * * *" ::EvaServ::dbback
bind evnt n prerestart evenement
bind evnt n sighup evenement
bind evnt n sigterm evenement
bind evnt n sigill evenement
bind evnt n sigquit evenement
bind evnt n prerehash prerehash
bind evnt n rehash rehash
bind dcc n eva eva
bind dcc n evaconnect connect
bind dcc n evadeconnect deconnect
bind dcc n evauptime uptime
bind dcc n evaversion version
bind dcc n evainfos infos
bind dcc n evadebug debug
# Verification de la présences des paramettre dans le fichier configuration (fonction ZCT)
::ZCT::Is:ArrayList:Exists [namespace current]
if { ![file isdirectory "[Script:Get:Directory]/db"] } { file mkdir "[Script:Get:Directory]/db" }
# generer les db
Database:initialisation [list \
"gestion" \
"chan" \
"client" \
"close" \
"salon" \
"ident" \
"real" \
"host" \
"nick" \
"trust"
];
if {
[file exists [Script:Get:Directory]/TCL-PKG-IRCServices/ircservices.tcl] && \
[catch { source [Script:Get:Directory]/TCL-PKG-IRCServices/ircservices.tcl } err]
} {
die "\[${SCRIPT(name)} - Erreur\] Chargement '[Script:Get:Directory]/TCL-PKG-IRCServices/ircservices.tcl' à échoué: ${err}";
}
if { [catch { package require IRCServices ${SCRIPT(need_ircs)} }] } {
putloglev o * "\00304\[${SCRIPT(name)} - erreur\]\003 ${SCRIPT(name)} nécessite le package IRCServices ${SCRIPT(need_ircs)} (ou plus) pour fonctionner, Télécharger sur 'github.com/ZarTek-Creole/TCL-PKG-IRCServices'.\nLe chargement du script a été annulé." ;
return 0
}
if { [file exists [Script:Get:Directory]/TCL-ZCT/ZCT.tcl] } { catch { source [Script:Get:Directory]/TCL-ZCT/ZCT.tcl } }
if { [catch { package require ZCT ${SCRIPT(need_zct)} } err] } {
die "\[${PKG(name)} - erreur\] Nécessite le package ZCT ${PKG(need_zct)} (ou plus) pour fonctionner, Télécharger sur 'https://github.com/ZarTek-Creole/TCL-ZCT'.\nLe chargement du script a été annulé." ;
} else {
namespace import -force ::ZCT::*
}
Database:Load:Data
Service:Connexion
putlog "v${SCRIPT(version)} par ${SCRIPT(auteur)} OK." success
}
proc ::EvaServ::Service:Connexion { } {
variable ::EvaServ::config
variable ::EvaServ::CONNECT_ID
variable ::EvaServ::BOT_ID
variable ::EvaServ::SERVICE
variable ::EvaServ::SERVICE_BOT
variable ::EvaServ::UPLINK
if { ${UPLINK(mode_ssl)} == 1 } { set UPLINK(port) "+${UPLINK(port)}" }
if { ${SERVICE(sid)} != "" } { set config(uplink_ts6) 1 } else { set config(uplink_ts6) 0 }
set CONNECT_ID [::IRCServices::connection]; # Creer une instance services
SENT::PUTLOG_INFO "Connexion du link EvaServ ${SERVICE(hostname)}"
${CONNECT_ID} connect ${UPLINK(hostname)} ${UPLINK(port)} ${UPLINK(password)} ${::EvaServ::config(uplink_ts6)} ${SERVICE(hostname)} ${SERVICE(sid)}; # Connexion de l'instance service
if { ${SERVICE(mode_debug)} == 1 } { ${CONNECT_ID} config logger 1; ${CONNECT_ID} config debug 1; }
set BOT_ID [${CONNECT_ID} bot]; #Creer une instance bot dans linstance services
SENT::PUTLOG_INFO "Creation du bot service ${::EvaServ::SERVICE_BOT(name)}"
${BOT_ID} create ${::EvaServ::SERVICE_BOT(name)} ${::EvaServ::SERVICE_BOT(username)} ${::EvaServ::SERVICE_BOT(hostname)} ${::EvaServ::SERVICE_BOT(gecos)} ${::EvaServ::SERVICE_BOT(mode_service)}]; # Creation d'un bot service
${BOT_ID} join ${::EvaServ::SERVICE_BOT(channel)}
${BOT_ID} registerevent EOS {
global ::EvaServ::SERVICE_BOT
[sid] mode ${::EvaServ::SERVICE_BOT(channel)} ${::EvaServ::SERVICE_BOT(mode_channel)}
if { ${::EvaServ::SERVICE_BOT(mode_user)} != "" } {
[sid] mode ${::EvaServ::SERVICE_BOT(channel)} ${::EvaServ::SERVICE_BOT(mode_user)} ${::EvaServ::SERVICE_BOT(name)}
}
}
${BOT_ID} registerevent PRIVMSG {
set IRC_CMD [lindex [msg] 0]
set IRC_VALUE [lrange [msg] 1 end]
##########################
#--> Commandes Privés <--#
##########################
# si [target] ne commence pas par # c'est un pseudo
if { [string index [target] 0] != "#" } {
if { [catch { set OK [::EvaServ::IRC:CMD:MSG:PRIV [who2] [target] ${IRC_CMD} ${IRC_VALUE}] } EXEC_ERROR] } {
foreach line [split ${::errorInfo} "\n"] {
::EvaServ::SHOW:INFO:TO:CHANLOG error ${line}
putlog ${line} error IRC:CMD:MSG:PRIV
}
return 0;
} else {
return ${OK};
}
}
##########################
#--> Commandes Salons <--#
##########################
# si [target] commence par # c'est un salon
# et que le prefixe est present CMD(prefixe)
if {
[string index [target] 0] == "#" && \
[string index ${IRC_CMD} 0] == ${::EvaServ::CMD(prefixe)}
} {
# on retire les prefix a la commande, en ce basant sur sa longueur
set IRC_CMD [string range ${IRC_CMD} [string length ${::EvaServ::CMD(prefixe)}] end]
if { [catch { set OK [::EvaServ::IRC:CMD:MSG:PUB [who] [target] ${IRC_CMD} ${IRC_VALUE}] } EXEC_ERROR] } {
foreach line [split ${::errorInfo} "\n"] {
::EvaServ::SHOW:INFO:TO:CHANLOG error ${line}
putlog ${line} error IRC:CMD:MSG:PUB
}
return 0;
} else {
return ${OK};
}
}
}
}
proc ::EvaServ::IRC:CMD:MSG:PRIV { NICK_SOURCE TARGET IRC_CMD IRC_VALUE } {
variable ::EvaServ::config
variable ::EvaServ::SCRIPT
if { ![FloodControl:Check ${NICK_SOURCE}] } { return 0 }
switch -nocase ${IRC_CMD} {
"PING" {
::EvaServ::SENT::NOTICE ${NICK_SOURCE} "\001PING ${IRC_VALUE}\001";
}
"TIME" {
::EvaServ::SENT::NOTICE ${NICK_SOURCE} "\001TIME [clock format [clock seconds]]\001";
}
"VERSION" {
::EvaServ::SENT::NOTICE ${NICK_SOURCE} "\001VERSION ${SCRIPT(name)} v${SCRIPT(version)} by ${SCRIPT(auteur)} © Visit: https://git.io/JOG1k\001";
}
"SOURCE" {
::EvaServ::SENT::NOTICE ${NICK_SOURCE} "\001SOURCE https://git.io/JOG1k\001";
}
"FINGER" {
::EvaServ::SENT::NOTICE ${NICK_SOURCE} "\001FINGER [string map {" " "_"} ${SCRIPT(name)}] ${SCRIPT(version)}\001";
}
"USERINFO" {
::EvaServ::SENT::NOTICE ${NICK_SOURCE} "\001USERINFO [string map {" " "_"} ${SCRIPT(name)}] (v${SCRIPT(version)} - Visit: https://git.io/JOG1k)\001";
}
"CLIENTINFO" {
::EvaServ::SENT::NOTICE ${NICK_SOURCE} "\001CLIENTINFO CLIENTINFO PING TIME VERSION FINGER USERINFO\001";
}
default {
# Commande exists ?
if { ![::EvaServ::CMD::is_EXIST ${IRC_CMD}] } {
::EvaServ::SENT::MSG:TO:USER ${NICK_SOURCE} [format "Aucune aide disponible pour la commande <b>%s</b> car elle est inconnue." ${IRC_CMD}]
return 0
}
if { [catch { set OK [::EvaServ::cmds ${NICK_SOURCE} ${IRC_CMD} ${IRC_VALUE}] } EXEC_ERROR] } {
foreach line [split ${::errorInfo} "\n"] {
::EvaServ::SHOW:INFO:TO:CHANLOG error ${line}
putlog ${line} error IRC:CMD:MSG:PRIV
}
return 0;
} else {
return ${OK};
}
}
}
}
# Commande taper publiquement
proc ::EvaServ::IRC:CMD:MSG:PUB { IRC_USER TARGET IRC_CMD IRC_VALUE } {
variable ::EvaServ::config
variable ::EvaServ::SCRIPT
if { [lsearch ${::EvaServ::CMD(PUBLIC_DISALLOW)} ${IRC_CMD}] != "-1" } {
::EvaServ::SENT::MSG:TO:USER ${TARGET} [format "La commande <b>%s</b> est bloqué en salon." ${IRC_CMD}]
return 0
}
if { ![FloodControl:Check ${IRC_USER}] } { return 0 }
if { ${IRC_CMD} == "ping" } {
::EvaServ::SENT::MSG:TO:USER ${IRC_USER} "\001PING [clock seconds]\001";
return 0;
}
if { ${IRC_CMD} == "version" } {
::EvaServ::SENT::MSG:TO:USER ${IRC_USER} "<c01>${SCRIPT(name)} ${SCRIPT(version)} by ${SCRIPT(auteur)}<c03>©";
return 0;
}
# Commande exists ?
if { ![::EvaServ::CMD::is_EXIST ${IRC_CMD}] } { return 0 }
if { [catch { set OK [::EvaServ::cmds ${IRC_USER} ${IRC_CMD} ${IRC_VALUE}] } EXEC_ERROR] } {
foreach line [split ${::errorInfo} "\n"] {
::EvaServ::SHOW:INFO:TO:CHANLOG error ${line}
putlog ${line} error IRC:CMD:MSG:PRIV
}
return 0;
} else {
return ${OK};
}
}
proc ::EvaServ::Script:Get:Directory { } {
variable ::EvaServ::SCRIPT;
return ${SCRIPT(path_dir)}
}
proc ::EvaServ::Database:initialisation { LISTDB } {
foreach DB_NAME ${LISTDB} {
if { ![file exists "[Script:Get:Directory]/db/${DB_NAME}.db"] } {
set FILE_PIPE [open "[Script:Get:Directory]/db/${DB_NAME}.db" a+];
close ${FILE_PIPE}
}
}
}
proc ::EvaServ::Database:Load:Data { } {
variable ::EvaServ::config
variable ::EvaServ::trust
catch { open [Script:Get:Directory]/db/trust.db r } protection
while { ![eof ${protection}] } {
gets ${protection} hosts;
if {
${hosts} != "" && \
![info exists trust(${hosts})]
} {
set trust(${hosts}) 1
SENT::PUTLOG_INFO "L'host '${hosts}' est chargement comme TRUST."
}
}
catch { close ${protection} }
catch { open [Script:Get:Directory]/db/gestion.db r } gestion
while { ![eof ${gestion}] } {
gets ${gestion} var2;
if { ${var2} != "" } { set [lindex ${var2} 0] [lindex ${var2} 1] }
}
catch { close ${gestion} }
}
namespace eval ::EvaServ::SENT {
namespace import -force ::EvaServ::*
namespace export *
}
proc ::EvaServ::SENT::PUTLOG_INFO { MSG } {
variable ::EvaServ::config
if {
[info exists ${::EvaServ::config(putlog_info)}] && \
${::EvaServ::config(putlog_info)} == 1
} {
putlog ${MSG} info
}
}
proc ::EvaServ::SENT::NOTICE { DEST MSG } {
variable ::EvaServ::BOT_ID
${BOT_ID} notice ${DEST} [::ZCT::TXT visuals apply ${MSG}]
}
proc ::EvaServ::SENT::PRIVMSG { DEST MSG } {
variable ::EvaServ::BOT_ID
${BOT_ID} privmsg ${DEST} [::ZCT::TXT visuals apply ${MSG}]
}
proc ::EvaServ::SENT::MSG:TO:USER { DEST MSG } {
variable ::EvaServ::SERVICE
if { ${SERVICE(use_privmsg)} == 1 } {
foreach message [split ${MSG} "\n"] {
::EvaServ::SENT::PRIVMSG ${DEST} ${message};
}
} else {
foreach message [split ${MSG} "\n"] {
::EvaServ::SENT::PRIVMSG ${DEST} ${message};
}
}
}
proc ::EvaServ::SENT::PUT_DEBUG { string } {
set FILE_PIPE [open logs/EvaServ.debug a]
puts ${FILE_PIPE} "[clock format [clock seconds] -format "\[%H:%M\]"] ${string}"
close ${FILE_PIPE}
}
proc ::EvaServ::FloodControl:Check { pseudo } {
variable ::EvaServ::FloodControl
variable ::EvaServ::config
if { ![info exists FloodControl(flood:${pseudo})] } {
set FloodControl(flood:${pseudo}) 1;
utimer 3 [list ::EvaServ::FloodControl:NoticeUser ${pseudo}];
# No-FLOOD
return 1
} elseif { $FloodControl(flood:${pseudo}) < ${::EvaServ::config(Throttling)} } {
incr FloodControl(flood:${pseudo}) 1;
# No-FLOOD
return 1
} else {
if { ![info exists FloodControl(stopflood:${pseudo})] } {
set FloodControl(stopflood:${pseudo}) 1
}
}
# FLOOD
return 0
}
proc ::EvaServ::FloodControl:NoticeUser { pseudo } {
variable ::EvaServ::FloodControl
if { [info exists FloodControl(stopflood:${pseudo})] } {
::EvaServ::SENT::MSG:TO:USER ${pseudo} "Vous êtes ignoré pendant ${::EvaServ::config(Flood_IgnoreTime)} secondes.";
utimer ${::EvaServ::config(Flood_IgnoreTime)} [list ::EvaServ::FloodControl:Reset ${pseudo}];
} else {
unset FloodControl(flood:${pseudo})
}
}
proc ::EvaServ::FloodControl:Reset { pseudo } {
variable ::EvaServ::FloodControl
if { [info exists FloodControl(stopflood:${pseudo})] } { unset FloodControl(stopflood:${pseudo}) }
if { [info exists FloodControl(flood:${pseudo})] } { unset FloodControl(flood:${pseudo}) }
::EvaServ::SENT::MSG:TO:USER ${pseudo} "Vous n'êtes plus ignoré.";
}
proc ::EvaServ::authed { IRC_USER IRC_CMD } {
variable ::EvaServ::admins
set CMD_LEVEL [::EvaServ::CMD::GET_LEVEL ${IRC_CMD}];
if { ${CMD_LEVEL} == "-1" } {
::EvaServ::SENT::MSG:TO:USER ${IRC_USER} [format "La command <b>%s</b> est inconnue." ${IRC_CMD}];
return 0;
}
if {
[::EvaServ::DB_USER::GET_LEVEL ${IRC_USER}] >= ${CMD_LEVEL}
} {
return 1
}
::EvaServ::SENT::MSG:TO:USER ${IRC_USER} [format "L'accès à la commande <b>%s</b> vous est refusée." ${IRC_CMD}];
return 0
}
proc ::EvaServ::SHOW:CMD:DESCRIPTION:BY:LEVEL { DEST LEVEL } {
variable ::EvaServ::commands
set max 6;
set l_espace 13;
set CMD_LIST ""
::EvaServ::SENT::MSG:TO:USER ${DEST} "<c01>\[ Level [dict get ${commands} ${LEVEL} name] - Niveau ${LEVEL} \]"
foreach CMD [lsort [dict get ${commands} ${LEVEL} cmd]] {
set CMD_LOWER [string tolower ${CMD}];
set CMD_UPPER [string toupper ${CMD}];
::EvaServ::SENT::MSG:TO:USER ${DEST} "<c02>[::ZCT::TXT visuals espace ${CMD_UPPER} ${l_espace}]<c01> \[<c04> [::EvaServ::command::help_GET_DESCRIPTION ${CMD_LOWER}] <c01>\]";
}
::EvaServ::SENT::MSG:TO:USER ${DEST} "<c>";
}
###################################################################################################################################################################################################
#TODO: Enlever les résidu de l'ancien systeme de protocol
proc ::EvaServ::sent2ppl { IDX MSG } {
putdcc ${IDX} ${MSG}
}
proc ::EvaServ::SHOW:INFO:TO:CHANLOG { TYPE DATA } {
variable ::EvaServ::config
variable ::EvaServ::SERVICE_BOT
::EvaServ::SENT::MSG:TO:USER ${::EvaServ::SERVICE_BOT(channel_logs)} "<c${::EvaServ::config(console_com)}>[::ZCT::TXT visuals espace ${TYPE} 16]<c${::EvaServ::config(console_deco)}>:<c${::EvaServ::config(console_txt)}> ${DATA}"
}
#TODO: Enlever les résidu de l'ancien systeme de protocol (suite)
proc ::EvaServ::FCT:SENT:SERV { args } {
variable ::EvaServ::BOT_ID
${BOT_ID} ${args}
}
proc ::EvaServ::FCT:SENT:MODE { DEST {MODE ""} {CIBLE ""} } {
::EvaServ::FCT:SENT:SERV MODE ${DEST} ${MODE} ${CIBLE};
}
proc ::EvaServ::FCT:SET:TOPIC { DEST TOPIC } {
::EvaServ::FCT:SENT:SERV TOPIC ${DEST} :[::ZCT::TXT visuals apply ${TOPIC}];
}
proc ::EvaServ::FCT:DATA:TO:NICK { DATA } {
if { [string range ${DATA} 0 0] == 0 } {
set user [UID:CONVERT ${DATA}]
} else {
set user ${DATA}
}
return ${user};
}
proc ::EvaServ::refresh { pseudo } {
variable ::EvaServ::netadmin
variable ::EvaServ::admins
variable ::EvaServ::vhost
variable ::EvaServ::protect
variable ::EvaServ::users
set vuser [string tolower ${pseudo}]
if { [info exists vhost(${USER_LOWER})] } {
if {
[info exists protect($vhost(${USER_LOWER}))] && \
[info exists admins(${USER_LOWER})]
} {
::EvaServ::SHOW:INFO:TO:CHANLOG "Protecion du host" "$vhost(${USER_LOWER}) de ${USER_LOWER} (Désactivé)"
unset protect($vhost(${USER_LOWER}))
}
unset vhost(${USER_LOWER})
}
if { [info exists users(${USER_LOWER})] } { unset users(${USER_LOWER}) }
if { [info exists netadmin(${USER_LOWER})] } { unset netadmin(${USER_LOWER}) }
if { [info exists admins(${USER_LOWER})] } { unset admins(${USER_LOWER}) }
}
###############
# Eva Gestion #
###############
proc ::EvaServ::gestion { } {
variable ::EvaServ::config
set FILE_PIPE [open [Script:Get:Directory]/db/gestion.db w+]
puts ${FILE_PIPE} "SERVICE_BOT(channel_logs) ${::EvaServ::SERVICE_BOT(channel_logs)}"
puts ${FILE_PIPE} "config(debug) ${::EvaServ::config(debug)}"
puts ${FILE_PIPE} "config(console) ${::EvaServ::config(console)}"
puts ${FILE_PIPE} "config(protection) ${::EvaServ::config(protection)}"
puts ${FILE_PIPE} "config(login) ${::EvaServ::config(login)}"
puts ${FILE_PIPE} "config(aclient) ${::EvaServ::config(aclient)}"
close ${FILE_PIPE}
}
#TODO: mettre la liste des db en namespace parent
#TODO: personaliser les sauvegarde, quand, le nombre, et combien temps qu'on garde
proc ::EvaServ::dbback { min h d m y } {
variable ::EvaServ::config
gestion
set DB_LIST [list "gestion" "chan" "client" "close" "nick" "ident" "real" "host" "salon" "trust"]
foreach DB_NAME ${DB_LIST} {
exec cp -f [Script:Get:Directory]/db/${DB_NAME}.db [Script:Get:Directory]/db/${DB_NAME}.bak
}
if { [::EvaServ::ShowOnPartyLine 1] } {
::EvaServ::SHOW:INFO:TO:CHANLOG "Backup" "Sauvegarde des databases."
}
}
#TODO: exporter dans ZCT
proc ::EvaServ::duree { temps } {
switch -exact [lindex [ctime ${temps}] 1] {
"Jan" { set mois "01" }
"Feb" { set mois "02" }
"Mar" { set mois "03" }
"Apr" { set mois "04" }
"May" { set mois "05" }
"Jun" { set mois "06" }
"Jul" { set mois "07" }
"Aug" { set mois "08" }
"Sep" { set mois "09" }
"Oct" { set mois "10" }
"Nov" { set mois "11" }
"Dec" { set mois "12" }
}
switch -exact [lindex [ctime ${temps}] 2] {
1 { set jour "01" }
2 { set jour "02" }
3 { set jour "03" }
4 { set jour "04" }
5 { set jour "05" }
6 { set jour "06" }
7 { set jour "07" }
8 { set jour "08" }
9 { set jour "09" }
}
if { ![info exists jour] } { set jour [lindex [ctime ${temps}] 2] }
set heure [lindex [ctime ${temps}] 3]
set annee [lindex [ctime ${temps}] 4]
set seen "${jour}/${mois}/${annee} à ${heure}"
return ${seen}
}
proc ::EvaServ::ShowOnPartyLine { level } {
variable ::EvaServ::config
switch -exact ${level} {
1 {
if { ${::EvaServ::config(console)} >= 1 } { return 1 }
}
2 {
if { ${::EvaServ::config(console)} >= 2 } { return 1 }
}
3 {
if { ${::EvaServ::config(console)} >= 3 } { return 1 }
}
default { return 0 }
}
}
###########################################################
# Eva Verification de securité utilisateur a la connexion #
###########################################################
proc ::EvaServ::connexion:user:security:check { nickname hostname username gecos } {
variable ::EvaServ::config
variable ::EvaServ::trust
# default
set config(ahost) 1
set config(aident) 1
set config(areal) 1
set config(anick) 1
# Lors de l'init (connexion au irc du service) on verifie rien
if { ${::EvaServ::config(init)} == 1 } { return 0 }
# on verifie si l'host est trusted
foreach { mask num } [array get trust] {
if { [string match -nocase *${mask}* ${hostname}] } {
::EvaServ::SHOW:INFO:TO:CHANLOG "Hostname Trustée" "${mask}"
return 0
}
}
# Si l'utilisateur est proteger, on skip les verification
if { [info exists protect(${hostname})] } {
::EvaServ::SHOW:INFO:TO:CHANLOG "Security Check" "Aucune verification de sécurité sur ${hostname}, le hostname protegé"
return 0
}
set MSG_security_check ""
# Version client ?
if { ${::EvaServ::config(aclient)} == 1 } { lappend MSG_security_check "Client version: On"; } else { lappend MSG_security_check "Client version: Off"; }
# verif host?
if { ${::EvaServ::config(ahost)} == 1 } { lappend MSG_security_check "Host: On"; } else { lappend MSG_security_check "Host: Off"; }
# verif ident?
if { ${::EvaServ::config(aident)} == 1 } { lappend MSG_security_check "Ident: On"; } else { lappend MSG_security_check "Ident: Off"; }
# verif areal?
if { ${::EvaServ::config(areal)} == 1 } { lappend MSG_security_check "Realname: On"; } else { lappend MSG_security_check "Realname: Off"; }
# verif nick?
if { ${::EvaServ::config(anick)} == 1 } { lappend MSG_security_check "Nick: On"; } else { lappend MSG_security_check "Nick: Off"; }
if { [::EvaServ::ShowOnPartyLine 2] } {
::EvaServ::SHOW:INFO:TO:CHANLOG "Security Check" [join ${MSG_security_check} " | "]
}
# Version client
if { ${::EvaServ::config(aclient)} == 1 } {
::EvaServ::SENT::MSG:TO:USER ${nickname} "\001VERSION\001"
}
#TODO: ca me semble repetitif , y a surement moyen de reduire