… | |
… | |
2 | |
2 | |
3 | our $UPDATE_LOGINS = Event->idle (repeat => 0, min => 1, data => cf::WF_AUTOCANCEL, cb => Coro::unblock_sub { |
3 | our $UPDATE_LOGINS = Event->idle (repeat => 0, min => 1, data => cf::WF_AUTOCANCEL, cb => Coro::unblock_sub { |
4 | my ($status, @pl) = ext::commands::who_listing; |
4 | my ($status, @pl) = ext::commands::who_listing; |
5 | |
5 | |
6 | #TODO: write files asynchronously |
6 | #TODO: write files asynchronously |
7 | open my $fh, ">", cf::localdir . "/usercount"; |
7 | open my $fh, ">", "$LOCALDIR/usercount"; |
8 | print $fh scalar @pl; |
8 | print $fh scalar @pl; |
9 | |
9 | |
10 | open my $fh, ">", cf::localdir . "/userlisting.html"; |
10 | open my $fh, ">", "$LOCALDIR/userlisting.html"; |
11 | for ($status, @pl) { |
11 | for ($status, @pl) { |
12 | s/[<&]//g; |
12 | s/[<&]//g; |
13 | print $fh "$_<br />\n"; |
13 | print $fh "$_<br />\n"; |
14 | } |
14 | } |
15 | }); |
15 | }); |