set userinfo-fields "VRAINICK ABSENCE ICQ DDN NOM EMAIL TELEPHONE VILLE PAYS AFFICHER MAIL URL ACCES ACCESCOURS LOGINX SPECIALITES ALIAS FUTUR POINTS RESPONSABLE PROJETS" set liste_binds_p "absence icq ddn nom ville mail url specialites langues alias info" set liste_binds_A "chvrainick chabsence chemail chtelephone chicq chddn chnom chville chpays chsexe chaccescours chloginx chspecialites chlangues chalias chafficher chmail churl chfutur chtaches chparrain" set liste_champs " chacces chaccescours chfichiers futur taches telephone $liste_binds_p $liste_binds_A " foreach item $liste_binds_p { bind dcc p $item dcc_setuserinfo } foreach item $liste_binds_A { bind dcc A $item dcc_chuserinfo } unset item unset liste_binds_p unset liste_binds_A bind dcc CG chacces dcc_chuserinfo bind dcc CT chaccescours dcc_chuserinfo bind dcc GT chfichiers dcc_chuserinfo bind dcc M futur dcc_setuserinfo bind dcc A taches dcc_setuserinfo bind dcc A telephone dcc_setuserinfo # This is the dcc '.' procedure. proc dcc_setuserinfo {hand idx arg} { global lastbind liste_champs if ![string match "* [string tolower $lastbind] *" $liste_champs] { aux_poubelles $hand $idx $arg return 0 } set userinfo [string toupper $lastbind] set arg [cleanarg $arg] if {$arg != ""} { if {[string tolower $arg] == "-"} { putdcc $idx "Ligne d'info $userinfo retiree." if {$userinfo == "INFO"} { setuser $hand info "" } else { setuser $hand XTRA $userinfo "" } } { ### Les cas particuliers ### set info $arg set who $hand switch $userinfo { "ICQ" { if [estunnombre:ok $info] { putdcc $idx "Maintenant: $info" setuser $who XTRA $userinfo "$info" putcmdlog "Ligne $userinfo de $who changee pour \"$info\" par $hand" } else { putdcc $idx "Ce n'est pas un UIN valide. (Ne pas ajouter de symbole en plus du nombre)" return 0 } } "ALIAS" { if {[llength $info] > 4} { putdcc $idx "Tout doux là avec le nombre d'alias..." return 0 } foreach alias [split $info] { if ![estunnick:ok $alias] { putdcc $idx "$alias n'est pas un alias valide." return 0 } } putdcc $idx "Maintenant: $info" setuser $who XTRA $userinfo "$info" putcmdlog "Ligne $userinfo de $who changee pour \"$info\" par $hand" } "DDN" { if {[getuser $who xtra ddn] != ""} { putdcc $idx "Ta date de naissance ne peut pas être changée une fois mise en place." putdcc $idx "Au besoin, vois un admin pour qu'il te la rechange, merci." return 0 } elseif [estunedate:ok $info] { putdcc $idx "Maintenant: $info" setuser $who XTRA $userinfo [dire_date70 $info] putcmdlog "Ligne $userinfo de $who changee pour \"$info\" par $hand" } else { putdcc $idx "Ce n'est pas une date valide." return 0 } } "MAIL" { if [estunmail:ok $info] { putdcc $idx "Maintenant: $info" setuser $who XTRA $userinfo "$info" putcmdlog "Ligne $userinfo de $who changee pour \"$info\" par $hand" } else { putdcc $idx "Ce n'est pas un mail valide." return 0 } } "URL" { if [estunurl:ok $info] { putdcc $idx "Maintenant: http://$info" setuser $who XTRA $userinfo "http://$info" putcmdlog "Ligne $userinfo de $who changee pour \"http://$info\" par $hand" } else { putdcc $idx "Ce n'est pas un URL valide. (Ne pas inclure le 'http://')" return 0 } } "FUTUR" { set info [string tolower $info] if {$info == "op"} { if {([expr [unixtime] - [getuser $who xtra prom]] > 4233600) || ([expr [unixtime] - [getuser $who xtra date]] > 12960000)} { putdcc $idx "Maintenant: activé." setuser $who XTRA $userinfo "1" putcmdlog "Ligne $userinfo de $who pour devenir Op activée par $hand" } else { putdcc $idx "Tu n'auras le droit de mettre en action cette option qu`après 7 semaines comme membre officiel." return 0 } } else { putdcc $idx "Ce n'est pas un choix valide" return 0 } } "INFO" { putdcc $idx "Maintenant: $info" setuser $who INFO "[string range $arg 0 159]" } default { putdcc $idx "Maintenant: $info" setuser $who XTRA $userinfo "[string range $arg 0 159]" } } } } { if {(([getuser $hand XTRA $userinfo] == "") & ($userinfo != "INFO")) | (($userinfo == "INFO") & ([getuser $hand info] == ""))} { putdcc $idx "Vous n'avez pas de ligne $userinfo ." } { if {$userinfo == "DDN"} { putdcc $idx "Maintenant: [dire_date [getuser $hand XTRA $userinfo]]" } elseif {$userinfo == "INFO"} { putdcc $idx "Maintenant: [getuser $hand info]" } else { putdcc $idx "Maintenant: [getuser $hand XTRA $userinfo]" } } } return 1 } bind dcc p afficher dcc_afficher proc dcc_afficher {hand idx args} { set args [lindex $args 0] set action [lindex $args 0] set quoi [string tolower [lrange $args 1 end]] if {($action == "+") | ($action == "-")} { set modif "" foreach dif $quoi { if [string match "* $dif *" " icq nom ville photo mail "] { lappend modif $dif } } if {$action == "+"} { set affichage $modif } foreach actuel [getuser $hand xtra afficher] { if ![string match "* $actuel *" " $modif "] { lappend affichage $actuel } } setuser $hand xtra afficher $affichage putdcc $idx "Tu affiches maintenant ceci: $affichage" return 1 } else { putdcc $idx "## Syntaxe: .afficher <+|-> \[icq\] \[nom\] \[ville\] \[photo\] \[mail\]" return 0 } } # This is the DCC `.ch' procedure proc dcc_chuserinfo {hand idx arg} { global lastbind liste_champs if ![string match "* [string tolower $lastbind] *" $liste_champs] { aux_poubelles $hand $idx $arg return 0 } set userinfo [string toupper [string range $lastbind 2 end]] set arg [cleanarg $arg] if {[llength $arg] < 1} { putdcc $idx "syntaxe: .ch[string tolower $userinfo] \[<[string tolower $userinfo]>|-\]" return 0 } set who [lindex $arg 0] if {![validuser $who]} { putdcc $idx "$who n'est pas un usager valide." return 0 } if {[llength $arg] == 1} { set info "" } { set info [string range $arg [expr [string length $who] + 1] 159] } if {$info != ""} { if {[string tolower $info] == "-"} { putdcc $idx "Ligne $userinfo de $who retiree." setuser $who XTRA $userinfo "" putcmdlog "Ligne $userinfo de $who retiree par $hand" } { if {[matchattr $who m] & ![matchattr $hand m]} { putdcc $idx "Pas touche à ça toi!" return 0 } ### Les cas particuliers ### switch $userinfo { "VRAINICK" { if [estunnick:ok $info] { putdcc $idx "Maintenant: $info" setuser $who XTRA $userinfo "$info" putcmdlog "Ligne $userinfo de $who changee pour \"$info\" par $hand" } else { putdcc $idx "Ce n'est pas un alias valide." return 0 } } "ACCES" { if [estunnombre:ok $info] { if {[getuser $hand xtra acces] > $info} { putdcc $idx "Maintenant: $info" modaccesw $who $info putcmdlog "Ligne $userinfo de $who changee pour \"$info\" par $hand" } else { putdcc $idx "Heu, je ne peux pas: il a un accès plus grand ou égal au tiens!" return 0 } } else { putdcc $idx "Ce n'est pas un accès valide." return 0 } } "ACCESCOURS" { if [estunnombre:ok $info] { if {[getuser $hand xtra accescours] > $info} { putdcc $idx "Maintenant: $info" # setuser $who XTRA $userinfo "$info" modacceswcours $who $info putcmdlog "Ligne $userinfo de $who changee pour \"$info\" par $hand" } else { putdcc $idx "Heu, je ne peux pas: il a un accès plus grand ou égal au tiens!" return 0 } } else { putdcc $idx "Ce n'est pas un accès valide." return 0 } } "ICQ" { if [estunnombre:ok $info] { putdcc $idx "Maintenant: $info" setuser $who XTRA $userinfo "$info" putcmdlog "Ligne $userinfo de $who changee pour \"$info\" par $hand" } else { putdcc $idx "Ce n'est pas un UIN valide. (Ne pas ajouter de symbole en plus du nombre)" return 0 } } "ALIAS" { if {[llength $info] > 4} { putdcc $idx "Tout doux là avec le nombre d'alias..." return 0 } foreach alias [split $info] { if ![estunnick:ok $alias] { putdcc $idx "$alias n'est pas un alias valide." return 0 } } putdcc $idx "Maintenant: $info" setuser $who XTRA $userinfo "$info" putcmdlog "Ligne $userinfo de $who changee pour \"$info\" par $hand" } "DDN" { if [estunedate:ok $info] { putdcc $idx "Maintenant: $info" setuser $who XTRA $userinfo [dire_date70 $info] putcmdlog "Ligne $userinfo de $who changee pour \"$info\" par $hand" } else { putdcc $idx "Ce n'est pas une date valide." return 0 } } "MAIL" { if [estunmail:ok $info] { putdcc $idx "Maintenant: $info" setuser $who XTRA $userinfo "$info" putcmdlog "Ligne $userinfo de $who changee pour \"$info\" par $hand" } else { putdcc $idx "Ce n'est pas un mail valide." return 0 } } "EMAIL" { if [estunmail:ok $info] { putdcc $idx "Maintenant: $info" setuser $who XTRA $userinfo "$info" putcmdlog "Ligne $userinfo de $who changee pour \"$info\" par $hand" } else { putdcc $idx "Ce n'est pas un mail valide." return 0 } } "PAYS" { if [estunpays:ok $info] { putdcc $idx "Maintenant: $info" setuser $who XTRA $userinfo "$info" putcmdlog "Ligne $userinfo de $who changee pour \"$info\" par $hand" } else { putdcc $idx "Ce n'est pas un pays valide. En cas de problème, communiquez avec Alocin." return 0 } } "URL" { if [estunurl:ok $info] { putdcc $idx "Maintenant: http://$info" setuser $who XTRA $userinfo "http://$info" putcmdlog "Ligne $userinfo de $who changee pour \"http://$info\" par $hand" } else { putdcc $idx "Ce n'est pas un URL valide. (Ne pas inclure le 'http://')" return 0 } } "FUTUR" { set info [string tolower $info] if ![matchattr $who M] { putdcc $idx "Ce membre ne peut avoir cette option activée..." return 0 } if {$info == "op"} { putdcc $idx "Maintenant: activé." setuser $who XTRA $userinfo "1" putcmdlog "Ligne $userinfo de $who pour devenir Op activée par $hand" } else { putdcc $idx "Ce n'est pas un choix valide" return 0 } } "SEXE" { set info [string toupper $info] if {$info == "H"} { putdcc $idx "Maintenant: Homme." setuser $who XTRA $userinfo "H" putcmdlog "Ligne $userinfo de $who changée pour Homme par $hand" } elseif {$info == "F"} { putdcc $idx "Maintenant: Femme." setuser $who XTRA $userinfo "F" putcmdlog "Ligne $userinfo de $who changée pour Femme par $hand" } else { putdcc $idx "Ce n'est pas un choix valide" return 0 } } "AFFICHER" { set info [string tolower $info] foreach mot [split $info] { if ![string match *$mot* "icq nom ville photo mail"] { putdcc $idx "$mot n'est pas une valeur acceptable pour l'affichage." return 0 } } putdcc $idx "Maintenant: $info" setuser $who XTRA $userinfo "$info" putcmdlog "Ligne $userinfo de $who changee pour \"$info\" par $hand" } "LOGINX" { set info [lindex $info 0] putdcc $idx "Maintenant: $info" setuser $who XTRA $userinfo "$info" putcmdlog "Ligne $userinfo de $who changee pour \"$info\" par $hand" set lacces [getuser $who xtra acces] if {$lacces == ""} { set lacces 0 } if {$lacces > 24} { putbot Aide "auth #aide" modaccesw $who $lacces } set laccescours [getuser $who xtra accescours] if {$laccescours == ""} { set laccescours 0 } if {$laccescours > 24} { putbot Aide "auth #cours" modacceswcours $who $laccescours } } default { putdcc $idx "Maintenant: $info" setuser $who XTRA $userinfo "$info" putcmdlog "Ligne $userinfo de $who changee pour \"$info\" par $hand" } } } } { if {[getuser $who xtra $userinfo] == ""} { putdcc $idx "$who n'a pas de ligne $userinfo ." } { if {$userinfo == "DDN"} { putdcc $idx "Maintenant: [dire_date [getuser $who XTRA $userinfo]]" } else { putdcc $idx "Maintenant: [getuser $who XTRA $userinfo]" } } } return 0 } proc cleanarg {arg} { set response "" for {set i 0} {$i < [string length $arg]} {incr i} { set char [string index $arg $i] if {($char != "\12") && ($char != "\15")} { append response $char } } return $response } bind dcc - w mon_whois bind dcc - whois mon_whois proc mon_whois {hand idx qui} { if {![validuser $qui]} { putdcc $idx "$qui n'est pas un usager valide." return 0 } if {![matchattr $qui AGCTOJKMNVRPHXYZ]} { putdcc $idx "$qui n'est pas un usager valide." return 0 } putdcc $idx " *** WHOIS $qui ***" putdcc $idx "+------------------------------------------------------------+" if [matchattr $qui AGTCOJRPMHXY] { set temp "Informations sur $qui ([getuser $qui xtra vrainick])" set temp "[ajouter_espaces $temp 46] \[[dire_date [getuser $qui xtra date]]\]" putdcc_whois $idx $temp putdcc_whois $idx "Alias: [getuser $qui xtra alias]" set temp "Niveau: [dire_niveau $qui]" set temp "[ajouter_espaces $temp 46] \[[dire_date [getuser $qui xtra prom]]\]" putdcc_whois $idx $temp set projets "" foreach unproj [getuser $qui xtra responsable] { append projets "$unproj (Resp), " } foreach unproj [getuser $qui xtra adjoint] { append projets "$unproj (Adj), " } foreach unproj [getuser $qui xtra participant] { append projets "$unproj (Part), " } if {$projets != ""} { putdcc_whois $idx "Projet(s): [string range $projets 0 [expr [string length $projets] - 3]]." } if {[getuser $qui xtra parrain] != ""} { if ![estunnombre:ok [getuser $qui xtra parrain]] { putdcc $idx "+------------------------------------------------------------+" putdcc_whois $idx "Parrain: [getuser $qui xtra parrain]" } else { putdcc_whois $idx "Mandat actuel de parrain ayant débuté le: \[[dire_date [getuser $qui xtra parrain]]\]" } } putdcc $idx "+------------------------------------------------------------+" if {[matchattr $hand A] && [matchattr $qui S]} { putdcc_whois $idx "14Suspendu: [getuser $qui xtra susp_debut]" putdcc_whois $idx "14 Par [getuser $qui xtra susp_auteur] pour [getuser $qui xtra susp_duree] heure(s)." putdcc_whois $idx "14 Raison: [getuser $qui xtra susp_raison]" putdcc_whois $idx "14 Temps restant: [getuser $qui xtra susp_reste] heure(s)." putdcc $idx "+------------------------------------------------------------+" } if {[matchattr $hand A] && [matchattr $qui L]} { putdcc_whois $idx "14Note pour admins ([lindex [getuser $qui xtra avertir] 1]) en date du [dire_date [lindex [getuser $qui xtra avertir] 0]]:" putdcc_whois $idx "14 -> [lrange [getuser $qui xtra avertir] 2 end]" putdcc $idx "+------------------------------------------------------------+" } if {[matchattr $hand A] && [matchattr $qui XY]} { if [matchattr $qui X] { putdcc_whois $idx "14Fiche désactivée: \[Départ volontaire\]" } else { putdcc_whois $idx "14Fiche désactivée: \[Départ forcé \]" } putdcc_whois $idx "14 Départ: [getuser $qui xtra DEPART]." putdcc $idx "+------------------------------------------------------------+" } if {[getuser $qui xtra absence] != ""} { putdcc_whois $idx "Absent: [getuser $qui xtra absence]" putdcc $idx "+------------------------------------------------------------+" } set temp "Nom: " if {[string match *nom* [getuser $qui xtra afficher]] && ([getuser $qui xtra nom] != "")} { append temp [getuser $qui xtra nom] } elseif {([matchattr $hand A] || ([string tolower $hand] == [string tolower $qui])) && ([getuser $qui xtra nom] != "")} { append temp "14[getuser $qui xtra nom]" } else { append temp "-" } set temp [ajouter_espaces $temp 36] append temp "([getuser $qui xtra sexe])" set temp [ajouter_espaces $temp 40] append temp "DDN: " set temp2 [getuser $qui xtra ddn] if {$temp2 != ""} { append temp [dire_date $temp2] } else { append temp "-" } putdcc_whois $idx $temp if {[file exists /aide/www/photos/[getuser $qui xtra vrainick].jpg] && [string match *photo* [getuser $qui xtra afficher]]} { putdcc_whois $idx "Photo: http://www.aide.igt.net/photos/[getuser $qui xtra vrainick].jpg" } elseif {([matchattr $hand A] || ([string tolower $hand] == [string tolower $qui])) && [file exists /aide/www/photos/[getuser $qui xtra vrainick].jpg]} { putdcc_whois $idx "Photo: 14http://www.aide.igt.net/photos/[getuser $qui xtra vrainick].jpg" } set temp "Mail: " if {[string match *mail* [getuser $qui xtra afficher]] && ([getuser $qui xtra mail] != "")} { append temp [getuser $qui xtra mail] } elseif {([matchattr $hand A] || ([string tolower $hand] == [string tolower $qui])) && ([getuser $qui xtra mail] != "")} { append temp "14[getuser $qui xtra mail]" } else { append temp "-" } set temp [ajouter_espaces $temp 40] append temp "ICQ: " if {[string match *icq* [getuser $qui xtra afficher]] && ([getuser $qui xtra icq] != "")} { append temp "#[getuser $qui xtra icq]" } elseif {([matchattr $hand A] || ([string tolower $hand] == [string tolower $qui])) && ([getuser $qui xtra icq] != "")} { append temp "14[getuser $qui xtra icq]" } else { append temp "-" } putdcc_whois $idx $temp if {[getuser $qui xtra url] != ""} { putdcc_whois $idx "URL: [getuser $qui xtra url]" } else { putdcc_whois $idx "URL: -" } set temp "Origine (pays): [getuser $qui xtra pays] " set temp "[ajouter_espaces $temp 29] Ville: " if {[string match *ville* [getuser $qui xtra afficher]] && ([getuser $qui xtra ville] != "")} { append temp [getuser $qui xtra ville] } elseif {([matchattr $hand A] || ([string tolower $hand] == [string tolower $qui])) && ([getuser $qui xtra ville] != "")} { append temp "14[getuser $qui xtra ville]" } else { append temp "-" } putdcc_whois $idx $temp putdcc_whois $idx "-> [getuser $qui info]" putdcc $idx "+------------------------------------------------------------+" putdcc_whois $idx "Spécialités: [getuser $qui xtra specialites]" putdcc_whois $idx "Langues (écrites!): [getuser $qui xtra langues]" if {[matchattr $hand A] || ($hand == $qui)} { putdcc_whois $idx "Accueil: [getchaninfo $qui #Aide]" } if {[getuser $qui xtra acces] > 0} { putdcc_whois $idx "Accès X #Aide: [getuser $qui xtra acces]" } if {[getuser $qui xtra accescours] > 0} { putdcc_whois $idx "Accès X #Cours: [getuser $qui xtra accescours]" } if {([getuser $qui xtra futur] == "op") && ([matchattr $hand A] || ([string tolower $hand] == [string tolower $qui]))} { putdcc_whois $idx "14* Aimerait devenir Op *" } } else { if [matchattr $qui V] { set laliste " -> " foreach item [getuser $qui xtra plusv] { append laliste "[lindex $item 0] (x[lindex $item 1]), " } set temp [ajouter_espaces "Date du premier +v enregistré:" 46] putdcc_whois $idx "$temp \[[dire_date [getuser $qui xtra created]]\]" putdcc_whois $idx "Voici les gens qui lui ont donné le +v à date:" putdcc_whois $idx $laliste putdcc_whois $idx "Temps +v total: [expr [getuser $qui xtra statsplusoncanal] / 60] heure(s)" putdcc $idx "+------------------------------------------------------------+" set laliste "" foreach item [getuser $qui xtra props] { append laliste "$item " } set temp [ajouter_espaces "L'ont officiellement proposé: [llength $laliste] personne(s)." 46] if {[getuser $qui xtra premiereprop] != ""} { append temp "\[[dire_date [getuser $qui xtra premiereprop]]\]" } putdcc_whois $idx $temp if [matchattr $hand A] { putdcc_whois $idx "14 -> $laliste\" } } elseif [matchattr $qui N] { set temp "Informations sur $qui ([getuser $qui xtra vrainick])" set temp "[ajouter_espaces $temp 46] \[[dire_date [getuser $qui xtra date]]\]" putdcc_whois $idx $temp set temp "Niveau: [dire_niveau $qui]" set temp "[ajouter_espaces $temp 46] \[[dire_date [getuser $qui xtra prom]]\]" putdcc_whois $idx $temp putdcc $idx "+------------------------------------------------------------+" if {[getuser $qui xtra absence] != ""} { putdcc_whois $idx "Absent: [getuser $qui xtra absence]" putdcc $idx "+------------------------------------------------------------+" } putdcc_whois $idx "Temps +v depuis la promotion: [expr [getuser $qui xtra statsplusoncanal] / 60] heure(s)" putdcc $idx "+------------------------------------------------------------+" putdcc_whois $idx " Date de début de l'évaluation: [dire_date [expr [getuser $qui xtra date] + 864000]]" putdcc_whois $idx " Nombre d'évaluation enregistrées: [llength [getuser $qui xtra EVAL]]" if [matchattr $hand A] { if {[llength [getuser $qui xtra EVAL]] > 4} { set eval 0 foreach item [getuser $qui xtra EVAL] { set eval [expr $eval + [lindex $item 1]] } set eval [expr 20.0 * $eval / [llength [getuser $qui xtra EVAL]]] set eval "[string range $eval 0 3]\%" putdcc_whois $idx "14-> Évaluation (à date) du nouveau: $eval\" } else { putdcc_whois $idx "14-> Évaluation (à date) du nouveau: Non concluante" } } } elseif [matchattr $qui Z] { set temp "Informations sur $qui ([getuser $qui xtra vrainick])" set temp "[ajouter_espaces $temp 46] \[[dire_date [getuser $qui xtra created]]\]" putdcc_whois $idx $temp set temp "Accès spécial: [getuser $qui xtra special]" putdcc_whois $idx $temp putdcc $idx "+------------------------------------------------------------+" putdcc_whois $idx "Temps sur le canal (authentifié): [dire_delai [expr [getuser $qui xtra statsplusoncanal] * 60]]" putdcc_whois $idx "Temps sur le canal (non-authentifié): [dire_delai [expr [expr [getuser $qui xtra statsoncanal] - [getuser $qui xtra statsplusoncanal]] * 60]]" } } if {[getuser $qui xtra public] != ""} { putdcc $idx "+------------------------------------------------------------+" putdcc $idx "| REMARQUE des Admins : |" putdcc $idx "| [lrange [getuser $qui xtra public] 2 end]" } putdcc $idx "+------------------------------------------------------------+" return 1 } proc putdcc_whois {idx text} { set text "| $text" set text [ajouter_espaces $text 60] set text "$text |" putdcc $idx $text } ### # .hosts bind dcc p hosts dcc_hosts proc dcc_hosts {hand idx arg} { putdcc $idx "Voici les masques d'adresse par lesquels je vous reconnais sur IRC -> [getuser $hand hosts]" return 1 }