line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Yukki::Model::User; |
2
|
|
|
|
|
|
|
$Yukki::Model::User::VERSION = '0.99_01'; # TRIAL |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
596
|
$Yukki::Model::User::VERSION = '0.9901';use v5.24; |
|
1
|
|
|
|
|
3
|
|
5
|
1
|
|
|
1
|
|
6
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
6
|
1
|
|
|
1
|
|
19
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
extends 'Yukki::Model'; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
365
|
use Yukki::Types qw( LoginName ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
14
|
|
11
|
1
|
|
|
1
|
|
563
|
use Yukki::TextUtil qw( load_file ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
667
|
use Path::Class; |
|
1
|
|
|
|
|
20408
|
|
|
1
|
|
|
|
|
51
|
|
14
|
1
|
|
|
1
|
|
7
|
use Type::Params qw( validate ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
15
|
1
|
|
|
1
|
|
261
|
use Type::Utils; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
16
|
1
|
|
|
1
|
|
1433
|
use Types::Path::Tiny; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
11
|
|
17
|
1
|
|
|
1
|
|
224
|
use Types::Standard qw( slurpy Dict ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
732
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# ABSTRACT: lookup users |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub find { |
25
|
0
|
|
|
0
|
1
|
|
my ($self, $opt) |
26
|
|
|
|
|
|
|
= validate(\@_, class_type(__PACKAGE__), slurpy Dict[login_name => LoginName]); |
27
|
0
|
|
|
|
|
|
my $login_name = $opt->{login_name}; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
my $user_file = $self->locate('user_path', $login_name); |
30
|
0
|
0
|
|
|
|
|
if (-e $user_file) { |
31
|
0
|
|
|
|
|
|
return load_file($user_file); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
return; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=pod |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=encoding UTF-8 |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 NAME |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Yukki::Model::User - lookup users |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 VERSION |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
version 0.99_01 |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 SYNOPSIS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
my $users = $app->model('User'); |
56
|
|
|
|
|
|
|
my $user = $users->find('bob'); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
my $login_name = $user->{login_name}; |
59
|
|
|
|
|
|
|
my $password = $user->{password}; |
60
|
|
|
|
|
|
|
my $name = $user->{name}; |
61
|
|
|
|
|
|
|
my $email = $user->{email}; |
62
|
|
|
|
|
|
|
my @groups = @{ $user->{groups} }; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 DESCRIPTION |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Read access to the current list of authorized users. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 METHODS |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 find |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
my $user = $users->find(login_name => $login_name); |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Returns a hash containing the information related to a specific user named by login name. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 AUTHOR |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Andrew Sterling Hanenkamp <hanenkamp@cpan.org> |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
This software is copyright (c) 2017 by Qubling Software LLC. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
85
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |