--- lib/A3C/Model/User.pm 2008/03/13 17:33:45 15 +++ lib/A3C/Model/User.pm 2008/03/13 18:07:28 16 @@ -8,6 +8,18 @@ use A3C::Record schema { + column uid => + label is ('uid'), + is indexed, + is mandatory, + is distinct; + + column hrEduPersonUniqueID => + label is ('hrEduPersonUniqueID'), + is indexed, + is mandatory, + is distinct; + column name => type is 'text', label is _('Ime'), @@ -27,6 +39,9 @@ label is _('Ime'), is mandatory; + column mail => + type is 'virtual'; + column email => type is 'text', is mandatory, @@ -66,7 +81,8 @@ column hrEduPersonDateOfBirth => type is 'date', render as 'date', - label is _('Datum rođenja'); + label is _('Datum rođenja'), + filters are 'Jifty::DBI::Filter::Date'; column hrEduPersonGender => label is _('Spol'); @@ -190,6 +206,7 @@ type is 'date', render as 'date', is mandatory, + filters are 'Jifty::DBI::Filter::Date'; column hrEduPersonTitle => label is 'Položaj u ustanovi', @@ -300,6 +317,17 @@ # Your model-specific methods go here. +=head2 set_mail + +Put mail from ldap into email row + +=cut + +sub set_mail { + my ($self,$v) = @_; + $self->set_email( $v ); +} + =head2 validate_telephoneNumber =cut @@ -312,6 +340,27 @@ return ( 1, 'OK' ); } +=head2 canonicalize_hrEduPersonExpireDate + +Support NONE as 2042-12-30 + +=cut + +sub canonicalize_hrEduPersonExpireDate { + my ( $self, $value ) = @_; + + if ( $value eq 'NONE' ) { + $self->log->warn("fixed hrEduPersonExpireDate"); + $value = '2042-12-30'; + } + + return $value; +} + +=head2 current_user_can + +=cut + sub current_user_can { # FIXME no security for now :-) return 1;