Is it possible to hide parts of a returning URL from the users address bar?

spessex's picture

I'm not sure if I'm asking the impossible here but is it possible to hide part of a returning URL from a User's address bar to a Drupal site.

The reason I am asking is that I am firing a Rule on a user returning to a particular URL (which they will have been automatically redirected to from another non-Drupal website) which assigns them user points. Obviously I don't want people to cotton onto this URL that is firing the points Rule, otherwise they might tell other users to visit the pages to receive points hence the original question, is there a way to hide part of this URL?

So for example:

If a user gets redirected from an external non Drupal site to my Drupal site http://www.examplesite.com/accrue_user_points, I don't want the user to see http://www.examplesite.com/accrue_user_points in their URL. I want it to say anything but this for example http://www.examplesite.com/some_other_link_page (they don't necessarily need to go to this page but the address bar just needs to show this new URL).

If this is not possible if anyone could suggest another way around this I'l love to hear it.

Thank you

Stephen

Comments

Can this be solved using a

flapsjack's picture

Can this be solved using a one-time use token that increments the points counter for the user and then invalidates the token? Or does the url need to always increment the user's point value?

The URL should only add

spessex's picture

The URL should only add points to the user on one time only. After that the URL would need to change or expire so users could not re-access the same URL to keep accumulating points.

I have tried one way which uses the Node Limit module which does do the job in my instance by preventing more than one content type being created for that particular user but unfortunately it provides an unsightly 'Access denied. You are not authorized to access this page.' page. Additionally I can't then appear to use the node:url rule on that page as it doesn't recognise it once is has the Access Denied etc.

Do you know of any good articles that explain your principle?

Cheers

Ste

So just to give me a little

flapsjack's picture

So just to give me a little more background on your application, let me ask a few more questions.

You said that the user would come to your site from a link posted elsewhere. Is there some action on your site that automatically sets up the ability for a particular user account to gain the points when a specific link is visited?

Does the person visiting your site have to be logged in or just by simply visiting the url, the points are accrued for someone on your site?

Once I understand the scope of your application, I think I'll be able to better assist you.

Yes. Basically I'm using

spessex's picture

Yes. Basically I'm using LimeSync so users are sent from the Drupal site (via a survey link) to a Lime Survey site. Once they have completed the survey (and haven't been screened out to a rejection page) they are automatically redirected back to a 'Thank you for completing the survey' type page (on the Drupal site) which via a Rule then assigns them User Points. The issue lies in that the 'Thank you for completing the survey' page is the same URL, so essentially it would only take 1 savvy user to work out that every time they went to that page they would accrue points hence why I'm trying to work out something that changes/expires (or similar) the link.

There's possibly a way to tell the Rule to only let the user access this page one time but I cant quite figure that out either! ;)

Are you able to supply

flapsjack's picture

Are you able to supply anything you want to LimeSync as the success redirect URL?

If so, then you could add a unique token to the url such as http:///accrue_user_points?token=123RANDOMwithmoreRANDOM. At the same time you generate the random token, you store it on your drupal site as a valid token.

Once that url is visited, you could use the passed back token to look up the user the token is associated with, and appropriately increment user points to that individual as well as invalidate the token so it can't be used again.

Does that make sense?

I'm not sure. I'll have to

spessex's picture

I'm not sure. I'll have to look into to it.

It's sounds s little complicated but I'm sure once I've digested it I can give it a shot.

Thanks again (I may shoot back with a couple of questions once it's sunk in!)

United Kingdom

Group events

Add to calendar

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: