|
|
|
@ -16,7 +16,7 @@ sub captcha {
|
|
|
|
|
my ($self) = @_; |
|
|
|
|
|
|
|
|
|
eval { |
|
|
|
|
my $table = $c->app->config->{captcha}->{table}; |
|
|
|
|
my $table = $self->app->config->{captcha}->{table}; |
|
|
|
|
my @sort = qw(shown tries); |
|
|
|
|
$self->app->db->begin; |
|
|
|
|
my ($cid, $data) = $self->app->db->select($table, ['id', 'data'], undef, \@sort)->list; |
|
|
|
@ -45,7 +45,7 @@ sub c_list {
|
|
|
|
|
eval { |
|
|
|
|
if (my $sid = $self->app->sid_by_name($ref->{site})) { |
|
|
|
|
my @cm = (); |
|
|
|
|
if (my $pid = $self->app->pid_by_hash($sid, $hash)) { |
|
|
|
|
if (my $pid = $self->app->pid_by_hash($sid, $ref->{hash})) { |
|
|
|
|
my @tm = $self->app->comments_by_pid($pid); |
|
|
|
|
# TODO: processing |
|
|
|
|
@cm = @tm; |
|
|
|
@ -54,7 +54,7 @@ sub c_list {
|
|
|
|
|
} else { |
|
|
|
|
$self->res->code(400); |
|
|
|
|
$self->render(text => "no such site\n"); |
|
|
|
|
} |
|
|
|
|
} 1; |
|
|
|
|
} or do { |
|
|
|
|
chomp $@; |
|
|
|
|
my $msg = sprintf "Error when listing comments for %s/%s: %s", |
|
|
|
|