line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ================================================================ |
2
|
|
|
|
|
|
|
package App::iTan::Command::Delete; |
3
|
|
|
|
|
|
|
# ================================================================ |
4
|
1
|
|
|
1
|
|
1015
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
5
|
1
|
|
|
1
|
|
30
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
6
|
1
|
|
|
1
|
|
5113
|
use 5.0100; |
|
1
|
|
|
|
|
3
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
4
|
use MooseX::App::Command; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
9
|
|
9
|
|
|
|
|
|
|
with qw(App::iTan::Utils); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub execute { |
12
|
0
|
|
|
0
|
0
|
|
my ( $self, $opts, $args ) = @_; |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
say 'All unused iTANs have been deleted'; |
15
|
|
|
|
|
|
|
|
16
|
0
|
0
|
|
|
|
|
$self->dbh->do('DELETE FROM itan |
17
|
|
|
|
|
|
|
WHERE valid = 0 |
18
|
|
|
|
|
|
|
AND used IS NULL') |
19
|
|
|
|
|
|
|
or die "ERROR: Cannot execute: " . $self->dbh->errstr(); |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
return; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=pod |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=encoding utf8 |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 NAME |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
App::iTan::Command::Delete - Delete all invalid iTANs |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 SYNOPSIS |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
itan delete |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 DESCRIPTION |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Delete all invalid iTANs that have not been used yet |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |