line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package meon::Web::Controller::API; |
2
|
2
|
|
|
2
|
|
8117491
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use 5.010; |
4
|
|
|
|
|
|
|
use utf8; |
5
|
|
|
|
|
|
|
use namespace::autoclean; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use meon::Web::Util; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
BEGIN {extends 'Catalyst::Controller'; } |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub auto : Private { |
12
|
|
|
|
|
|
|
my ( $self, $c ) = @_; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub base : Chained('/') PathPart('api') CaptureArgs(0) { |
16
|
|
|
|
|
|
|
my ( $self, $c ) = @_; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub username : Chained('base') PathPart('username') { |
21
|
|
|
|
|
|
|
my ( $self, $c ) = @_; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $username = $c->req->param('username'); |
24
|
|
|
|
|
|
|
$username = meon::Web::Util->username_cleanup($username, $c->default_auth_store->folder); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
$c->json_reply({ |
27
|
|
|
|
|
|
|
username => $username, |
28
|
|
|
|
|
|
|
}); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub email : Chained('base') PathPart('email') { |
32
|
|
|
|
|
|
|
my ( $self, $c ) = @_; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
my $email = $c->req->param('email'); |
35
|
|
|
|
|
|
|
my $members_folder = $c->default_auth_store->folder; |
36
|
|
|
|
|
|
|
my $member = meon::Web::Member->find_by_email( |
37
|
|
|
|
|
|
|
members_folder => $members_folder, |
38
|
|
|
|
|
|
|
email => $email, |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
$c->json_reply({ |
42
|
|
|
|
|
|
|
registered => ($member ? 1 : 0), |
43
|
|
|
|
|
|
|
}); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |