Ignore:
Timestamp:
05/25/09 02:29:48 (15 years ago)
Author:
nanardon
Message:
  • Sql: support directReports attribute
File:
1 edited

Legend:

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

    r175 r182  
    4646sub _delayed_fields { 
    4747    my ($self)= @_; 
    48     return qw(memberOf manager); 
     48    return qw(memberOf manager directReports); 
    4949} 
    5050 
     
    6262        accountExpires => 'accountExpires', 
    6363        shadowExpire => 'shadowExpire', 
     64        directReports => 'directReports', 
    6465        ) : ()), 
    6566    } 
     
    8788        ); 
    8889        $sth->execute($self->id, 'memberUID'); 
     90        my @res; 
     91        while (my $res = $sth->fetchrow_hashref) { 
     92            push(@res, $res->{id}); 
     93        } 
     94        return \@res; 
     95    } elsif ($field eq 'directReports') { 
     96        my $sth = $self->db->prepare_cached( 
     97            q{ 
     98            select id from user_attributes join user_attributes_list 
     99            on user_attributes_list.ikey = user_attributes.attr 
     100            where value = ? and canonical = ? 
     101            } 
     102        ); 
     103        $sth->execute($self->id, 'manager'); 
    89104        my @res; 
    90105        while (my $res = $sth->fetchrow_hashref) { 
Note: See TracChangeset for help on using the changeset viewer.