Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

Allowing customers to submit Web App items without being logged in

Mentor ,
Mar 15, 2012 Mar 15, 2012

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.

Step 1. Create an anonymous user

To set this up, we'll need to create a "dummy" account that will be used each time a customer submits a new item.

createcontactbutton.png

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.

1createcontact.png

Then enter "Anonymous" in the Username field, and "User" as the Password.

Click "Save & Finish" to save the contact details.

Step 2. Insert the Web App input form on your page

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".

2webappinsert.png

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.

Step 3. Include the JavaScript

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.

TOPICS
Documentation
3.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 21, 2012 Aug 21, 2012

Thanks Mario - i cannot believe i did not see that

Been burning the candle at both ends lately


Tom

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 26, 2012 Nov 26, 2012

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 26, 2012 Nov 26, 2012

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 02, 2012 Dec 02, 2012

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 17, 2013 Jun 17, 2013

Adblock plus was the cultprit, first time it ever interferred with our code... lesson learned, thanks Liam!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 17, 2013 Jun 17, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 17, 2013 Jun 17, 2013

I tried with the non-plus version of adblock and the problem is apparent there too.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 04, 2012 Dec 04, 2012

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 17, 2013 Jun 17, 2013

We recently noticed that

jQuery.post('/ZoneProcess.aspx?ZoneID=-1', { Username: 'Anonymous', Password: 'User' });

No longer works on the latest version of Chrome.

chrome27-jquery-ajax-post-errorr.jpg

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 17, 2013 Jun 17, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 23, 2013 Nov 23, 2013

Campion Mario, just what I was looking for, worked a treat!

Cheers

Stephen

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 12, 2014 Mar 12, 2014
LATEST

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?

http://lbopg.businesscatalyst.com/manage/license-application-add-reference-response?appId=8016351&re...

Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines