8 |
|
|
9 |
use A3C::Record schema { |
use A3C::Record schema { |
10 |
|
|
11 |
column name => |
column uid => |
12 |
type is 'text', |
label is ('uid'), |
13 |
label is _('Ime'), |
is indexed, |
14 |
|
is mandatory, |
15 |
|
is distinct; |
16 |
|
|
17 |
|
column hrEduPersonUniqueID => |
18 |
|
label is ('hrEduPersonUniqueID'), |
19 |
|
is indexed, |
20 |
|
is distinct, |
21 |
is mandatory; |
is mandatory; |
22 |
|
|
23 |
column cn => |
column cn => |
24 |
label is _('Ime'), |
label is _('Ime i prezime'), |
25 |
type is 'virtual'; |
type is 'virtual'; |
26 |
|
|
27 |
column sn => |
column sn => |
34 |
label is _('Ime'), |
label is _('Ime'), |
35 |
is mandatory; |
is mandatory; |
36 |
|
|
37 |
column email => |
column mail => |
38 |
type is 'text', |
type is 'text', |
39 |
is mandatory, |
is mandatory, |
40 |
label is _('Email address'), default is '', is immutable, is distinct; |
label is _('Email address'), default is '', |
41 |
|
is immutable, |
42 |
column email_confirmed => |
is distinct; |
|
label is _('Email address confirmed?'), |
|
|
type is 'boolean'; |
|
43 |
|
|
44 |
column password => |
column password => |
45 |
is unreadable, |
is unreadable, |
71 |
column hrEduPersonDateOfBirth => |
column hrEduPersonDateOfBirth => |
72 |
type is 'date', |
type is 'date', |
73 |
render as 'date', |
render as 'date', |
74 |
label is _('Datum rođenja'); |
label is _('Datum rođenja'), |
75 |
|
filters are 'Jifty::DBI::Filter::Date'; |
76 |
|
|
77 |
column hrEduPersonGender => |
column hrEduPersonGender => |
78 |
label is _('Spol'); |
label is _('Spol'); |
196 |
type is 'date', |
type is 'date', |
197 |
render as 'date', |
render as 'date', |
198 |
is mandatory, |
is mandatory, |
199 |
|
filters are 'Jifty::DBI::Filter::Date'; |
200 |
|
|
201 |
column hrEduPersonTitle => |
column hrEduPersonTitle => |
202 |
label is 'Položaj u ustanovi', |
label is 'Položaj u ustanovi', |
300 |
|
|
301 |
}; |
}; |
302 |
|
|
303 |
use Jifty::Plugin::User::Mixin::Model::User; |
# we don't use following mixing because it wants to send notificaitons on e-mail address change |
304 |
|
#use Jifty::Plugin::User::Mixin::Model::User; |
305 |
use Jifty::Plugin::Authentication::Password::Mixin::Model::User; |
use Jifty::Plugin::Authentication::Password::Mixin::Model::User; |
306 |
#use Jifty::Plugin::OpenID::Mixin::Model::User; |
#use Jifty::Plugin::OpenID::Mixin::Model::User; |
307 |
use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata; # created_by, created_on, updated_on |
use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata; # created_by, created_on, updated_on |
308 |
|
|
309 |
# Your model-specific methods go here. |
# Your model-specific methods go here. |
310 |
|
|
311 |
|
=head2 before_create |
312 |
|
|
313 |
|
Implement virtual columns, for now put mail from ldap into email row |
314 |
|
|
315 |
|
=cut |
316 |
|
|
317 |
|
=for later |
318 |
|
|
319 |
|
sub before_create { |
320 |
|
my ($self, $attr) = @_; |
321 |
|
if ( ! $attr->{'email'} ) { |
322 |
|
warn "push mail to email"; |
323 |
|
$attr->{'email'} = $attr->{'mail'}; |
324 |
|
} |
325 |
|
} |
326 |
|
|
327 |
|
=cut |
328 |
|
|
329 |
|
=head2 email |
330 |
|
|
331 |
|
Accessor for compatibility with Jifty mixins |
332 |
|
|
333 |
|
=cut |
334 |
|
|
335 |
|
sub email { |
336 |
|
my $self = shift; |
337 |
|
return $self->__value('mail'); |
338 |
|
} |
339 |
|
|
340 |
|
sub email_confirmed { 1 }; |
341 |
|
|
342 |
=head2 validate_telephoneNumber |
=head2 validate_telephoneNumber |
343 |
|
|
344 |
=cut |
=cut |
351 |
return ( 1, 'OK' ); |
return ( 1, 'OK' ); |
352 |
} |
} |
353 |
|
|
354 |
|
=head2 canonicalize_hrEduPersonExpireDate |
355 |
|
|
356 |
|
Support NONE as 2042-12-30 |
357 |
|
|
358 |
|
=cut |
359 |
|
|
360 |
|
sub canonicalize_hrEduPersonExpireDate { |
361 |
|
my ( $self, $value ) = @_; |
362 |
|
|
363 |
|
if ( $value eq 'NONE' ) { |
364 |
|
$self->log->warn("fixed hrEduPersonExpireDate"); |
365 |
|
$value = '2042-12-30'; |
366 |
|
} |
367 |
|
|
368 |
|
return $value; |
369 |
|
} |
370 |
|
|
371 |
|
=head2 current_user_can |
372 |
|
|
373 |
|
=cut |
374 |
|
|
375 |
sub current_user_can { |
sub current_user_can { |
376 |
# FIXME no security for now :-) |
# FIXME no security for now :-) |
377 |
return 1; |
return 1; |