function imagepicker_set_user_group_state in Image Picker 5.2
Same name and namespace in other branches
- 6.2 imagepicker.functions.inc \imagepicker_set_user_group_state()
- 7 imagepicker.functions.inc \imagepicker_set_user_group_state()
2 calls to imagepicker_set_user_group_state()
- imagepicker_groups in ./
imagepicker.module - imagepicker_user_page in ./
imagepicker.module - Account functions
File
- ./
imagepicker.module, line 3030 - Enables permitted roles to upload images for insertion into configured nodes.
Code
function imagepicker_set_user_group_state($state, $gid, $account = FALSE) {
if ($account) {
$user = $account;
}
else {
global $user;
}
db_query("UPDATE {imagepicker_user_groups} SET state=0 WHERE uid=%d AND state=1", array(
$user->uid,
));
db_query("UPDATE {imagepicker_user_groups} SET state=%d WHERE gid=%d", array(
$state,
$gid,
));
}