X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2FModules%2FRootWarn.pl;h=5c2cf62d9680e4ff6196698eeba442010dcc55ab;hb=34a4d11667b0a734343f82d2adbaac23f738ad18;hp=835c605d47493911c2c6bd7d14aaa7aa915f5573;hpb=92c3870d1fd6aa5f063a57cfb690aea12ec77df7;p=infobot.git diff --git a/src/Modules/RootWarn.pl b/src/Modules/RootWarn.pl index 835c605..5c2cf62 100644 --- a/src/Modules/RootWarn.pl +++ b/src/Modules/RootWarn.pl @@ -50,17 +50,14 @@ sub rootWarn { $attempt++; ### TODO: OPTIMIZE THIS. # ok... don't record the attempt if nick==root. - if (1 and $nick ne "root") { # old - &dbSet("rootwarn", { nick => lc($nick) }, { attempt => $attempt }); - &dbSet("rootwarn", { nick => lc($nick) }, { time => time() }); - &dbSet("rootwarn", { nick => lc($nick) }, { host => $user."\@".$host }); - &dbSet("rootwarn", { nick => lc($nick) }, { channel => $chan }); - } else { # new. replace. TODO - &dbSet("rootwarn", "nick", lc($nick), "attempt", $attempt); - &dbSet("rootwarn", "nick", lc($nick), "time", time()); - &dbSet("rootwarn", "nick", lc($nick), "host", $user."\@".$host); - &dbSet("rootwarn", "nick", lc($nick), "channel", $chan); - } + return if ($nick eq "root"); + + &dbSet("rootwarn", { nick => lc($nick) }, { + attempt => $attempt, + time => time(), + host => $user."\@".$host, + channel => $chan, + } ); return; } @@ -80,8 +77,8 @@ sub CmdrootWarn { $reply = "there ".&fixPlural("has",$count) ." been \002$count\002 ". &fixPlural("rooter",$count) ." warned about root."; - if ($param{'DBType'} !~ /^mysql$/i) { - &FIXME("rootwarn does not yet support non-mysql."); + if ($param{'DBType'} !~ /^(pg|my)sql$/i) { + &FIXME("rootwarn does not yet support non-{my,pg}sql."); return; }