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

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

  ViewVC Help
Powered by ViewVC 1.1.26