Changeset 2455


Ignore:
Timestamp:
02/24/21 17:31:34 (3 years ago)
Author:
nanardon
Message:

Fix: Groupfonames availlable even empty

File:
1 edited

Legend:

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

    r2453 r2455  
    117117} 
    118118 
     119sub new { 
     120    my ($class, $base, $id) = @_; 
     121 
     122    my $__cache = $base->{__cache}{"_" . $class->type}; 
     123 
     124    if (!(exists($__cache->{$id}) 
     125        && $__cache->{$id}{__time} >= time - 1)) { 
     126 
     127        my $sth = $base->db->prepare_cached( 
     128            sprintf(q{ 
     129                  select 1 from "group" where "name" = ? and internobject = false %s 
     130                  and ikey in ( 
     131                    SELECT okey from group_attributes 
     132                    join "user" on group_attributes.value = "user".name 
     133                    where attr = 'memberUID' %s 
     134                    ) 
     135                }, 
     136                ($base->{wexported} ? '' : 'and exported = true'), 
     137                ($base->{wexported} ? '' : 'and "user".exported = true'), 
     138            ), 
     139        ); 
     140        my $count = $sth->execute($id); 
     141        $sth->finish; 
     142        ($count || 0) == 1 or return; 
     143    } 
     144    $class->SUPER::new($base, $id); 
     145} 
     146 
    1191471; 
    120148 
Note: See TracChangeset for help on using the changeset viewer.