Copy link to clipboard
Copied
Using our Web Apps feature, you can easily allow customers to add their own dynamic Web App items. By default, however, customers are required to be logged in to a secure zone in order to submit their items.
With a little help from the handy jQuery framework, we can bypass this requirement - allowing visitors to anonymously submit new Web App items without the need for logging in to a secure zone.
Note: This guide assumes that you've already built a Web App with customer submitted items enabled - ready for inserting on a page. Find out more here.
To set this up, we'll need to create a "dummy" account that will be used each time a customer submits a new item.
Simply click Customers > Create new contact and create the customer, making sure to fill out the "Username" and "Password" fields.
For this example, we only need to enter in 3 fields - first up, we'll enter "Web App Submissions" as their first name.
Then enter "Anonymous" in the Username field, and "User" as the Password.
Click "Save & Finish" to save the contact details.
The next step is to insert our Web App input form on a page.
We'll create a new page and then navigate to Module Manager > Web Apps, and select "Web App Input Form for Customers".
Select the Web App you've set up to accept customer submitted items and then click "Insert" to see the form inserted on the page.
Next up, we need to include the jQuery code on our page.
Switch over to HTML mode, then insert the following code inside the HEAD of your page:
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function() {
jQuery.post('/ZoneProcess.aspx?ZoneID=-1', { Username: 'Anonymous', Password: 'User' });
});
</script>
Note: In this sample code, we're referencing a version of jQuery hosted on the jQuery site. If you are hosting the jQuery .js library on your site, simply change the src= tag to reference your own copy of the file.
Note2: You will want to use this example in conjuction with your form. If you have a web submission on a page you can log the person in as they load the page or you can do so during the .submit() process.
Make sure to replace "Anonymous" and "User" with the username and password we assigned our "dummy" customer record earlier.
This script uses jQuery to automatically log the visitor in using your anonymous username and password upon page load. When they go to submit the Web App item submission form, they'll already be logged in to the anonymous account behind the scenes -meaning the form will submit successfully and they'll be taken to the confirmation / approval page.
If you have approval rules set up, you'll still receive notifications as per usual and be required to approve the new Web App item before it is visible on the front-end of the site.
Finally, save and publish the page.
Copy link to clipboard
Copied
Thanks Mario - i cannot believe i did not see that
Been burning the candle at both ends lately
Tom
Copy link to clipboard
Copied
How safe is this seeing as someone can just view the source and find the line with the username / password?
jQuery.post('/ZoneProcess.aspx?ZoneID=-1', { Username: 'Anonymous', Password: 'User' });
Can any damage be done by someone who can find the that above line seeing as its viewable in a js file?
Copy link to clipboard
Copied
You only do this is your using this in a certain way, not in terms of acess to a secure area of importance.
You can create a nothing access zone and assign that to this fake user and so on.
Copy link to clipboard
Copied
I'm implemented this with sucess so thanks all for you your help.
A quick question, can I now send an email to an address gathered by the webapp thanksing them for their submission to the webapp?
Is the webapp auto responder what this is used for?
Copy link to clipboard
Copied
Adblock plus was the cultprit, first time it ever interferred with our code... lesson learned, thanks Liam!
Copy link to clipboard
Copied
I have already informed BC of the post and get issues with Adblock plus.
It's associated with some BC security changes as it used to work.
Also some of the admin now does not work.
Nothing really back from them yet.
Copy link to clipboard
Copied
I tried with the non-plus version of adblock and the problem is apparent there too.
Copy link to clipboard
Copied
Guys I'm really stuck on this and need some really urgent help!
Every time I submit the web app I get the "secure zone unauthorized" system page show up. I've followed the directions in the first post. I seem to get the same error that is mentioned in e-see's post above on29-Jul-2012 16:53.
Its the one about how it first does not work and I get the "secure zone unauthorized" system page and then I click "back", re-submit and it submits.
Here are the steps i've gone through.
1. set up a dummy user, identical to the credentials used in the first post
2. made a new webapp and inserted the form code using "modules > web apps > web apps inform"
3. Add the jquery login code "jQuery.post('/ZoneProcess.aspx?ZoneID=-1', { Username: 'Anonymous', Password: 'User' });" exactly like the first post says
4. created a new secure zone and subcribed the dummy user to it
what have I missed?
- is the dummy user not being loggged in?
- do i need to assign the page I inserted the web app form input on to the secure zone aswell?
- do I need to add jquery to log them out too?
Any help would be greatly apprieciated... i'm about at my wits end with this and don't know why its nots working. Seems pretty straight forward.
Appologies for the frantic tone on this... about to miss my deadline that hinges around this functionality.
Cheers,
JH
Copy link to clipboard
Copied
We recently noticed that
jQuery.post('/ZoneProcess.aspx?ZoneID=-1', { Username: 'Anonymous', Password: 'User' });
No longer works on the latest version of Chrome.
Tested here with jQuery 1.7.2 but the error is the same in the latest iterations of jQuery.
Can anyone confirm this problem? We tested with Chrome 27 on OS X 10.8.4 and Chrome 27 on Windows 7 64-bit.
The problem does not occur when trying with any other browser.
Copy link to clipboard
Copied
Can see the zone I'd being processed so you not done the code correctly as you shown. Still works fine so you aware so check your implementation.
Also, if you have Adblock plus on, turn it off.
Copy link to clipboard
Copied
Campion Mario, just what I was looking for, worked a treat!
Cheers
Stephen
Copy link to clipboard
Copied
I have just implemented this, but it's not yet working. Any help would be appreciated.
I added alerts to make sure that the script was getting called. I checked my chrome console for errors, but don't see any. I've included the module_loggedin tag, and it still says 0.
Are there any other debugging tools that might be helpful?
Thanks!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now