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