Commit Diff
Diff:
63a165441f2a3d579246328095b487c7add432ca
eea90820a6f32511908a6e1bd497f976a5d669ab
Commit:
eea90820a6f32511908a6e1bd497f976a5d669ab
Tree:
0a146561d51af15d7d8206c4b8a98c97d2291413
Author:
jrmu <jrmu@ircnow.org>
Committer:
jrmu <jrmu@ircnow.org>
Date:
Sun Feb 26 02:51:05 2023 UTC
Message:
fix rows bug and also puts date back into botnow
blob - cb94e28890b7f9467466bbd5bba414a51fab2932
blob + 320f8281230c2a274f36c53e034ae8054d802112
--- BNC.pm
+++ BNC.pm
@@ -6,6 +6,7 @@ use strict;
use warnings;
use OpenBSD::Pledge;
use OpenBSD::Unveil;
+use Digest::SHA qw(sha256_hex);
use lib './';
require "SQLite.pm";
require "Hash.pm";
@@ -163,7 +164,8 @@ sub mbnc {
my ($username, $email) = ($1, $2);
my @userrows = SQLite::selectrows("bnc", "username", $username);
my @emailrows = SQLite::selectrows("bnc", "email", $email);
- foreach my $row (push(@userrows,@emailrows)) {
+ my @rows = push(@userrows, @emailrows);
+ foreach my $row (@rows) {
my $password = SQLite::get("bnc", "ircid", $row->{id}, "password");
if (defined($password)) {
main::putserv($bot, "PRIVMSG $nick :Sorry, only one account per person. Please contact staff if you need help.");
blob - 920b01ae92fc73d0c4b9232d27557c790269a38e
blob + 5f975bc20b60739da562c37e93b5bb2017d38587
--- DNS.pm
+++ DNS.pm
@@ -159,13 +159,6 @@ sub delrdns {
return setrdns($ip6, $subnet);
}
-# Returns date in YYYYMMDD format
-sub date {
- my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
- my $localtime = sprintf("%04d%02d%02d", $year+1900, $mon+1, $mday);
- return $localtime;
-}
-
# given $origin. create $name RR of $type and set to $value if provided;
# if $value is missing, delete $domain
# returns true upon success, false upon failure
blob - d4c0ecc478325335d938ca3342ee57780e3cb67e
blob + 190fbcb438fb6cbacbcae6cd04c72233e1a835d0
--- botnow
+++ botnow
@@ -51,6 +51,13 @@ sub gettime {
return $localtime;
}
+# Returns date in YYYYMMDD format
+sub date {
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
+ my $localtime = sprintf("%04d%02d%02d", $year+1900, $mon+1, $mday);
+ return $localtime;
+}
+
# Path to configuration file
my $confpath = "botnow.conf";
IRCNow