Webform Remote Submission is an add-on module for webform that allows a D7 site to accept webform submissions from third-party (including non-Drupal) sites while preventing XSS attacks. I've created a demo site with a few simple examples for people to try out as well.
My five year anniversary of being a drupal.org member is this week, and I figure it's time to contribute more code to the project. I intend to review some other project applications to help with the process and community.
There is a webform_remote_post module, but it does pretty much the opposite of this module: it allows you to post locally-submitted webform data to a remote service like a CRM.
My rationale for creating this is that no such project exists for the remote submission of webforms, although there have been some requests for such functionality. I had a potential client who wanted to build a petitioning/campaign system using their existing Drupal site so they could have their partner/affiliate sites across the internet share their campaign with their user base. I thought it a great idea, and this is the first step to building such a capability in Drupal.
Project Page:
https://drupal.org/sandbox/molenick/1956784
Git sandbox:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/molenick/1956784.git webform_remote_submission
Ventral.org automated review:
http://ventral.org/pareview/httpgitdrupalorgsandboxmolenick1956784git
Reviews of other projects:
https://drupal.org/node/1971496#comment-7422052
https://drupal.org/node/1962564#comment-7424584
https://drupal.org/node/1997504#comment-7424656
https://drupal.org/node/1995954#comment-7424730
https://drupal.org/node/1913916#comment-7424850
https://drupal.org/node/1986148#comment-7424926
https://drupal.org/node/1978804#comment-7425056
https://drupal.org/node/1997696#comment-7425164
Comments
Comment #0.0
molenick commentedAdded ventral.org automated review link.
Comment #1
PA robot commentedWe are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #2
chetan-singhal commentedHi molenick,
When you have only one checkbox option then why you use checkboxes type.
line no-73,74
line no-80,81
for more info about drupal form api
drupal form api
Comment #3
molenick commentedThank you cpsinghal - I overlooked that. I changed those form items to use checkbox controls since they only have a single boolean option each. It's changed in the latest commit.
Comment #3.0
molenick commentedAdded rationale.
Comment #3.1
molenick commentedAdded more rationale and reviewed projects.
Comment #4
molenick commentedAdding bonus tag w/ 5 reviews.
Comment #4.0
molenick commentedAdded more review links.
Comment #4.1
molenick commentedAnother review.
Comment #4.2
molenick commentedAdding another review.
Comment #5
stefan lehmannHey!
Nice idea for a module. The automatic review says your module is clean.
Manual code review of branch 7.x-1.x
I looked for quite a while and couldn't find any obvious major flaws. Two minor points which may or may not need fixing.
Apart from that, I think $_SERVER['REFERER'] is quite unreliable afaik. Depending on the browser it might be set or not. So I wouldn't rely on that for a backlink. You could add the option to add a backlink URL to the remote form / success page as an additional hidden field in the remote form, I suppose.
Comment #6
klausimanual review:
Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #7
molenick commentedThank you for your time, Stefan and Klausi. I believe I've addressed your concerns in my latest commits. I'll go through:
Stefan:
Those functions now return true, there was some cruft leftover from when I was using checkboxes instead of checkbox.
I know $_SERVER['REFERER'] can be unreliable, and would like to find a better method in the future. I'm considering adding form values for redirection, but that will require more thought, planning and a future release. :) If it seems too half-baked, I can cut it from this release and punt it forward.
Klausi:
I made the general changes you suggested such as those around documentation, hook use and sanitization.
I made some changes so that rather than embedding HTML, a 3rd party site using a remote webform will embed some javascript that requests a new form each time. This means that each use will have unique security tokens which should eliminate the possibility of using this for CSRF.
I'll make some time to do a few more reviews soon.
Comment #8
klausiSorry for the delay. Make sure to review more project applications and get a new review bonus and this will get finished faster.
So as far as I understand it that Javascript HTTP request to your Drupal site will never send the cookies along because of the same origin policy. Which means that all webform submissions will be done as anonymous user, right? That might not be a problem for you, but you should mention that in the README.txt that remote submissions will only work for anonymous users.
Strictly speaking users might not even need your module, since all Drupal forms for anonymous users can be embedded on other sites. It is just a matter of Javascript or Iframe skills to include a webform on another site. Might also be interesting for README.txt.
Otherwise looks RTBC to me.
Assigning to mitchell as he might have time to take a final look at this.
Comment #9
molenick commentedThank you again Klausi for your time.
My thoughts are that this is mostly useful for anonymous users - authenticated users would have the privilege of submitting a webform at the originating site. I didn't think of the fact that cookies wouldn't be passed, and I'll update README.txt to reflect that's the case.
My main goal in working on this was to provide a way to for multiple sites to submit back to a common site collecting webform submissions. Imagine multiple sites (Drupal or not) have a common goal in collecting information from users (petitions, surveys, etc) - this would allow them to work together and have a central repository for any information that they collect.
It's true that it could be done another way, but I wanted to create a drop in module so that could handle this kind of task in a predetermined way. In the future, I'd like to add optional blacklisting/whitelisting and some templating options to provide a starting point for having multiple sites aggregate webform submissions back to a single drupal instance.
Comment #10
klausino objections for more than a week, so ...
Thanks for your contribution, molenick!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #11
molenick commentedThank you everyone for your time and consideration. I'll make sure to read through those docs. :)
Comment #12.0
(not verified) commentedAnother review.