We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4429
    • 429 Posts
    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 ;-)
      • 1892
      • 82 Posts
      Quote from: x0149128 at Dec 22, 2009, 08:31 AM

      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 ;-)

      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
        • 4429
        • 429 Posts
        Quote from: apcherry at Dec 29, 2009, 11:50 AM



        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


        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?
          • 4429
          • 429 Posts
          @apcherry


          How exactly did you use this code in your template?

          <input type="hidden" name="usergroup" value="S7 member" />


          for example the input for the email would be:

          <label for="wlpeUserProfileEmail">Email
          			<input id="wlpeUserProfileEmail" type="text" name="email" value="[+view.email+]" />
          
          			</label>


          Going by that, then your code needs to be wrapped in some <label> tags but also needs something like for="wlpeUserProfileEmail"
            • 1892
            • 82 Posts
            Quote from: x0149128 at Jan 08, 2010, 07:47 AM

            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?

            You’re quite right this way sends an email to the user on approval. When a user registers the call
            &regSuccessId=`50`
            sends them to a page which thanks for them for registering and saying an email will be sent once their request has been checked. The admin person gets an email telling them that a new registration request has been made.

            Sorry I’m new to ModX and php so I’m not too sure what you mean by registration call. What I then setup is a resource page to list all the users in the "Pending Users" group. As mentioned in my previous post I chose to override the default template, using approveNewUser in the userslist field. This is my login chunk called approveNewUser. It still needs a bit of work to tidy things up, I’ve just got a barebones system working at the moment as I’m still learning
            [+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>
            
            

            Then when the admin bod goes to the approval page and presses the Approve button the user gets an email with an account link and an activation password.

            Does this answer your question about the hidden usergroup? Please ask if I’ve not been clear enough.

            Adrian
              • 4429
              • 429 Posts
              Thanks. Unfortunately this just does work for me at all.

              My call on the registration page is:
              [!WebLoginPE? &type=`register` &regType=`pending` &registerTpl=`registerForm` &notifyTpl=`notifyMessage` &regSuccessId=`53` &groups=`Pending Users` &regSuccessPause=`0` &notify=`carl@###.co.uk, allison@###.co.uk, vanessa@####.co.uk` &customFields=`fullname, gender, username, email, address, city, zip, state, country, phone, fax, business_type, subscriber`!]


              Then my admin page call is:
              [!WebLoginPE? &type=`manager` &activateId=`2` &groupsField=`usergroup` &usersList=`The following accounts require approval:default:approveNewUser:username:ASC:webgroup(Pending Users)`!]


              My chunk is:
              [+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>



              Now when i click "Approve" nothing happens. The user is still in the Pending Users group. Also no email is sent to the user either.

              I need the user to be moved into the ’Business Members’ group.



                • 26482
                • 138 Posts
                Hi,

                Trying to get new registers into the Pending users group just doesn’t work for me. I do have a Web Users Group called Pending Users.

                My registration call (version 1):

                [!WebLoginPE? &type=`register` &regType=`pending` &registerTpl=`RegisterVerifyFormTpl` &notifyTpl=`notifyMessage` &regSuccessId=`227`  &regSuccessPause=`3` &notify=`[email protected]`!]


                Version 2
                [!WebLoginPE? &type=`register` &regType=`pending` &registerTpl=`RegisterVerifyFormTpl` &notifyTpl=`notifyMessage` &regSuccessId=`227`  &regSuccessPause=`3` &notify=`[email protected]` &groups=`Pending Users`!]


                Version 3
                [!WebLoginPE? &type=`register` &regType=`pending` &registerTpl=`RegisterVerifyFormTpl` &notifyTpl=`notifyMessage` &regSuccessId=`227`  &regSuccessPause=`3` &notify=`[email protected]` &pendingGroups=`Pending Users`!]


                Whatever call I make, a new user is created but is added to no group.

                What am I doing wrong here? I have the latest code (from Google Code, the apr-2009 version).

                Thanks.


                  • 4429
                  • 429 Posts
                  you’re missing
                  &groups=`Pending Users`
                  from your registration call
                    • 26482
                    • 138 Posts
                    Hi,

                    Thanks for replying.

                    Quote from: x0149128 at Jan 11, 2010, 08:55 AM

                    you’re missing
                    &groups=`Pending Users`
                    from your registration call

                    You’re right in version 1, however also in versions 2 and 3 nothing happens, where the
                    &groups=`Pending Users`
                    is present. Correct?

                      • 4429
                      • 429 Posts
                      You need to have it in version 1 as this where the user first signs up and WLPE needs to know what group to put them in.

                      Be sure to double check the name of the group you created and what you put in your call. I belive that it is case sensitive too.

                      That part all works fine or me. Using the latest version of WLPE from the MODX Extra’s page.