Chris@0: configuration['rid']; Chris@0: // Skip adding the role to the user if they already 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->addRole($rid); Chris@0: $account->save(); Chris@0: } Chris@0: } Chris@0: Chris@0: }