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'; |
is mandatory; |
26 |
|
|
27 |
column sn => |
column sn => |
|
type is 'virtual', |
|
28 |
label is _('Prezime'), |
label is _('Prezime'), |
29 |
is mandatory; |
is mandatory; |
30 |
|
|
31 |
column givenName => |
column givenName => |
|
type is 'virtual', |
|
32 |
label is _('Ime'), |
label is _('Ime'), |
33 |
is mandatory; |
is mandatory; |
34 |
|
|
35 |
column email => |
column mail => |
36 |
type is 'text', |
type is 'text', |
37 |
is mandatory, |
is mandatory, |
38 |
label is _('Email address'), default is '', is immutable, is distinct; |
label is _('Email address'), default is '', |
39 |
|
is immutable, |
40 |
column email_confirmed => |
is distinct; |
|
label is _('Email address confirmed?'), |
|
|
type is 'boolean'; |
|
41 |
|
|
42 |
column password => |
column password => |
43 |
is unreadable, |
is unreadable, |
69 |
column hrEduPersonDateOfBirth => |
column hrEduPersonDateOfBirth => |
70 |
type is 'date', |
type is 'date', |
71 |
render as 'date', |
render as 'date', |
72 |
label is _('Datum rođenja'); |
label is _('Datum rođenja'), |
73 |
|
filters are 'Jifty::DBI::Filter::Date'; |
74 |
|
|
75 |
column hrEduPersonGender => |
column hrEduPersonGender => |
76 |
label is _('Spol'); |
label is _('Spol'); |
194 |
type is 'date', |
type is 'date', |
195 |
render as 'date', |
render as 'date', |
196 |
is mandatory, |
is mandatory, |
197 |
|
filters are 'Jifty::DBI::Filter::Date'; |
198 |
|
|
199 |
column hrEduPersonTitle => |
column hrEduPersonTitle => |
200 |
label is 'Položaj u ustanovi', |
label is 'Položaj u ustanovi', |
296 |
column hrEduPersonPrivacy => |
column hrEduPersonPrivacy => |
297 |
label is _('Oznaka privatnosti'); |
label is _('Oznaka privatnosti'); |
298 |
|
|
299 |
|
column loginShell => |
300 |
|
label is _('shell'); |
301 |
|
|
302 |
|
column uidNumber => |
303 |
|
label is _('uid'), |
304 |
|
type is 'int'; |
305 |
|
|
306 |
|
column gidNumber => |
307 |
|
label is _('gid'); |
308 |
|
type is 'int'; |
309 |
|
|
310 |
|
column homeDirectory => |
311 |
|
label is _('home'); |
312 |
|
|
313 |
}; |
}; |
314 |
|
|
315 |
use Jifty::Plugin::User::Mixin::Model::User; |
# we don't use following mixing because it wants to send notificaitons on e-mail address change |
316 |
|
#use Jifty::Plugin::User::Mixin::Model::User; |
317 |
use Jifty::Plugin::Authentication::Password::Mixin::Model::User; |
use Jifty::Plugin::Authentication::Password::Mixin::Model::User; |
318 |
#use Jifty::Plugin::OpenID::Mixin::Model::User; |
#use Jifty::Plugin::OpenID::Mixin::Model::User; |
319 |
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 |
320 |
|
|
321 |
# Your model-specific methods go here. |
# Your model-specific methods go here. |
322 |
|
|
323 |
|
=head2 before_create |
324 |
|
|
325 |
|
Implement virtual columns, for now put mail from ldap into email row |
326 |
|
|
327 |
|
=cut |
328 |
|
|
329 |
|
=for later |
330 |
|
|
331 |
|
sub before_create { |
332 |
|
my ($self, $attr) = @_; |
333 |
|
if ( ! $attr->{'email'} ) { |
334 |
|
warn "push mail to email"; |
335 |
|
$attr->{'email'} = $attr->{'mail'}; |
336 |
|
} |
337 |
|
} |
338 |
|
|
339 |
|
=cut |
340 |
|
|
341 |
|
=head2 email |
342 |
|
|
343 |
|
Accessor for compatibility with Jifty mixins |
344 |
|
|
345 |
|
=cut |
346 |
|
|
347 |
|
sub email { |
348 |
|
my $self = shift; |
349 |
|
return $self->__value('mail'); |
350 |
|
} |
351 |
|
|
352 |
|
sub email_confirmed { 1 }; |
353 |
|
|
354 |
=head2 validate_telephoneNumber |
=head2 validate_telephoneNumber |
355 |
|
|
356 |
=cut |
=cut |
363 |
return ( 1, 'OK' ); |
return ( 1, 'OK' ); |
364 |
} |
} |
365 |
|
|
366 |
|
=head2 canonicalize_hrEduPersonExpireDate |
367 |
|
|
368 |
|
Support NONE as 2042-12-30 |
369 |
|
|
370 |
|
=cut |
371 |
|
|
372 |
|
sub canonicalize_hrEduPersonExpireDate { |
373 |
|
my ( $self, $value ) = @_; |
374 |
|
|
375 |
|
if ( $value eq 'NONE' ) { |
376 |
|
$self->log->warn("fixed hrEduPersonExpireDate"); |
377 |
|
$value = '2042-12-30'; |
378 |
|
} |
379 |
|
|
380 |
|
return $value; |
381 |
|
} |
382 |
|
|
383 |
|
=head2 current_user_can |
384 |
|
|
385 |
|
=cut |
386 |
|
|
387 |
sub current_user_can { |
sub current_user_can { |
388 |
# FIXME no security for now :-) |
# FIXME no security for now :-) |
389 |
return 1; |
return 1; |