Chris@0: configuration['rid']; Chris@0: // Skip removing the role from the user if they already don't have it. Chris@0: if ($account !== FALSE && $account->hasRole($rid)) { Chris@0: // For efficiency manually save the original account before applying Chris@0: // any changes. Chris@0: $account->original = clone $account; Chris@0: $account->removeRole($rid); Chris@0: $account->save(); Chris@0: } Chris@0: } Chris@0: Chris@0: }