Guest User

Untitled

a guest
Nov 20th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. { "rules_validate_a_component_of_a_submitted_webform" : {
  2. "LABEL" : "Validate a component of a submitted webform",
  3. "PLUGIN" : "reaction rule",
  4. "OWNER" : "rules",
  5. "REQUIRES" : [ "rules", "rules_conditional", "webform_rules" ],
  6. "ON" : { "webform_rules_submit" : [] },
  7. "IF" : [
  8. { "NOT user_has_role" : { "account" : [ "user" ], "roles" : { "value" : { "2" : "2" } } } }
  9. ],
  10. "DO" : [
  11. { "drupal_message" : { "message" : "The webform component submitted by [data:contact_us_first_name-value] (= [data:contact_us_first_name-title]) [data:contact_us_last_name-value] (= [data:contact_us_last_name-title]) contains a field labeled u0022[data:contact_us_subject-title]u0022 which has value u0022[data:contact_us_subject-value]u0022 and another field u0022[data:contact_us_message-title]u0022 which has value u0022[data:contact_us_message-value-raw]u0022." } },
  12. { "variable_add" : {
  13. "USING" : { "type" : "text", "value" : "[data:contact_us_message-value-raw]" },
  14. "PROVIDE" : { "variable_added" : { "submitted_form_component_value" : "Submitted form component value" } }
  15. }
  16. },
  17. { "CONDITIONAL" : [
  18. {
  19. "IF" : { "text_matches" : { "text" : [ "submitted-form-component-value" ], "match" : "mail.ru" } },
  20. "DO" : [
  21. { "drupal_message" : {
  22. "message" : "Stop and listen! ... One of the form components of the form you just submitted (= u0022[submitted-form-component-value:value]u0022), contains some value that is not allowed around here ...",
  23. "type" : "error"
  24. }
  25. }
  26. ]
  27. }
  28. ]
  29. }
  30. ]
  31. }
  32. }
Add Comment
Please, Sign In to add comment