Too easy to not just do this now

This commit is contained in:
swag 2023-01-08 23:53:30 -05:00
parent f2255f8207
commit ae73969320
3 changed files with 9 additions and 2 deletions

View File

@ -41,7 +41,6 @@ Run the tests locally (against development environment):
### (Lord knows there's TODOs I could be working on...) ### (Lord knows there's TODOs I could be working on...)
1. RSS feed!! 1. RSS feed!!
1. Log user out if locked out? Will need to check `lock_status()` beyond just logging in
1. Support at least some Markdown, specifically the code blocks 1. Support at least some Markdown, specifically the code blocks
1. Implement tripcodes (moving this down in priority due to complexity...) 1. Implement tripcodes (moving this down in priority due to complexity...)
1. Return a text response instead of HTML if a `.txt` extension [is 1. Return a text response instead of HTML if a `.txt` extension [is

View File

@ -52,7 +52,7 @@ sub startup($self) {
$self->helper(is_mod => sub ($c) { $self->helper(is_mod => sub ($c) {
if (my $mod_id = $c->session->{'mod_id'}) { if (my $mod_id = $c->session->{'mod_id'}) {
return 1 if $mod_id =~ /\d+/ return 1 unless $c->moderator->lock_status($mod_id)
} }
return undef; return undef;

View File

@ -45,6 +45,14 @@ sub lock_out($self, $mod_id) {
END_SQL END_SQL
} }
sub unlock($self, $mod_id) {
$self->pg->db->query(<<~'END_SQL', $mod_id)
UPDATE moderators
SET lock_status = FALSE
WHERE moderator_id = ?;
END_SQL
}
sub get_id($self, $email) { sub get_id($self, $email) {
$self->pg->db->query(<<~'END_SQL', $email)->hash->{'moderator_id'} $self->pg->db->query(<<~'END_SQL', $email)->hash->{'moderator_id'}
SELECT moderator_id SELECT moderator_id