Code: Select all
set pass "[lindex $arg 1]"
if {$hand == "*"} {
putserv "privmsg $nick :You are not permitted to use my commands."
return 0
Code: Select all
set pass "[lindex $arg 0]"
if {$hand == "*"} {
putserv "privmsg $nick :You are not permitted to use my commands."
return 0
Code: Select all
#Usage: /msg $botnick auth <password>
proc auth:auth {nick uhost hand arg} {
global botnick
set found 0
foreach n [channels] {
if {[onchan $nick $n]} {
set found 1
}
}
if {$found == 0} {
return 0
}
if {[llength $arg] < 1} {
putserv "notice $nick :Usage: /msg $botnick auth <pass>"
return 0
}
set pass "[lindex $arg 0]"
if {$hand == "*"} {
putserv "privmsg $nick :You are not permitted to use my commands."
return 0
}
if {[getuser $hand XTRA AUTH] == "DEAD"} {
putserv "privmsg $nick :Sorry, but you have been disabled from using my commands."
return 0
}
if {[passwdok $hand $pass]} {
setuser $hand XTRA "AUTH" "1"
putcmdlog "<<$nick>> ($uhost) !$hand! Authenticated"
putserv "notice $nick :Password accepted."
return 0
} else {
putserv "notice $nick :Password denied."
}
}
proc auth:signcheck {nick uhost hand chan reason} {
if {$hand == "*"} {
return 0
}
set auth "[getuser $hand XTRA "AUTH"]"
if {($auth == "") || ($auth == "0") || ($auth == "DEAD")} {
return 0
}
setuser $hand XTRA "AUTH" "0"
putlog "Auth for $nick has been expired."
}
proc auth:check {hand} {
set auth "[getuser $hand XTRA "AUTH"]"
if {($auth == "") || ($auth == "0") || ($auth == "DEAD")} {
return 0
} else {
return 1
}
}
proc auth:deauth {nick uhost hand arg} {
if {[getuser $hand XTRA AUTH] == "DEAD"} {
putserv "privmsg $nick :Sorry, but you have been disabled from using my commands."
return 0
}
if {$hand != "*"} {
setuser $hand XTRA "AUTH" "0"
putlog "<<$nick>> ($uhost) !$hand! De-authenticated"
putserv "notice $nick :Authentication has been removed."
}
}