Changeset 163 for LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Group.pm
- Timestamp:
- 05/23/09 04:52:03 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Group.pm
r162 r163 70 70 my $sth = $self->db->prepare_cached( 71 71 q{ 72 select id from user_attributes_groups73 join user_attributes_list on74 user_attributes_groups.attr = user_attributes_list.ikey75 where value= ? and canonical = ?72 select value from group_attributes_users 73 join group_attributes_list on 74 group_attributes_users.attr = group_attributes_list.ikey 75 where id = ? and canonical = ? 76 76 } 77 77 ); 78 $sth->execute($self->id, 'member Of');78 $sth->execute($self->id, 'memberUID'); 79 79 my @res; 80 80 while (my $res = $sth->fetchrow_hashref) { 81 push(@res, $res->{ id});81 push(@res, $res->{value}); 82 82 } 83 83 return \@res; … … 92 92 foreach my $attr (keys %data) { 93 93 $attr =~ /^memberUID$/ and do { 94 my $cl = $self->base->_load_obj_class('user') or next; 95 my $attrid = $cl->_get_field_name_db('memberOf', $self->base) or next; 94 my $attrid = $self->_get_field_name_db('memberUID', $self->base) or next; 96 95 my %member; 97 96 foreach (@{ $self->get_field('memberUID') }) { … … 107 106 if ($member{$_}{n}) { 108 107 my $sth = $self->db->prepare_cached( 109 q{insert into user_attributes_groups (id, attr, value) values (?,?,?)}108 q{insert into group_attributes_users (value, attr, id) values (?,?,?)} 110 109 ); 111 110 $sth->execute($_, $attrid, $self->id); 112 111 } elsif ($member{$_}{c}) { 113 112 my $sth = $self->db->prepare_cached( 114 q{delete from user_attributes_groups where id = ? and attr = ? and value= ?}113 q{delete from group_attributes_users where value = ? and attr = ? and id = ?} 115 114 ); 116 115 $sth->execute($_, $attrid, $self->id);
Note: See TracChangeset
for help on using the changeset viewer.