| 1 | package Dancer2::Plugin::Auth::Extensible::Provider::DBIxClass; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 4 | ▶ | use Modern::Perl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 4 | our $VERSION = '0.0902'; # VERSION | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 4 | our $AUTHORITY = 'cpan:GEEKRUTH'; # AUTHORITY | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | # ABSTRACT: authenticate via the Dancer2::Plugin::DBIx:Class plugin | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 4 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 4 | ▶ | use Dancer2::Core::Types qw/Bool Int Str/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 4 | ▶ | use DateTime; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 4 | ▶ | use DBIx::Class::ResultClass::HashRefInflator; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 4 | ▶ | use Scalar::Util qw(blessed); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 4 | ▶ | use String::CamelCase qw(camelize); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 4 | ▶ | use Moo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 4 | with 'Dancer2::Plugin::Auth::Extensible::Role::Provider'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 4 | ▶ | use namespace::clean; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 6 | ▶ | sub deprecated_setting { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
deprecated_setting: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 6 | my ( $setting, $replacement ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 6 | carp __PACKAGE__, " config setting \"$setting\" is deprecated.", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | " Use \"$replacement\" instead."; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 8 | ▶ | sub BUILDARGS { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BUILDARGS: called CC=11 SCAR=24.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 8 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | ▶ | my %args = ref( $_[0] ) eq 'HASH' ? %{ $_[0] } : @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 8 | my $app = $args{plugin}->app; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | # backwards compat | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | # deprecate the *_source settings, but don't change anything yet | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | deprecated_setting( 'users_source', 'users_resultset' ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 8 | ▶ | if $args{users_source}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | deprecated_setting( 'roles_source', 'roles_resultset' ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 8 | ▶ | if $args{roles_source}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | deprecated_setting( 'user_roles_source', 'user_roles_resultset' ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 8 | ▶ | if $args{user_roles_source}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | # deprecate the *_table settings and move them into source, which | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | # will be used in the lazy build for the correct *_resultset settings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 8 | ▶ | if ( $args{users_table} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 1 | deprecated_setting( 'users_table', 'users_resultset' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | $args{users_source} = delete $args{users_table} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 1 | ▶ | if !$args{users_source}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 8 | ▶ | if ( $args{roles_table} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 1 | deprecated_setting( 'roles_table', 'roles_resultset' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | $args{roles_source} = delete $args{roles_table} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 1 | ▶ | if !$args{roles_source}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 8 | ▶ | if ( $args{user_roles_table} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 1 | deprecated_setting( 'user_roles_table', 'user_roles_resultset' ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | $args{user_roles_source} = delete $args{user_roles_table} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 1 | ▶ | if !$args{user_roles_source}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 8 | return \%args; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 4 | has user_as_object => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | isa => Bool, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | default => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | has dancer2_plugin_dbic => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | lazy => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 6 | ▶ | default => sub { $_[0]->plugin->app->with_plugin('Dancer2::Plugin::DBIx::Class') }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 4 | handles => { dbic_schema => 'schema' }, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | init_arg => undef, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 4 | has schema_name => ( is => 'ro', ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | has schema => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | lazy => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 6 | ▶ | default => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 6 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 6 | ▶ | $self->schema_name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | ? $self->dbic_schema( $self->schema_name ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | : $self->dbic_schema; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 4 | has password_expiry_days => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | isa => Int, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 4 | has roles_key => ( is => 'ro', ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | has roles_resultset => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | lazy => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 3 | ▶ | default => sub { camelize( $_[0]->roles_source ) }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 4 | has roles_role_column => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | default => 'role', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 4 | has roles_source => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | default => 'role', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | has users_resultset => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | lazy => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 2 | ▶ | default => sub { camelize( $_[0]->users_source ) }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 4 | has users_source => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | default => 'user', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 4 | has users_lastlogin_column => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | default => 'lastlogin', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 4 | has users_password_column => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | default => 'password', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 4 | has users_pwchanged_column => ( is => 'ro', ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 4 | has users_pwresetcode_column => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | default => 'pw_reset_code', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 4 | has users_password_check => ( is => 'ro', ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 4 | has users_username_column => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | default => 'username', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | has user_user_roles_relationship => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | lazy => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 5 | ▶ | default => sub { $_[0]->_build_user_roles_relationship('user') }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | has user_roles_resultset => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | lazy => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 2 | ▶ | default => sub { camelize( $_[0]->user_roles_source ) }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 4 | has user_roles_source => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | default => 'user_roles', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | has user_valid_conditions => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 4 | ▶ | default => sub { {} }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | has role_user_roles_relationship => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | lazy => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 5 | ▶ | default => sub { $_[0]->_build_user_roles_relationship('role') }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | has user_roles_result_class => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | lazy => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | ▶ | default => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | # undef if roles are disabled | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 0 | ▶ | return undef if $self->plugin->disable_roles; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | return $self->schema->resultset( $self->user_roles_resultset ) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | ->result_source->result_class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 10 | ▶ | sub _build_user_roles_relationship { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_user_roles_relationship: called CC=8 SCAR=23.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 10 | my ( $self, $name ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 10 | ▶ | return undef if $self->plugin->disable_roles; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | # Introspect result sources to find relationships | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 10 | my $user_roles_class = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | $self->schema->resultset( $self->user_roles_resultset )->result_source->result_class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 10 | my $resultset_name = "${name}s_resultset"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 10 | my $result_source = $self->schema->resultset( $self->$resultset_name )->result_source; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 10 | foreach my $relname ( $result_source->relationships ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 10 | my $rel_info = $result_source->relationship_info($relname); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | # just check for a simple equality join condition. It could be other | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | # things (e.g. code ref) but for now this is unsupported. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 10 | ▶ | next unless ref $rel_info->{cond} eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 10 | my %cond = %{ $rel_info->{cond} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 10 | ▶ | if ( $rel_info->{class} eq $user_roles_class | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%3/9
$rel_info->{"class"} eq $user_roles_class and $rel_info->{"attrs"}{"accessor"} eq "multi" and $rel_info->{"attrs"}{"join_type"} eq "LEFT" and scalar keys %cond == 1
$rel_info->{"class"} eq $user_roles_class and $rel_info->{"attrs"}{"accessor"} eq "multi" and $rel_info->{"attrs"}{"join_type"} eq "LEFT"
$rel_info->{"class"} eq $user_roles_class and $rel_info->{"attrs"}{"accessor"} eq "multi"
MC/DC0%0/4
$rel_info->{"class"} eq $user_roles_class and $rel_info->{"attrs"}{"accessor"} eq "multi" and $rel_info->{"attrs"}{"join_type"} eq "LEFT" and scalar keys %cond == 1
$rel_info->{"class"} eq $user_roles_class
$rel_info->{"attrs"}{"accessor"} eq "multi"
$rel_info->{"attrs"}{"join_type"} eq "LEFT"
scalar keys %cond == 1
Truth table20%1/5
A and B and C and D
A= $rel_info->{"class"} eq $user_roles_classB= $rel_info->{"attrs"}{"accessor"} eq "multi"C= $rel_info->{"attrs"}{"join_type"} eq "LEFT"D= scalar keys %cond == 1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | && $rel_info->{attrs}->{accessor} eq 'multi' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | && $rel_info->{attrs}->{join_type} eq 'LEFT' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | && scalar keys %cond == 1 ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 10 | return $relname; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | has role_relationship => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | lazy => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 5 | ▶ | default => sub { $_[0]->_build_relationship('role') }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | has user_relationship => ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | lazy => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 4 | ▶ | default => sub { $_[0]->_build_relationship('user') }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 4 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 9 | ▶ | sub _build_relationship { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_build_relationship: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 9 | my ( $self, $name ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 9 | ▶ | return undef if $self->plugin->disable_roles; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | # Introspect result sources to find relationships | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 9 | my $user_roles_class = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | $self->schema->resultset( $self->user_roles_resultset )->result_source->result_class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 9 | my $resultset_name = "${name}s_resultset"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 9 | my $result_source = $self->schema->resultset( $self->$resultset_name )->result_source; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 9 | my $user_roles_relationship = "${name}_user_roles_relationship"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | my ($relationship) = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 9 | keys %{ $result_source->reverse_relationship_info( $self->$user_roles_relationship ) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 9 | return $relationship; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | # Returns a DBIC rset for the user | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 818 | ▶ | sub _user_rset { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_user_rset: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 818 | my ( $self, $column, $value, $options ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | 818 | my $username_column = $self->users_username_column; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 818 | my $user_valid_conditions = $self->user_valid_conditions; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 818 | ▶ | my $search_column = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | $column eq 'username' ? $username_column | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | : $column eq 'pw_reset_code' ? $self->users_pwresetcode_column | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | : $column; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | # Search based on standard username search, plus any additional | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | # conditions in ignore_user | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 818 | my $search = { %$user_valid_conditions, 'me.' . $search_column => $value }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | # Look up the user | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 818 | $self->schema->resultset( $self->users_resultset )->search( $search, $options ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 202 | ▶ | sub authenticate_user { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
authenticate_user: called CC=9 SCAR=22.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 202 | my ( $self, $username, $password, %options ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 202 | ▶ | croak 'username and password must be defined' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $username and defined $password
MC/DC100%2/2
defined $username and defined $password
defined $username
defined $password
Truth table100%3/3
A and B
A= defined $usernameB= defined $password
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | unless defined $username && defined $password; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 196 | my ($user) = $self->_user_rset( 'username', $username )->all; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 196 | ▶ | return unless $user; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 76 | ▶ | if ( my $password_check = $self->users_password_check ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | # check password via result class method | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | 0 | return $user->$password_check($password); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | # OK, we found a user, let match_password (from our base class) take care of | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | # working out if the password is correct | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 76 | my $password_column = $self->users_password_column; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 76 | ▶ | if ( my $match = $self->match_password( $password, $user->$password_column ) ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | 60 | ▶ | if ( $options{lastlogin} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 56 | ▶ | if ( my $lastlogin = $user->lastlogin ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 36 | ▶ | if ( ref($lastlogin) eq '' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | # not inflated to DateTime | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 36 | my $db_parser = $self->schema->storage->datetime_parser; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | 36 | $lastlogin = $db_parser->parse_datetime($lastlogin); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | # Stash in session as epoch since we don't want to have to mess | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | # with with stringified data or perhaps session engine barfing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | # when trying to serialize DateTime object. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | 36 | $self->plugin->app->session->write( $options{lastlogin} => $lastlogin->epoch ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 56 | $self->set_user_details( $username, $self->users_lastlogin_column => DateTime->now, ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 60 | return $match; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 16 | return; # Make sure we return nothing | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | 26 | ▶ | sub set_user_password { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_user_password: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 26 | my ( $self, $username, $password ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | 26 | ▶ | croak 'username and password must be defined' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $username and defined $password
MC/DC100%2/2
defined $username and defined $password
defined $username
defined $password
Truth table100%3/3
A and B
A= defined $usernameB= defined $password
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | unless defined $username && defined $password; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | 20 | my $encrypted = $self->encrypt_password($password); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | 20 | my $password_column = $self->users_password_column; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | 20 | my %update = ( $password_column => $encrypted ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | 20 | ▶ | if ( my $pwchanged = $self->users_pwchanged_column ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | 18 | $update{$pwchanged} = DateTime->now; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | 20 | $self->set_user_details( $username, %update ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | # Return details about the user. The user's row in the users table will be | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | # fetched and all columns returned as a hashref. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | 280 | ▶ | sub get_user_details { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_user_details: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | 280 | my ( $self, $username ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | 280 | ▶ | croak 'username must be defined' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | unless defined $username; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | # Look up the user | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | 278 | my $users_rs = $self->_user_rset( username => $username ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | # Inflate to a hashref, otherwise it's returned as a DBIC rset | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | 278 | ▶ | $users_rs->result_class('DBIx::Class::ResultClass::HashRefInflator') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | unless $self->user_as_object; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 278 | my ($user) = $users_rs->all; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | 278 | ▶ | if ( !$user ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 30 | $self->plugin->app->log( 'debug', "No such user $username" ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | 30 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | 248 | ▶ | if ( !$self->user_as_object ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | 124 | ▶ | if ( my $roles_key = $self->roles_key ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | 124 | my @roles = @{ $self->get_user_roles($username) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | 124 | my %roles = map { $_ => 1 } @roles; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | 124 | $user->{$roles_key} = \%roles; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | 248 | return $user; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | # Find a user based on a password reset code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | 44 | ▶ | sub get_user_by_code { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_user_by_code: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | 44 | my ( $self, $code ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 44 | ▶ | croak 'code needs to be specified' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$code and $code ne ""
MC/DC50%1/2
$code and $code ne ""
$code
$code ne ""
Truth table66%2/3
A and B
A= $codeB= $code ne ""
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | unless $code && $code ne ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | 40 | my ($user) = $self->_user_rset( pw_reset_code => $code )->all; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 40 | ▶ | return unless $user; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | 8 | my $username_column = $self->users_username_column; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | 8 | return $user->$username_column; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | 32 | ▶ | sub create_user { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create_user: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | 32 | my ( $self, %user ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | 32 | my $username_column = $self->users_username_column; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | 32 | my $username = delete $user{username}; # Prevent attempt to update wrong key | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | 32 | ▶ | croak 'Username not supplied in args' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $username and $username ne ""
MC/DC100%2/2
defined $username and $username ne ""
defined $username
$username ne ""
Truth table100%3/3
A and B
A= defined $usernameB= $username ne ""
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | unless defined $username && $username ne ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | 28 | $self->schema->resultset( $self->users_resultset )->create( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | $username_column => $username | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | 22 | $self->set_user_details( $username, %user ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | # Update a user. Username is provided in the update details | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | 140 | ▶ | sub set_user_details { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_user_details: called CC=13 SCAR=26.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | 140 | my ( $self, $username, %update ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | 140 | ▶ | croak 'Username to update needs to be specified' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | unless $username; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | # Look up the user | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | 136 | my ($user) = $self->_user_rset( username => $username )->all; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | 136 | ▶ | $user or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | # Are we expecting a user_roles key? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | 126 | ▶ | if ( my $roles_key = $self->roles_key ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | 126 | ▶ | if ( my $new_roles = delete $update{$roles_key} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | 4 | my $roles_role_column = $self->roles_role_column; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | 4 | my $users_username_column = $self->users_username_column; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | 4 | my @all_roles = $self->schema->resultset( $self->roles_resultset )->all; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | my %existing_roles = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | 0 | map { $_ => 1 } @{ $self->get_user_roles($username) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | 4 | foreach my $role (@all_roles) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | 12 | my $role_name = $role->$roles_role_column; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | 12 | ▶ | if ( $new_roles->{$role_name} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition66%2/3
$new_roles->{$role_name} and not $existing_roles{$role_name}
MC/DC50%1/2
$new_roles->{$role_name} and not $existing_roles{$role_name}
$new_roles->{$role_name}
not $existing_roles{$role_name}
Truth table66%2/3
A and not(B)
A= $new_roles->{$role_name}B= not $existing_roles{$role_name}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | && !$existing_roles{$role_name} ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | # Needs to be added | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | $self->schema->resultset( $self->user_roles_resultset )->create( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | $self->user_relationship => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | $users_username_column => $username, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | 4 | %{ $self->user_valid_conditions } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | $self->role_relationship => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | $roles_role_column => $role_name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | ▶ | } elsif ( !$new_roles->{$role_name} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
not $new_roles->{$role_name} and $existing_roles{$role_name}
MC/DC0%0/2
not $new_roles->{$role_name} and $existing_roles{$role_name}
not $new_roles->{$role_name}
$existing_roles{$role_name}
Truth table33%1/3
not(A) and B
A= not $new_roles->{$role_name}B= $existing_roles{$role_name}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | && $existing_roles{$role_name} ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | # Needs to be removed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | 0 | $self->schema->resultset( $self->user_roles_resultset )->search( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | $self->user_relationship . ".$users_username_column" => $username, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | $self->role_relationship . ".$roles_role_column" => $role_name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | join => [ $self->user_relationship, $self->role_relationship ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | )->delete; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | # Move password reset code between keys if required | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | 126 | ▶ | if ( my $users_pwresetcode_column = $self->users_pwresetcode_column ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | 126 | ▶ | if ( exists $update{pw_reset_code} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | 10 | my $pw_reset_code = delete $update{pw_reset_code}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | 10 | $update{$users_pwresetcode_column} = $pw_reset_code; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | 126 | $user->update( {%update} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | # Update $username if it was submitted in update | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | 126 | ▶ | $username = $update{username} if $update{username}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | 126 | return $self->get_user_details($username); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | 170 | ▶ | sub get_user_roles { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_user_roles: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | 170 | my ( $self, $username ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | 170 | ▶ | croak 'username must be defined' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | unless defined $username; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | 168 | my $role_relationship = $self->role_relationship; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | 168 | my $user_user_roles_relationship = $self->user_user_roles_relationship; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | 168 | my $roles_role_column = $self->roles_role_column; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | 168 | my $options = { prefetch => { $user_user_roles_relationship => $role_relationship } }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | 168 | my ($user) = $self->_user_rset( username => $username, $options )->all; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | 168 | ▶ | if ( !$user ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | 4 | $self->plugin->app->log( 'debug', "No such user $username when looking for roles" ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | 4 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | 164 | my @roles; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | 164 | foreach my $ur ( $user->$user_user_roles_relationship ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | 166 | my $role = $ur->$role_relationship->$roles_role_column; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | 166 | push @roles, $role; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | 164 | \@roles; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | 12 | ▶ | sub password_expired { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
password_expired: called CC=11 SCAR=25.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | 12 | my ( $self, $user ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | 12 | ▶ | croak 'user must be specified' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition55%5/9
defined $user and ref $user eq "HASH" || builtin::blessed($user) && $user->isa("DBIx::Class::Row")
ref $user eq "HASH" or builtin::blessed($user) and $user->isa("DBIx::Class::Row")
builtin::blessed($user) and $user->isa("DBIx::Class::Row")
MC/DC25%1/4
defined $user and ref $user eq "HASH" || builtin::blessed($user) && $user->isa("DBIx::Class::Row")
defined $user
ref $user eq "HASH"
builtin::blessed($user)
$user->isa("DBIx::Class::Row")
Truth table60%3/5
A and B or C and D
A= defined $userB= ref $user eq "HASH"C= builtin::blessed($user)D= $user->isa("DBIx::Class::Row")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | unless defined $user | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | && ( ref($user) eq 'HASH' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | || ( blessed($user) && $user->isa('DBIx::Class::Row') ) ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | 10 | ▶ | my $expiry = $self->password_expiry_days or return 0; # No expiry set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | 10 | ▶ | if ( my $pwchanged = $self->users_pwchanged_column ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | 10 | ▶ | my $last_changed = $self->user_as_object ? $user->$pwchanged : $user->{$pwchanged}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | # If not changed then report expired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | 10 | ▶ | return 1 unless $last_changed; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | 8 | ▶ | if ( ref($last_changed) ne 'DateTime' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | # not inflated to DateTime by schema so do it now | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | 8 | my $db_parser = $self->schema->storage->datetime_parser; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | 8 | $last_changed = $db_parser->parse_datetime($last_changed); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | 8 | my $duration = $last_changed->delta_days( DateTime->now ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | 8 | ▶ | $duration->in_units('days') > $expiry ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | 0 | croak 'users_pwchanged_column not configured'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | 4 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||