set host chiark
set port 6667
if {![info exists nick]} { set nick Blight }
+if {![info exists ownfullname]} { set ownfullname "here to Help" }
set ownmailaddr blight@chiark.greenend.org.uk
-set ownfullname "here to Help"
if {![info exists globalsecret]} {
set gsfile [open /dev/urandom r]
}
}
+proc userdb_exists {n} {
+
+ binary scan [irctolower $n] H* nhex
+ return [file exists users/$nhex]
+}
+
+proc md5sum {value} { exec md5sum << $value }
+
+# proc userdb_store {n args} { }
+
def_ucmd newuser {
global ownmailaddr ownfullname nick globalsecret
prefix_nick
if {[ischan $dest]} {
error "You must register privately."
}
- binary scan [irctolower $n] H* nhex
- if {[file exists users/$nhex]} {
+ if {[userdb_exists $n]} {
error "You (or someone else) have already registered the nick $n."
}
set ownermail [ta_word]
set kmod [expr {$ksecs % $mult}]
if {[string length $text]} {
- if {![regexp -nocase {^([0-5])([0-9a-f]+)$} $text pass_sup kmod]} {
+ if {![regexp -nocase {^([0-5])[0-9a-f]+\s+(.*)$} $text pass_sup kmod text]} {
+ error ...
}
set ksecs [expr {(($ksecs - $kmod) / $mult) * 6 + $kmod}]
}
- set tohash "$ksecs\n$ownermail\n"
- set hash [exec md5sum << $tohash]
+ set hash [md5sum "$ksecs\n$ownermail\n"]
set passwd "$kmod[string range $hash 0 15]"
if {[info exists pass_sup]} {
if {"$passwd" != "$pass_sup"} {
error "Incorrect registration password."
}
+ userdb_store $n \
+
sendaction $n "ignores your ok"
} else {
set mailmsg \