--- lib/A3C/Model/User.pm 2008/03/13 18:07:28 16 +++ lib/A3C/Model/User.pm 2008/03/13 19:26:56 18 @@ -17,12 +17,7 @@ column hrEduPersonUniqueID => label is ('hrEduPersonUniqueID'), is indexed, - is mandatory, - is distinct; - - column name => - type is 'text', - label is _('Ime'), + is distinct, is mandatory; column cn => @@ -40,16 +35,11 @@ is mandatory; column mail => - type is 'virtual'; - - column email => type is 'text', is mandatory, - label is _('Email address'), default is '', is immutable, is distinct; - - column email_confirmed => - label is _('Email address confirmed?'), - type is 'boolean'; + label is _('Email address'), default is '', + is immutable, + is distinct; column password => is unreadable, @@ -310,24 +300,45 @@ }; -use Jifty::Plugin::User::Mixin::Model::User; +# we don't use following mixing because it wants to send notificaitons on e-mail address change +#use Jifty::Plugin::User::Mixin::Model::User; use Jifty::Plugin::Authentication::Password::Mixin::Model::User; #use Jifty::Plugin::OpenID::Mixin::Model::User; use Jifty::Plugin::ActorMetadata::Mixin::Model::ActorMetadata; # created_by, created_on, updated_on # Your model-specific methods go here. -=head2 set_mail +=head2 before_create -Put mail from ldap into email row +Implement virtual columns, for now put mail from ldap into email row =cut -sub set_mail { - my ($self,$v) = @_; - $self->set_email( $v ); +=for later + +sub before_create { + my ($self, $attr) = @_; + if ( ! $attr->{'email'} ) { + warn "push mail to email"; + $attr->{'email'} = $attr->{'mail'}; + } } +=cut + +=head2 email + +Accessor for compatibility with Jifty mixins + +=cut + +sub email { + my $self = shift; + return $self->__value('mail'); +} + +sub email_confirmed { 1 }; + =head2 validate_telephoneNumber =cut