We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22827
    • 129 Posts
    Hello, I am putting together a plugin that is intended to determine if a user is in a particular group, and then "do something" if they are.

    The something in this instance is to add them via the foxycart api customer_save.

    None of the system events appear to be triggered after a user is completely saved, and groups are updated. If I use "OnWebUserSave" for example, if I take a look at the web_user_attributes table when this is called, any updates made to their details have been commited to the table. However, if I look at group membership in web_groups, these still reflect the old settings.

    So it looks like OnWebUSerSave happens after the user attributes are updated, but before the groups are updated. Is that right? If so, is there an event I can use to get the end-state of a user?

    Thanks,

    Paul
      • 3749
      • 24,544 Posts
      It looks like your analysis is correct. I don’t see any way to do it other than either hacking the save_web_user.processor.php code or actually checking the user group info in your plugin. $_POST[’user_groups’] should be available, but depending on your setup, you might have to check both $_POST[’user_groups’] and the current usergroup settings for that user in the DB. Maybe someone else will have a better idea.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting