No still stuck
on the shifing of users from pending to Business Memebers groups.
Just that one last bit and its done - we can all enjoy a happy Christmas ;-)
[!WebLoginPE? &type=`manager` &activateId=`2` &groupsField=`usergroup` &usersList=`The following accounts require approval:default:approveNewUser:username:ASC:webgroup(Pending Users)`!]
<input type="hidden" name="usergroup" value="S7 member" />
Hi,
Thanks everyone for the postings on this thread it’s helped a lot. I’ve just started using ModX and wanted to do something similar for registering new users which I need to check against a current membership list. After a bit of fiddling I’ve got it working so that it automatically moves a user to a new group when the approval button is used. However I seemed to have implemented it slightly differently to the suggestions on here. So hopefully my solution may help and also I’d appreciate some feedback if I’ve created a messy solution point. Please point me in the right direction if there’s some better way.
Anyway I used the userlist slightly differently
[!WebLoginPE? &type=`manager` &activateId=`2` &groupsField=`usergroup` &usersList=`The following accounts require approval:default:approveNewUser:username:ASC:webgroup(Pending Users)`!]
In the usersList third field, rather than using the default for the userTplChunk, I defined my own : approveNewUser. Mainly because I wanted a simple approval form with just the registration name and email rather than the full profile. So I set the groupsField to usergroup.
My approveNewUser chunk then has a field
<input type="hidden" name="usergroup" value="S7 member" />
Note the name of this field matches the groupsField parameter. I just made the field hidden because any user approved will go into the "S7 member" group and it kept the form clean. When I use the approve user button the user gets moved into the new group and gets an email notifying them that their account has been activated. I dare say if you wanted to select the destination group then the form could have radio buttons instead. I presume that whatever you define the value of this field must match a defined group when the form is posted.
I’ve still to sort out details and test when a registration is rejected, or approving multiple users at once. In the meantime I hope this helps.
Adrian
<input type="hidden" name="usergroup" value="S7 member" />
<label for="wlpeUserProfileEmail">Email <input id="wlpeUserProfileEmail" type="text" name="email" value="[+view.email+]" /> </label>
I’m going to give this a try.
When does your system fire off an email to the user? Mine does it on registration, but the posts above suggest it should do it upon approval instead.
You haven’t posted your registration call. Could you post that please, just so we’ve got the whole picture?
®SuccessId=`50`
[+wlpe.message+]
<div id="wlpeUser">
<form enctype="multipart/form-data" id="wlpeUserProfileForm" action="[~[*id*]~]" method="POST">
<fieldset id="wlpeUserProfileInput">
<div id="wlpeUserInfo">
<p id="wlpeProfileInfo" class="info">Use this form to approve [+view.username+]'s registration</p>
</div>
<legend>[+view.username+]'s User Profile</legend>
<!-- These hidden fields are IMPORTANT! -->
<input type="hidden" name="internalKey" value="[+view.internalKey+]" />
<input type="hidden" name="username" value="[+view.username+]" />
<label for="wlpeUserProfileFullName">Full Name
<input id="wlpeUserProfileFullName" type="text" name="fullname" value="[+view.fullname+]" />
</label>
<label for="wlpeUserProfileEmail">Email
<input id="wlpeUserProfileEmail" type="text" name="email" value="[+view.email+]" />
</label>
<input type="hidden" name="usergroup" value="S7 member" />
</fieldset>
<fieldset id="wlpeUserProfileButtons">
<button type="submit" id="wlpeApproveUserButton" name="service" value="approveuser">Approve</button>
<button type="submit" id="wlpeProfileDoneButton" name="service" value="cancel">Done</button>
<button type="submit" id="wlpeProfileDeleteButton" name="service" value="deleteuserprofile">Delete This Profile</button>
</fieldset>
</form>
</div>
[!WebLoginPE? &type=`register` ®Type=`pending` ®isterTpl=`registerForm` ¬ifyTpl=`notifyMessage` ®SuccessId=`53` &groups=`Pending Users` ®SuccessPause=`0` ¬ify=`carl@###.co.uk, allison@###.co.uk, vanessa@####.co.uk` &customFields=`fullname, gender, username, email, address, city, zip, state, country, phone, fax, business_type, subscriber`!]
[!WebLoginPE? &type=`manager` &activateId=`2` &groupsField=`usergroup` &usersList=`The following accounts require approval:default:approveNewUser:username:ASC:webgroup(Pending Users)`!]
[+wlpe.message+]
<div id="wlpeUser">
<form enctype="multipart/form-data" id="wlpeUserProfileForm" action="[~[*id*]~]" method="POST">
<fieldset id="wlpeUserProfileInput">
<div id="wlpeUserInfo">
<p id="wlpeProfileInfo" class="info">Use this form to approve [+view.username+]'s registration</p>
</div>
<legend>[+view.username+]'s User Profile</legend>
<!-- These hidden fields are IMPORTANT! -->
<input type="hidden" name="internalKey" value="[+view.internalKey+]" />
<input type="hidden" name="username" value="[+view.username+]" />
<label for="wlpeUserProfileFullName">Full Name
<input id="wlpeUserProfileFullName" type="text" name="fullname" value="[+view.fullname+]" />
</label>
<label for="wlpeUserProfileEmail">Email
<input id="wlpeUserProfileEmail" type="text" name="email" value="[+view.email+]" />
</label>
<input type="hidden" name="usergroup" value="Business Members" />
</fieldset>
<fieldset id="wlpeUserProfileButtons">
<button type="submit" id="wlpeApproveUserButton" name="service" value="approveuser">Approve</button>
<button type="submit" id="wlpeProfileDoneButton" name="service" value="cancel">Done</button>
<button type="submit" id="wlpeProfileDeleteButton" name="service" value="deleteuserprofile">Delete This Profile</button>
</fieldset>
</form>
</div>[!WebLoginPE? &type=`register` ®Type=`pending` ®isterTpl=`RegisterVerifyFormTpl` ¬ifyTpl=`notifyMessage` ®SuccessId=`227` ®SuccessPause=`3` ¬ify=`[email protected]`!]
[!WebLoginPE? &type=`register` ®Type=`pending` ®isterTpl=`RegisterVerifyFormTpl` ¬ifyTpl=`notifyMessage` ®SuccessId=`227` ®SuccessPause=`3` ¬ify=`[email protected]` &groups=`Pending Users`!]
[!WebLoginPE? &type=`register` ®Type=`pending` ®isterTpl=`RegisterVerifyFormTpl` ¬ifyTpl=`notifyMessage` ®SuccessId=`227` ®SuccessPause=`3` ¬ify=`[email protected]` &pendingGroups=`Pending Users`!]
&groups=`Pending Users`
you’re missingfrom your registration call&groups=`Pending Users`
&groups=`Pending Users`