Language: EN FR PT ES NL DE SV RU
######################################################################
#                                                                    #
#====================================================================#
# gt-uphost.tcl by slackin                                           #
#====================================================================#
# Slackin's proper ident script!                                     #
# Custom written for #pugbot & GT                                    #
######################################################################
#                                                                    #
######################################################################
######################################################################
# Config section, please edit with                                   #
# proper info                                                        #
#--------------------------------------------------------------------#
 
#NO NEEDED FOR THIS ONE
 
#--------------------------------------------------------------------#
# End of config section                                              #
######################################################################
######################################################################
 
bind msg * "uphost" add_host_ident
bind msg * "custhost" custom_host_ident
 
proc add_host_ident {nick host hand arg} {
	set han [lindex $arg 0]
	set pass [lindex $arg 1]
	if {$han == "" || $pass == ""} {
		putserv "PRIVMSG $nick :Incorrect usage."
		putserv "PRIVMSG $nick :Proper usage: /msg GT-Support uphost <username> <password>"
	return 1
	}
 
	if {[validuser $han]} {
		if {[passwdok $han $pass]} {
			set tohost "*!*[string range $host 2 120]"
			putserv "NOTICE $nick :Updating account $han with hostmask of $tohost"
			setuser $han "HOSTS" $tohost
		} else {
			putserv "PRIVMSG $nick :Wrong password for account $han"
		}
	} else {
		putserv "PRIVMSG $nick :Did not find user account $han"
	}
}
 
proc custom_host_ident {nick host hand arg} {
	set han [lindex $arg 0]
	set pass [lindex $arg 1]
	set chhost [lindex $arg 2]
	if {$han == "" || $pass == "" || $chhost == ""} {
		putserv "PRIVMSG $nick :Incorrect usage."
		putserv "PRIVMSG $nick :Proper usage: /msg GT-Support custhost <username> <password> <host>"
	return 1
	}
 
	if {[validuser $han]} {
		if {[passwdok $han $pass]} {
			set tohost $chhost
			putserv "NOTICE $nick :Updating account $han with hostmask of $tohost"
			setuser $han "HOSTS" $tohost
		} else {
			putserv "PRIVMSG $nick :Wrong password for account $han"
		}
	} else {
		putserv "PRIVMSG $nick :Did not find user account $han"
	}
}
 
putlog "GT-uphost.tcl by slackin LOADED"