/[A3C]/lib/A3C/Model/Person.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/A3C/Model/Person.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.15  
changed lines
  Added in v.25

  ViewVC Help
Powered by ViewVC 1.1.26