Posted by mototribe on September 25, 2011 at 2:25am
I am trying to create a rule that prevents users to signup with usernames that contain spaces.
When I use the "user: after saving account" event I can the "block" action and show an error message.
However it's confusing to users because it says something like "administrator has been notified".
When I use the "before saving account" event I cannot seem to stop the account from being created,
even when I force a redirect.
Is there a solution that shows an error message and redirects the user back to the registration page?
thanks
UWE
Comments
Would require coding
Aborting the user registration process would require that you write a new Rules plugin – or possibly that you use Rules Forms and set form errors. (Haven't used this for Drupal 7 yet, so I can't say how it works, though.)
So sorry, no quick solution to this right now.
If you get it working with Rules Forms, it would be great with some updates here – I'm kind of curious.
Good luck,
//Johan Falk
**
Check out NodeOne's Drupal Learning Library! 190+ screencasts and exercises, for Drupal introduction, advanced configuration, and coding. Creative Commons license!
Thanks Johan
I've watched your Rules2 screencasts last week and learned about the power of rules.
I ended up writing (my first) module and got it do the validation in code.
I use the "username_check" Ajax module as well and could insert the same validations
there. That creates a better customer experience.
Keep your great tutorials coming - they rock!!!
Thanks again
UWE