my $nb = $self->dbh_do("
INSERT INTO bweb_role_member (roleid, userid)
SELECT roleid, userid FROM bweb_role, bweb_user
- WHERE rolename IN ($role)
- AND username IN ($username)
+ WHERE rolename IN ($role)
+ AND username IN ($username)
");
return $nb;
}
my $nb = $self->dbh_do("
INSERT INTO bweb_role_member (roleid, userid)
- SELECT roleid, a.userid FROM bweb_user AS a, bweb_role_member JOIN bweb_user USING (userid)
- WHERE bweb_user.username = $copy
- AND a.username = $user");
+ SELECT roleid, a.userid
+ FROM bweb_user AS a, bweb_role_member
+ JOIN bweb_user USING (userid)
+ WHERE bweb_user.username = $copy
+ AND a.username = $user");
return $nb;
}
$self->dbh_do("
DELETE FROM bweb_role_member
WHERE userid IN (
- SELECT userid
- FROM bweb_user
- WHERE username in ($username)
+ SELECT userid
+ FROM bweb_user
+ WHERE username in ($username)
)");
}
SELECT rolename, temp.userid
FROM bweb_role
LEFT JOIN (SELECT roleid, userid
- FROM bweb_user JOIN bweb_role_member USING (userid)
- WHERE username = $user) AS temp USING (roleid)
+ FROM bweb_user JOIN bweb_role_member USING (userid)
+ WHERE username = $user) AS temp USING (roleid)
ORDER BY rolename
", 'rolename');