Can anyone point to a snippet or code demonstrating how to change a user's user group via a Web form - e.g. user makes a payment, so change their status from "triallist" to "subscriber".
(I'm using Revolution 2.1.1)
[ed. note: shorewalker last edited this post 15 years ago.]
David Walker
Principal, Shorewalker DMS
Phone: 03 8899 7790
Mobile: 0407 133 020
-
☆ A M B ☆
- 3,141 Posts
Using as a hook with FormIt or standalone snippet, untested but should work-ish.
$join = $modx->user->joinGroup('subscriber','Member');
if ($join) {
$leave = $modx->user->leaveGroup('triallist');
if ($join && $leave) {
// Joining & leaving group worked
return true;
}
// Leaving group failed
return false;
}
// Joining user group failed.
return false;