/[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 23 by dpavlin, Mon Mar 17 13:02:50 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            column objectClass =>
316                    type is 'virtual';
317    
318  };  };
319    
320  use Jifty::Plugin::User::Mixin::Model::User;  # we don't use following mixing because it wants to send notificaitons on e-mail address change
321    #use Jifty::Plugin::User::Mixin::Model::User;
322  use Jifty::Plugin::Authentication::Password::Mixin::Model::User;  use Jifty::Plugin::Authentication::Password::Mixin::Model::User;
323  #use Jifty::Plugin::OpenID::Mixin::Model::User;  #use Jifty::Plugin::OpenID::Mixin::Model::User;
324  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
325    
326  # Your model-specific methods go here.  # Your model-specific methods go here.
327    
328    =head2 before_create
329    
330    Implement virtual columns, for now put mail from ldap into email row
331    
332    =cut
333    
334    =for later
335    
336    sub before_create {
337            my ($self, $attr) = @_;
338            if ( ! $attr->{'email'} ) {
339                    warn "push mail to email";
340                    $attr->{'email'} = $attr->{'mail'};
341            }
342    }
343    
344    =cut
345    
346    =head2 email
347    
348    Accessor for compatibility with Jifty mixins
349    
350    =cut
351    
352    sub email {
353            my $self = shift;
354            return $self->__value('mail');
355    }
356    
357    sub email_confirmed { 1 };
358    
359  =head2 validate_telephoneNumber  =head2 validate_telephoneNumber
360    
361  =cut  =cut
# Line 312  sub validate_telephoneNumber { Line 368  sub validate_telephoneNumber {
368          return ( 1, 'OK' );          return ( 1, 'OK' );
369  }  }
370    
371    =head2 canonicalize_hrEduPersonExpireDate
372    
373    Support NONE as 2042-12-30
374    
375    =cut
376    
377    sub canonicalize_hrEduPersonExpireDate {
378            my ( $self, $value ) = @_;
379    
380            if ( $value eq 'NONE' ) {
381                    $self->log->warn("fixed hrEduPersonExpireDate");
382                    $value = '2042-12-30';
383            }
384    
385            return $value;
386    }
387    
388    =head2 current_user_can
389    
390    =cut
391    
392  sub current_user_can {  sub current_user_can {
393          # FIXME no security for now :-)          # FIXME no security for now :-)
394          return 1;          return 1;

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

  ViewVC Help
Powered by ViewVC 1.1.26