1 |
use strict; |
use strict; |
2 |
use warnings; |
use warnings; |
3 |
|
|
4 |
package A3C::Model::User; |
package A3C::Model::Person; |
5 |
use Jifty::DBI::Schema; |
use Jifty::DBI::Schema; |
6 |
|
|
7 |
use utf8; |
use utf8; |
9 |
use A3C::Record schema { |
use A3C::Record schema { |
10 |
|
|
11 |
column uid => |
column uid => |
12 |
label is ('uid'), |
label is _('UID'), |
13 |
is indexed, |
is indexed, |
14 |
is mandatory, |
is mandatory, |
15 |
is distinct; |
is distinct; |
16 |
|
|
17 |
column hrEduPersonUniqueID => |
column hrEduPersonUniqueID => |
18 |
label is ('hrEduPersonUniqueID'), |
label is _('hr Edu Person Unique ID'), |
19 |
is indexed, |
is indexed, |
20 |
is distinct, |
is distinct, |
21 |
is mandatory; |
is mandatory; |
36 |
type is 'text', |
type is 'text', |
37 |
is mandatory, |
is mandatory, |
38 |
label is _('Email address'), default is '', |
label is _('Email address'), default is '', |
39 |
|
is indexed, |
40 |
is immutable, |
is immutable, |
41 |
is distinct; |
is distinct; |
42 |
|
|
89 |
label is _('Tip administratora'), |
label is _('Tip administratora'), |
90 |
valid are [ '', 'AS', 'AI', 'AR', 'AHU' ]; |
valid are [ '', 'AS', 'AI', 'AR', 'AHU' ]; |
91 |
|
|
92 |
|
column hrEduPersonHomeOrg => |
93 |
|
label is _('Oznaka matične ustanove'), |
94 |
|
hint is 'CARNet', |
95 |
|
is mandatory; |
96 |
|
|
97 |
column hrEduPersonProfessionalStatus => |
column hrEduPersonProfessionalStatus => |
98 |
label is _('Stručni status'), |
label is _('Stručni status'), |
99 |
valid are [ |
valid are [ |
154 |
], |
], |
155 |
default is ''; |
default is ''; |
156 |
|
|
157 |
column organization => |
column 'o' => |
158 |
refers_to A3C::Model::Organization by 'id', |
is indexed; |
159 |
is mandatory; |
|
160 |
|
column 'l'; |
161 |
|
column 'postalAddress'; |
162 |
|
column 'postalCode'; |
163 |
|
column 'street'; |
164 |
|
|
165 |
|
# column organization => |
166 |
|
# refers_to A3C::Model::Organization by 'id', |
167 |
|
# is mandatory; |
168 |
|
|
169 |
column hrEduPersonAffiliation => |
column hrEduPersonAffiliation => |
170 |
label is _('Povezanost s ustanovom'), |
label is _('Povezanost s ustanovom'), |
289 |
label is _('Oznaka privatnosti'); |
label is _('Oznaka privatnosti'); |
290 |
|
|
291 |
column loginShell => |
column loginShell => |
292 |
label is _('shell'); |
label is _('login shell'); |
293 |
|
|
294 |
column uidNumber => |
column uidNumber => |
295 |
label is _('uid'), |
label is _('uid number'), |
296 |
type is 'int'; |
type is 'int'; |
297 |
|
|
298 |
column gidNumber => |
column gidNumber => |
299 |
label is _('gid'); |
label is _('gid number'); |
300 |
type is 'int'; |
type is 'int'; |
301 |
|
|
302 |
column homeDirectory => |
column homeDirectory => |
303 |
label is _('home'); |
label is _('home directory'); |
304 |
|
|
305 |
}; |
}; |
306 |
|
|
338 |
|
|
339 |
sub email { |
sub email { |
340 |
my $self = shift; |
my $self = shift; |
341 |
return $self->__value('mail'); |
return $self->mail; |
342 |
} |
} |
343 |
|
|
344 |
sub email_confirmed { 1 }; |
sub email_confirmed { 1 }; |
345 |
|
|
346 |
|
=head2 name |
347 |
|
|
348 |
|
=cut |
349 |
|
|
350 |
|
sub name { |
351 |
|
my $self = shift; |
352 |
|
return $self->cn . ' <' . $self->mail . '>'; |
353 |
|
} |
354 |
|
|
355 |
=head2 validate_telephoneNumber |
=head2 validate_telephoneNumber |
356 |
|
|
357 |
=cut |
=cut |
364 |
return ( 1, 'OK' ); |
return ( 1, 'OK' ); |
365 |
} |
} |
366 |
|
|
367 |
=head hrEduPersonUniqueNumber |
=head2 hrEduPersonUniqueNumber |
368 |
|
|
369 |
Check if JMBG is valid |
Check if JMBG is valid |
370 |
|
|
421 |
return $value; |
return $value; |
422 |
} |
} |
423 |
|
|
424 |
=head2 current_user_can |
use A3C::DefaultACL; |
|
|
|
|
=cut |
|
|
|
|
|
sub current_user_can { |
|
|
# FIXME no security for now :-) |
|
|
return 1; |
|
|
} |
|
425 |
|
|
426 |
1; |
1; |
427 |
|
|