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

    I’m planning to make a plugin for webloginpe, based on the dob value (I would like to check if the user sets or changes his dob).

    For that plugin, I need to check on register if a field was entered or not
    (that’s easy, $this->OnBeforeWebSaveUser returns me the User in the format $user[$field]=$value;)

    And I also need to check on the Save Profile, but I have multiple problems :

    1. The $this->OnBeforeWebSaveUser format is like :
    $user[fieldnumber]=' `field`= fieldvalue '

    Do I have to change the webloginpe class by adding lines like
    $generalElementsUpdateNoformat[field] = " `".$modx->db->escape(stripslashes(htmlentities(trim($_POST[$field]), ENT_QUOTES)))."` ";
    $this->OnBeforeWebSaveUser($generalElementsUpdateNoformat, $extendedFieldValuesNoformat);
    
    ? Is it a bug for me or is it planned to have a different format than the registration ?

    2. Whether I’m changin it or not, I would like to do something like a "diff" between the OnBeforeWebSaveUser event ($Attributes[’dob’]) and the OnWebSaveUser event ($user[’dob’]). But they seem to have the same value. What am I doing wrong ?