To set the setting dynamically, you’ll need to create a new plugin, which just has an init()
method with this:
public function init()
{
// Is this a login request?
if (
craft()->request->getActionSegments() === array('users', 'login') &&
($loginName = craft()->request->getPost('loginName')) !== null &&
($user = craft()->users->getUserByUsernameOrEmail($loginName)) !== null
)
{
if ($user->isInGroup('userGroupA'))
{
craft()->config->set('postLoginRedirect', 'path/a');
}
else if ($user->isInGroup('userGroupB'))
{
craft()->config->set('postLoginRedirect', 'path/b');
}
}
}
If none of the conditions match, then Craft will stick with whatever’s in your craft/config/general.php
file.