--- lib/A3C/Model/User.pm 2008/03/18 19:58:34 35 +++ lib/A3C/Model/Person.pm 2008/04/11 22:02:09 77 @@ -1,7 +1,7 @@ use strict; use warnings; -package A3C::Model::User; +package A3C::Model::Person; use Jifty::DBI::Schema; use utf8; @@ -9,13 +9,13 @@ use A3C::Record schema { column uid => - label is ('uid'), + label is _('UID'), is indexed, is mandatory, is distinct; column hrEduPersonUniqueID => - label is ('hrEduPersonUniqueID'), + label is _('hr Edu Person Unique ID'), is indexed, is distinct, is mandatory; @@ -36,6 +36,7 @@ type is 'text', is mandatory, label is _('Email address'), default is '', + is indexed, is immutable, is distinct; @@ -88,6 +89,11 @@ label is _('Tip administratora'), valid are [ '', 'AS', 'AI', 'AR', 'AHU' ]; + column hrEduPersonHomeOrg => + label is _('Oznaka matične ustanove'), + hint is 'CARNet', + is mandatory; + column hrEduPersonProfessionalStatus => label is _('Stručni status'), valid are [ @@ -148,9 +154,17 @@ ], default is ''; - column organization => - refers_to A3C::Model::Organization by 'id', - is mandatory; + column 'o' => + is indexed; + + column 'l'; + column 'postalAddress'; + column 'postalCode'; + column 'street'; + +# column organization => +# refers_to A3C::Model::Organization by 'id', +# is mandatory; column hrEduPersonAffiliation => label is _('Povezanost s ustanovom'), @@ -275,18 +289,18 @@ label is _('Oznaka privatnosti'); column loginShell => - label is _('shell'); + label is _('login shell'); column uidNumber => - label is _('uid'), + label is _('uid number'), type is 'int'; column gidNumber => - label is _('gid'); + label is _('gid number'); type is 'int'; column homeDirectory => - label is _('home'); + label is _('home directory'); }; @@ -324,11 +338,20 @@ sub email { my $self = shift; - return $self->__value('mail'); + return $self->mail; } sub email_confirmed { 1 }; +=head2 name + +=cut + +sub name { + my $self = shift; + return $self->cn . ' <' . $self->mail . '>'; +} + =head2 validate_telephoneNumber =cut @@ -341,7 +364,7 @@ return ( 1, 'OK' ); } -=head hrEduPersonUniqueNumber +=head2 hrEduPersonUniqueNumber Check if JMBG is valid @@ -398,14 +421,7 @@ return $value; } -=head2 current_user_can - -=cut - -sub current_user_can { - # FIXME no security for now :-) - return 1; -} +use A3C::DefaultACL; 1;