You are here

function imagepicker_set_user_group_state in Image Picker 7

Same name and namespace in other branches
  1. 5.2 imagepicker.module \imagepicker_set_user_group_state()
  2. 6.2 imagepicker.functions.inc \imagepicker_set_user_group_state()
2 calls to imagepicker_set_user_group_state()
imagepicker_groups in ./imagepicker.group.inc
@file @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL
imagepicker_user_page in ./imagepicker.user.inc
@file @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

File

./imagepicker.functions.inc, line 1397
@author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function imagepicker_set_user_group_state($state, $gid, $account = FALSE) {
  if ($account) {
    $user = $account;
  }
  else {
    global $user;
  }
  db_update('imagepicker_user_groups')
    ->fields(array(
    'state' => 0,
  ))
    ->condition('uid', $user->uid)
    ->condition('state', 1)
    ->execute();
  db_update('imagepicker_user_groups')
    ->fields(array(
    'state' => $state,
  ))
    ->condition('gid', $gid)
    ->execute();
}