We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10313
    • 375 Posts
    Hello!

    I’m trying to construct a user registration with verfication AND manager authorisation. Verification is built in. No problem. The admin receives a notification on new user registration. In this notification, there is a link to a "manage profile" page. There, the admin can see the entered values of the new user. Works fine up to here.

    I’m using
    [!WebLoginPE? &type=`manager` &manageProfileTpl=`tplManageProfile`!]

    for that manage profile page.

    I don’t know what I need to do to change the "blocked" value of the web_user_attributes table.
    I tried
    <input type="checkbox" id="wlpeUserProfileBlocked" name="blocked" value="1">

    but this doesn’t change anything, independet of the current value in the database and independet of the clicked state when submitting (i.e. I can neither set blocked to 1 nor to 0). I know that the checkbox doesn’t currently reflect the blocked state when calling that form. I will do this when my problem is solved.

    Any ideas?

    Thanks in advance
    Martin
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      WebLoginPE doesn’t have any method for dealing with blocked users (except for unblocking automatically when sending a new password).

      While it does allow some basic front-end profile editing (particularly to enable the editing of any custom fields that won’t show up in the Manager) and removal of a user (really more for the user to be able to remove himself if he so desires), it is clearly in no way meant to be a substitute for the Manager’s user management functionality.

      By the way, to enable this same feature in a site I’m working on, I set the default value of the "blocked" field to 1 in the database. Now every new web user by default is blocked. The manager user has to go in and unblock them.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 10313
        • 375 Posts
        Thanks, Susan.

        The point is, that I don’t want the admin to have to go to the manager panel, search the new user and then unblock him.

        That’s why I try to provide a web page which automatically loads the new user’s profile and from where the admin can unblock the user. I think, a small snippet will help me out here.

        BTW: If I were that admin, it would be very okay for me to use the MODx manager. But it is a client of mine ...

        Martin
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Then your best solution is to create a snippet to generate a mini-form that has a message "the user is blocked/not blocked" based on the results of a query to the web_users_attributes table, and update the table based on the submission of an "unblock" button. Put the snippet immediately after the WebLoginPE snippet.

          You also might be able to use a plugin to add a checkbox on the page using the OnViewUserProfile event, and then save the status of the checkbox using the OnWebSaveUser event.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org