]>
iEval git - gruntmaster-data.git/blob - Data/Result/User.pm
2 package Gruntmaster
::Data
::Result
::User
;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
9 Gruntmaster::Data::Result::User - List of users
16 use base
'DBIx::Class::Core';
18 =head1 TABLE: C<users>
22 __PACKAGE__
->table("users");
36 RFC2307-encoded passphrase
76 Highschool, Undergraduate, Master, Doctorate or Other
88 Unix time when this user last submitted a job
92 __PACKAGE__
->add_columns(
94 { data_type
=> "text", is_nullable
=> 0 },
96 { data_type
=> "text", is_nullable
=> 1 },
98 { data_type
=> "boolean", default_value
=> \"false
", is_nullable => 0 },
100 { data_type => "text
", is_nullable => 1 },
102 { data_type => "text
", is_nullable => 1 },
104 { data_type => "text
", is_nullable => 1 },
106 { data_type => "text
", is_nullable => 1 },
108 { data_type => "text
", is_nullable => 1 },
110 { data_type => "text
", is_nullable => 1 },
112 { data_type => "text
", is_nullable => 1 },
114 { data_type => "bigint
", is_nullable => 1 },
127 __PACKAGE__->set_primary_key("id
");
131 =head2 contest_statuses
135 Related object: L<Gruntmaster::Data::Result::ContestStatus>
139 __PACKAGE__->has_many(
141 "Gruntmaster
::Data
::Result
::ContestStatus
",
142 { "foreign
.owner
" => "self
.id
" },
143 { cascade_copy => 0, cascade_delete => 0 },
150 Related object: L<Gruntmaster::Data::Result::Contest>
154 __PACKAGE__->has_many(
156 "Gruntmaster
::Data
::Result
::Contest
",
157 { "foreign
.owner
" => "self
.id
" },
158 { cascade_copy => 0, cascade_delete => 0 },
165 Related object: L<Gruntmaster::Data::Result::Job>
169 __PACKAGE__->has_many(
171 "Gruntmaster
::Data
::Result
::Job
",
172 { "foreign
.owner
" => "self
.id
" },
173 { cascade_copy => 0, cascade_delete => 0 },
180 Related object: L<Gruntmaster::Data::Result::Open>
184 __PACKAGE__->has_many(
186 "Gruntmaster
::Data
::Result
::Open
",
187 { "foreign
.owner
" => "self
.id
" },
188 { cascade_copy => 0, cascade_delete => 0 },
191 =head2 problem_statuses
195 Related object: L<Gruntmaster::Data::Result::ProblemStatus>
199 __PACKAGE__->has_many(
201 "Gruntmaster
::Data
::Result
::ProblemStatus
",
202 { "foreign
.owner
" => "self
.id
" },
203 { cascade_copy => 0, cascade_delete => 0 },
210 Related object: L<Gruntmaster::Data::Result::Problem>
214 __PACKAGE__->has_many(
216 "Gruntmaster
::Data
::Result
::Problem
",
217 { "foreign
.owner
" => "self
.id
" },
218 { cascade_copy => 0, cascade_delete => 0 },
222 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-01-29 18:45:35
223 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rpx697B3St+ICCSbOn4cbQ
225 use Class::Method::Modifiers qw/after/;
227 after qw/insert update delete/ => sub {
229 Gruntmaster::Data::purge '/us/';
230 Gruntmaster::Data::purge '/us/' . $self->id;
233 use Authen::Passphrase;
234 use Authen::Passphrase::BlowfishCrypt;
236 sub check_passphrase {
237 my ($self, $pw) = @_;
238 Authen::Passphrase->from_rfc2307($self->passphrase)->match($pw)
242 my ($self, $pw) = @_;
243 $self->update({passphrase => Authen::Passphrase::BlowfishCrypt->new(
256 =head2 check_passphrase(I<$passphrase>)
258 Returns true if I<$passphrase> is the correct passphrase, false otherwise.
260 =head2 set_passphrase(I<$passphrase>)
262 Changes the passphrase to I<$passphrase>.
266 Marius Gavrilescu E<lt>marius@ieval.roE<gt>
268 =head1 COPYRIGHT AND LICENSE
270 Copyright (C) 2014 by Marius Gavrilescu
272 This library is free software; you can redistribute it and/or modify
273 it under the same terms as Perl itself, either Perl version 5.18.1 or,
274 at your option, any later version of Perl 5 you may have available.
This page took 0.054878 seconds and 4 git commands to generate.