]>
iEval git - gruntmaster-data.git/blob - lib/Gruntmaster/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
83 Unix time when this user last submitted a job
87 __PACKAGE__
->add_columns(
89 { data_type
=> "text", is_nullable
=> 0 },
91 { data_type
=> "text", is_nullable
=> 1 },
93 { data_type
=> "boolean", default_value
=> \"false
", is_nullable => 0 },
95 { data_type => "text
", is_nullable => 1 },
97 { data_type => "text
", is_nullable => 1 },
99 { data_type => "text
", is_nullable => 1 },
101 { data_type => "text
", is_nullable => 1 },
103 { data_type => "text
", is_nullable => 1 },
105 { data_type => "text
", is_nullable => 1 },
107 { data_type => "bigint
", is_nullable => 1 },
120 __PACKAGE__->set_primary_key("id
");
124 =head2 contest_statuses
128 Related object: L<Gruntmaster::Data::Result::ContestStatus>
132 __PACKAGE__->has_many(
134 "Gruntmaster
::Data
::Result
::ContestStatus
",
135 { "foreign
.owner
" => "self
.id
" },
136 { cascade_copy => 0, cascade_delete => 0 },
143 Related object: L<Gruntmaster::Data::Result::Contest>
147 __PACKAGE__->has_many(
149 "Gruntmaster
::Data
::Result
::Contest
",
150 { "foreign
.owner
" => "self
.id
" },
151 { cascade_copy => 0, cascade_delete => 0 },
158 Related object: L<Gruntmaster::Data::Result::Job>
162 __PACKAGE__->has_many(
164 "Gruntmaster
::Data
::Result
::Job
",
165 { "foreign
.owner
" => "self
.id
" },
166 { cascade_copy => 0, cascade_delete => 0 },
173 Related object: L<Gruntmaster::Data::Result::Open>
177 __PACKAGE__->has_many(
179 "Gruntmaster
::Data
::Result
::Open
",
180 { "foreign
.owner
" => "self
.id
" },
181 { cascade_copy => 0, cascade_delete => 0 },
184 =head2 problem_statuses
188 Related object: L<Gruntmaster::Data::Result::ProblemStatus>
192 __PACKAGE__->has_many(
194 "Gruntmaster
::Data
::Result
::ProblemStatus
",
195 { "foreign
.owner
" => "self
.id
" },
196 { cascade_copy => 0, cascade_delete => 0 },
203 Related object: L<Gruntmaster::Data::Result::Problem>
207 __PACKAGE__->has_many(
209 "Gruntmaster
::Data
::Result
::Problem
",
210 { "foreign
.owner
" => "self
.id
" },
211 { cascade_copy => 0, cascade_delete => 0 },
215 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-19 16:54:00
216 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LiA2+ZpTTelwZJtFpZRsbw
218 use Class::Method::Modifiers qw/after/;
220 after qw/insert update delete/ => sub {
222 Gruntmaster::Data::purge '/us/';
223 Gruntmaster::Data::purge '/us/' . $self->id;
226 use Authen::Passphrase;
227 use Authen::Passphrase::BlowfishCrypt;
229 sub check_passphrase {
230 my ($self, $pw) = @_;
231 Authen::Passphrase->from_rfc2307($self->passphrase)->match($pw)
235 my ($self, $pw) = @_;
236 $self->update({passphrase => Authen::Passphrase::BlowfishCrypt->new(
249 =head2 check_passphrase(I<$passphrase>)
251 Returns true if I<$passphrase> is the correct passphrase, false otherwise.
253 =head2 set_passphrase(I<$passphrase>)
255 Changes the passphrase to I<$passphrase>.
259 Marius Gavrilescu E<lt>marius@ieval.roE<gt>
261 =head1 COPYRIGHT AND LICENSE
263 Copyright (C) 2014 by Marius Gavrilescu
265 This library is free software; you can redistribute it and/or modify
266 it under the same terms as Perl itself, either Perl version 5.18.1 or,
267 at your option, any later version of Perl 5 you may have available.
This page took 0.069397 seconds and 4 git commands to generate.