Code: Select all
proc auth_idle {} {
global _auth authflag
set idletime 1
set chans [channels]
set chan_tot [llength $chans]
set chan_num 0
for {set loop 0} {$loop < $chan_tot} {incr loop} {
set nicks [chanlist [lindex $chans $loop] $authflag]
set nickidle 1
set nick_tot [llength $nicks]
for {set loop2 0} {$loop2 < $nick_tot} {incr loop2} {
set idletime [getchanidle [lindex $nicks $loop2] [lindex $chans $loop]]
if {$idletime >= $nickidle} {set nickidle $idletime}
if {($idletime > 60)} {
set nick [lindex $nicks $loop2]
set hand [nick2hand [lindex $nicks $loop2]]
if {[hand2idx $hand] == -1} {
putlog "$nick Idle over 60 minutes. Deauthenticated."
chattr $hand "-${authflag}"
putserv "NOTICE $nick :Idle over 60 minutes. Deauthenticated."
}
}
}
}