$modx->invokeEvent("OnWebSaveUser", array( "mode" => "new", "userid" => $key, "username" => $username, "userpassword" => $password, "useremail" => $email, "userfullname" => $fullname ));
Tale plugin potrebbe processare l’array $_POST, recuperare i dati di interesse e salvarli nel db (tutto senza che sia necessario toccare il codice originale di websignup.inc.php)... notevole!
<!-- #declare:separator <hr> --> <!-- login form section--> <!--INIZIO CODICE MODIFICATO --> <form method="post" name="websignupfrm" id="websignupfrm" action="[+action+]"> <!--FINE CODICE MODIFICATO--> <fieldset> <h3>User Details</h3> ... <h3>Bot-Patrol</h3> <p>Enter the word/number combination shown in the image below.</p> <label>Form code:* <input type="text" name="formcode" class="inputBox" size="20" /></label> <a href="[+action+]"><img align="top" src="manager/includes/veriword.php" width="148" height="60" alt="If you have trouble reading the code, click on the code itself to generate a new random code." style="border: 1px solid #039" /></a> </fieldset> <!--INIZIO CODICE AGGIUNTO --> <label for="disclaimer">Privacy Statement<br /><textarea name="disclaimer" cols="60" rows="6">Testo privacy</textarea></label><br /> <label for="agree"><input type="checkbox" id="agree" name="agree" value="agree" />I agree</label><br /> <!--FINE CODICE AGGIUNTO --> <fieldset> <input type="submit" value="Submit" name="cmdwebsignup" /> </fieldset> </form> <script language="javascript" type="text/javascript"> var id = "[+country+]"; var f = document.websignupfrm; var i = parseInt(id); if (!isNaN(i)) f.country.options[i].selected = true; <!--INIZIO CODICE AGGIUNTO --> document.getElementById("websignupfrm").onsubmit = function() { if (!document.getElementById("agree").checked) { alert("You must agree to the privacy statement to proceed"); return false; } return true; } <!--FINE CODICE AGGIUNTO --> </script> ...