Commit Diff
Diff:
ce48a8f1f286ad3e7f4fc09fd6f2a6d6d532a124
868dbc0be4d252f2cd0c3ae0c202edd34891f101
Commit:
868dbc0be4d252f2cd0c3ae0c202edd34891f101
Tree:
86599882848702c7f8f1058ab438c31f773c0190
Author:
jrmu <jrmu@ircnow.org>
Committer:
jrmu <jrmu@ircnow.org>
Date:
Fri Dec 25 13:01:11 2020 UTC
Message:
Temporary bug fix
blob - 64131af7a0527d40071b23b511f9aabe78c85fcb
blob + 020d5a5d3fc27924381a7b2d43e4f252cb1d1f01
--- BNC.pm
+++ BNC.pm
@@ -42,9 +42,16 @@ use constant {
};
`doas chmod g+r /home/znc/home/znc/.znc/configs/znc.conf`;
-`doas chown znc:daemon /home/znc/home/znc/.znc/configs/znc.conf`;
+`doas chown -R znc:daemon /home/znc/home/znc/.znc/`;
my @zncconf = main::readarray($zncconfpath);
-$znctree = parseml($znctree, @zncconf);
+$znctree;
+my @users;
+foreach my $line (@zncconf) {
+ if ($line =~ /<User (.*)>/) {
+ push(@users, $1);
+ }
+}
+#$znctree = parseml($znctree, @zncconf);
main::cbind("pub", "-", "bnc", \&mbnc);
main::cbind("msg", "-", "bnc", \&mbnc);
main::cbind("msg", "-", "regex", \&mregex);
@@ -202,7 +209,7 @@ sub mbnc {
return;
} elsif ($text =~ /^([[:alnum:]]+)\s+([[:ascii:]]+)/) {
my ($username, $email) = ($1, $2);
- my @users = treeget($znctree, "User", "Node");
+# my @users = treeget($znctree, "User", "Node");
foreach my $user (@users) {
if ($user eq $username) {
main::putserv($bot, "PRIVMSG $nick :Sorry, username taken. Please contact staff if you need help.");
@@ -451,7 +458,7 @@ sub mlastseen {
} else { $text = $args[0]; }
my $hostmask = "$nick!$host";
if (!@logs) { loadlog(); }
- my @users = treeget($znctree, "User", "Node");
+# my @users = treeget($znctree, "User", "Node");
foreach my $user (@users) {
my @lines = grep(/^\[\d{4}-\d\d-\d\d \d\d:\d\d:\d\d\] \[$user\] connected to ZNC from [.0-9a-fA-F:]+/, @logs);
if (scalar(@lines) == 0) {