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

    I would like to ask somebody about behavior of "blocked" checkbox of webusers.

    When creating a webuser who is currently disabled and will be active on a specific date, for example,
    Today is Feb 7 2008. And I would like to create a webuser who is:
    -Blocked until Mar 1 2008
    -Blocked after Mar 1 2009

    I fill the new webuser form as follows and save it,
    -Blocked: [Not checked]
    -Blocked Until: [Mar 1 2008]
    -Blocked After: [Mar 1 2009]
    This information will be saved to database correctly.

    However, if I edit this user again, "Blocked" checkbox is displayed as "On".
    Because this webuser is not allowed to login now.
    I found the logic of this behavior on source code: mutate_web_user.dynamic.php.

    Then, if I do not remove "Blocked" check and save the webuser again, the "blocked" status will be stored into the database. So this webuser cannot login after "Blocked Until" date.
    To prevent this behavior, I always have to remove the "Blocked" check before saving this webuser.

    Is this a design ?

    I am not sure how this behavior should be changed to better,
    But I think "Blocked" checkbox should not describe "blocked now in some reason or not" status.

    Thank you,
    • Yes, you do have that the user is blocked until March 2008, so it will automatically save the "blocked" checkbox value as "1". It should automatically remove that when the blocked until date is passed.
        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
        • 19764
        • 4 Posts
        Hi

        I came up with the same idea.
        But someone might want to use "Blocked" checkbox to block the user for some time regardless of "Blocked Until" or "Blocked After" settings.
        In this case, "Blocked" flag should not be automatically removed when the "Blocked Until" date is passed.

        Thank you,