You are here

function og_demote_user_action in Organic groups 6

Same name and namespace in other branches
  1. 6.2 modules/og_actions/og_actions.module \og_demote_user_action()

A configurable action to demote a user from a group administrator.

File

modules/og_actions/og_actions.module, line 368

Code

function og_demote_user_action($account, $context) {
  if (isset($context['group'])) {
    og_save_subscription($context['group'], $account->uid, array(
      'is_admin' => 0,
    ));
    watchdog('action', 'Demoted user %name from <em>group administrator</em> in %group.', array(
      '%name' => $account->name,
      '%group' => $context['group'],
    ));
  }
}