Blame
Date:
Sun Oct 8 22:28:02 2023 UTC
Message:
Now prevents creating accounts that exist in database with a password
01
2021-12-17
jrmu
#!/usr/bin/perl
02
2021-12-17
jrmu
03
2021-12-17
jrmu
package Help;
04
2021-12-17
jrmu
05
2021-12-17
jrmu
use strict;
06
2021-12-17
jrmu
use warnings;
07
2021-12-17
jrmu
use OpenBSD::Pledge;
08
2021-12-17
jrmu
use OpenBSD::Unveil;
09
2021-12-17
jrmu
10
2021-12-17
jrmu
my %conf = %main::conf;
11
2021-12-17
jrmu
my $chans = $conf{chans};
12
2021-12-17
jrmu
my $teamchans = $conf{teamchans};
13
2021-12-17
jrmu
my @teamchans = split /[,\s]+/m, $teamchans;
14
2021-12-17
jrmu
my $staff = $conf{staff};
15
2021-12-17
jrmu
my $terms = $conf{terms};
16
2021-12-17
jrmu
my $time = "600";
17
2021-12-17
jrmu
main::cbind("pub", "-", "help", \&help);
18
2021-12-17
jrmu
main::cbind("msg", "-", "help", \&help);
19
2021-12-17
jrmu
main::cbind("pub", "-", "request", \&help);
20
2021-12-17
jrmu
21
2021-12-17
jrmu
sub init {
22
2021-12-17
jrmu
}
23
2021-12-17
jrmu
24
2021-12-17
jrmu
sub help {
25
2021-12-17
jrmu
my ($bot, $nick, $host, $hand, @args) = @_;
26
2021-12-17
jrmu
my ($chan, $text);
27
2023-05-06
jrmu
my $mod_msgs= {
28
2023-05-06
jrmu
BNC => "To request a free bouncer, type !bnc <username> <email>. For example, !bnc john john\@example.com.",
29
2023-05-06
jrmu
Shell => "To request a free shell account, type !shell <username> <email>. For example, !shell john john\@example.com.)",
30
2023-05-06
jrmu
Mail => "To request a free email account, type !mail <username> <email>. For example, !mail john john\@example.com.)",
31
2023-05-06
jrmu
VPN => "To request a free VPN account, type !vpn <username> <email>. For example, !vpn john john\@example.com.)"
32
2023-05-06
jrmu
};
33
2023-05-06
jrmu
my $msg = $terms."\n";
34
2023-05-06
jrmu
for my $mod (split ' ',$conf{modules}) {
35
2023-05-06
jrmu
if (exists $mod_msgs->{$mod}) {
36
2023-05-06
jrmu
$msg.=$mod_msgs->{$mod}."\n";
37
2023-05-06
jrmu
}
38
2023-05-06
jrmu
}
39
2023-05-06
jrmu
40
2023-05-06
jrmu
my $mod_admin_msgs={
41
2023-05-06
jrmu
BNC => <<"EOF",
42
2021-12-17
jrmu
To delete a bouncer, type !bnc delete <username>
43
2021-12-17
jrmu
To verify a captcha, type !bnc captcha <username>
44
2023-03-05
jrmu
To approve a bouncer, type !bnc approve <username>
45
2021-12-17
jrmu
To recreate cloneuser, type !bnc cloneuser
46
2023-05-06
jrmu
EOF
47
2023-05-06
jrmu
Shell => <<"EOF",
48
2023-05-06
jrmu
To delete a shell account, type !shell delete <username>
49
2023-05-06
jrmu
To verify a captcha, type !shell captcha <username>
50
2023-05-06
jrmu
EOF
51
2023-05-06
jrmu
};
52
2023-05-06
jrmu
if (main::isstaff($bot, $nick)) {
53
2023-05-06
jrmu
for my $mod (split ' ',$conf{modules}) {
54
2023-05-06
jrmu
if (exists $mod_admin_msgs->{$mod}) {
55
2023-05-06
jrmu
$msg.=$mod_admin_msgs->{$mod};
56
2023-05-06
jrmu
}
57
2023-05-06
jrmu
}
58
2023-05-06
jrmu
$msg .=<<"EOF";
59
2021-12-17
jrmu
To get a list of usernames that match IPs, type !regex ips <ips>
60
2021-12-17
jrmu
To get a list of IPs that match usernames, type !regex users <usernames>
61
2021-12-17
jrmu
To regex search znc.log and output to the terminal, type !regex <regex>
62
2021-12-17
jrmu
EOF
63
2021-12-17
jrmu
#To get a list of usernames that match IPs, type !shell regex ips <ips>
64
2021-12-17
jrmu
#To get a list of IPs that match usernames, type !shell regex users <usernames>
65
2021-12-17
jrmu
#To regex search znc.log and output to the terminal, type !shell regex <regex>
66
2021-12-17
jrmu
}
67
2021-12-17
jrmu
if (@args == 2) {
68
2021-12-17
jrmu
($chan, $text) = ($args[0], $args[1]);
69
2021-12-17
jrmu
if ($chans =~ $chan) {
70
2021-12-17
jrmu
main::putserv($bot, "PRIVMSG $chan :$nick: Please see private message.");
71
2021-12-17
jrmu
}
72
2021-12-17
jrmu
} else {
73
2021-12-17
jrmu
$text = $args[0];
74
2021-12-17
jrmu
}
75
2021-12-17
jrmu
main::putserv($bot, "PRIVMSG $nick :$msg");
76
2021-12-17
jrmu
foreach my $chan (@teamchans) {
77
2023-03-06
jrmu
main::putservlocalnet($bot, "PRIVMSG $chan :$staff: Help *$nick* on network ".$bot->{name}.". If you don't help the user, he will probably leave");
78
2021-12-17
jrmu
}
79
2021-12-17
jrmu
}
80
2021-12-17
jrmu
81
2021-12-17
jrmu
1; # MUST BE LAST STATEMENT IN FILE
IRCNow