X-Git-Url: https://iankelling.org/git/?p=iankelling.org;a=blobdiff_plain;f=_site%2Fcgi%2Fcomment;h=4b14c3c7c7bd9c3dfa9337a8494656913f662917;hp=b1e8796607706a844cf9a33ecf1a46500acfebec;hb=e02cd51eb9c9ac3f84a84fefd567d7217e34bc38;hpb=daefd301f9bdc0df7b7f4d77ca249291e9388d9b diff --git a/_site/cgi/comment b/_site/cgi/comment index b1e8796..4b14c3c 100755 --- a/_site/cgi/comment +++ b/_site/cgi/comment @@ -292,20 +292,27 @@ state != 'rate_limited' and state != 'suspect' SQL +$db.execute('insert into c values (NULL, ?, ?, ?, ?, ?)', + [state, + IP, + NOW, + GOTO, + COMMENT_TXT]) if date new_count = $db.execute(query + 'and date > ?',date) else new_count = $db.execute(query) end +new_count = new_count[0][0] if new_count == 1 require 'net/smtp' def send_email(opts={}) - opts[:to] ||= ENV['USER'] + opts[:to] ||= 'root' opts[:server] ||= 'localhost' - opts[:from] ||= ENV['USER'] - opts[:from_alias] ||= ENV['USER'] + opts[:from] ||= 'root' + opts[:from_alias] ||= 'root' opts[:subject] ||= "test subject" opts[:body] ||= "" @@ -324,13 +331,6 @@ END_OF_MESSAGE send_email :subject => 'new comments on iankelling.org' end -$db.execute('insert into c values (NULL, ?, ?, ?, ?, ?)', - [state, - IP, - NOW, - GOTO, - COMMENT_TXT]) - post(md_file) redir