Changeset 342 for LATMOS-Accounts


Ignore:
Timestamp:
08/14/09 17:40:19 (15 years ago)
Author:
nanardon
Message:
  • add support for an attributes 'otheraddress', listing secondaries address id for the user
File:
1 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm

    r341 r342  
    7373        managedObjects => 'managedObjects', 
    7474        department => 'department', 
     75        otheraddress => 'otheraddress', 
    7576        ) : ()), 
    7677    ) 
     
    173174        $res->{expire} =~ /(\d+) days\s*(\w)?/; 
    174175        return $1 + ($2 ? 1 : 0); 
     176    } elsif ($field eq 'otheraddress') { 
     177        my $sth = $self->db->prepare_cached(q{ 
     178            select name from address where "user" = ? 
     179        }); 
     180        $sth->execute($self->id); 
     181        my @values; 
     182        while (my $res = $sth->fetchrow_hashref) { 
     183            push(@values, $res->{name}); 
     184        } 
     185        return \@values; 
    175186    } elsif ((grep { $field eq $_ } __PACKAGE__->_address_fields()) 
    176187        && (my $fsite = $self->get_c_field('site'))) { 
Note: See TracChangeset for help on using the changeset viewer.