function user_permissions_uninstall in User Permissions 5
Same name and namespace in other branches
- 8 user_permissions.install \user_permissions_uninstall()
- 6 user_permissions.install \user_permissions_uninstall()
- 7 user_permissions.install \user_permissions_uninstall()
Remove any roles created by this module.
File
- ./
user_permissions.install, line 6
Code
function user_permissions_uninstall() {
$roles = user_roles();
foreach ($roles as $rid => $name) {
if (strpos($name, '_user_role_') !== FALSE) {
db_query("DELETE FROM {permission} WHERE rid = %d", $rid);
db_query("DELETE FROM {users_roles} WHERE rid = %d", $rid);
db_query("DELETE FROM {role} WHERE rid = %d", $rid);
}
}
}