Changeset 201 for LATMOS-Accounts/lib
- Timestamp:
- 05/27/09 02:18:46 (15 years ago)
- Location:
- LATMOS-Accounts/lib/LATMOS/Accounts
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts/lib/LATMOS/Accounts/Bases.pm
r197 r201 78 78 $for ||= 'rw'; 79 79 my $pclass = $self->_load_obj_class($otype) or return; 80 $pclass->_canonical_fields($self, $for);80 sort $pclass->_canonical_fields($self, $for); 81 81 } 82 82 -
LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Group.pm
r183 r201 73 73 join group_attributes_list on 74 74 group_attributes_users.attr = group_attributes_list.ikey 75 where id = ? and canonical = ? 75 join "group" on "group".ikey = group_attributes_users.okey 76 where name = ? and canonical = ? 76 77 } 77 78 ); … … 106 107 if ($member{$_}{n}) { 107 108 my $sth = $self->db->prepare_cached( 108 q{insert into group_attributes_users (value, attr, id) values (?,?,?)}109 q{insert into group_attributes_users (value, attr, okey) values (?,?,?)} 109 110 ); 110 $sth->execute($_, $attrid, $self-> id);111 $sth->execute($_, $attrid, $self->_get_ikey); 111 112 } elsif ($member{$_}{c}) { 112 113 my $sth = $self->db->prepare_cached( 113 q{delete from group_attributes_users where value = ? and attr = ? and id= ?}114 q{delete from group_attributes_users where value = ? and attr = ? and okey = ?} 114 115 ); 115 $sth->execute($_, $attrid, $self-> id);116 $sth->execute($_, $attrid, $self->_get_ikey); 116 117 } # else {} # can't happend 117 118 } -
LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm
r196 r201 82 82 my $sth = $self->db->prepare_cached( 83 83 q{ 84 select id from group_attributes_users 84 select name from "group" join 85 group_attributes_users on group_attributes_users.okey = "group".ikey 85 86 join group_attributes_list on 86 87 group_attributes_users.attr = group_attributes_list.ikey … … 91 92 my @res; 92 93 while (my $res = $sth->fetchrow_hashref) { 93 push(@res, $res->{ id});94 push(@res, $res->{name}); 94 95 } 95 96 return \@res; … … 97 98 my $sth = $self->db->prepare_cached( 98 99 q{ 99 select id from user_attributes join user_attributes_list 100 select uid from "user" join 101 user_attributes on user_attributes.okey = "user".ikey 102 join user_attributes_list 100 103 on user_attributes_list.ikey = user_attributes.attr 101 104 where value = ? and canonical = ? … … 105 108 my @res; 106 109 while (my $res = $sth->fetchrow_hashref) { 107 push(@res, $res->{ id});110 push(@res, $res->{uid}); 108 111 } 109 112 return \@res; … … 111 114 my $sth = $self->db->prepare_cached( 112 115 q{ 113 select id from group_attributes join group_attributes_list 116 select name from "group" join 117 group_attributes on group_attributes.okey = "group".ikey 118 join group_attributes_list 114 119 on group_attributes_list.ikey = group_attributes.attr 115 120 where value = ? and canonical = ? … … 119 124 my @res; 120 125 while (my $res = $sth->fetchrow_hashref) { 121 push(@res, $res->{ id});126 push(@res, $res->{name}); 122 127 } 123 128 return \@res; … … 175 180 if ($member{$_}{n}) { 176 181 my $sth = $self->db->prepare_cached( 177 q{insert into group_attributes_users (value, attr, id) values (?,?,?)}182 q{insert into group_attributes_users (value, attr, okey) values (?,?,?)} 178 183 ); 179 $sth->execute($self->id, $attrid, $ _);184 $sth->execute($self->id, $attrid, $group->_get_ikey); 180 185 } elsif ($member{$_}{c}) { 181 186 my $sth = $self->db->prepare_cached( 182 q{delete from group_attributes_users where value = ? and attr = ? and id= ?}187 q{delete from group_attributes_users where value = ? and attr = ? and okey = ?} 183 188 ); 184 $sth->execute($self->id, $attrid, $ _);189 $sth->execute($self->id, $attrid, $group->_get_ikey); 185 190 } # else {} # can't happend 186 191 } -
LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm
r200 r201 119 119 } 120 120 } 121 @attr, keys %{ $class->_inline_fields($for, $base) || {} } 121 my %inl = %{ $class->_inline_fields($for, $base) || {} }; 122 $inl{$_} = 1 foreach(@attr); 123 sort keys %inl; 122 124 } 123 125
Note: See TracChangeset
for help on using the changeset viewer.