rejetto forum

Referrer?

0 Members and 1 Guest are viewing this topic.

Offline yuuko008

  • Occasional poster
  • *
    • Posts: 3
    • View Profile
I want to ask if this is possible.
As you can see i am placing the download links from my server to my site, which means on different pages example.

http://mydomain.com
http://mydomain.com/topic
http://mydomain.com/topictopic

Is there a way that HFS will look if "mydomain.com" is in the url then allow the download?


Offline bacter

  • Operator
  • Tireless poster
  • *****
    • Posts: 681
    • View Profile
you can use the following macro in your template:

{.if |{.pos|mydomain.com|{.header|host.}.}|{: .... do something or set a variable you use later ....   :}.}

This might be useful, if you want to generate different pages depending what url is used to access your server, for example if you have more than one domain names, or if you want to distingush users from wan or from lan.

But if you publish or mail a full valid downloadlink (for example: http: // mydomain.com/topic/filename.ext) then the download request will be executed directly and the only way to avoid access is protecting your server with user access rights.
your computer has no brain - use your own !


Offline yuuko008

  • Occasional poster
  • *
    • Posts: 3
    • View Profile
i'm not really sure what to place i'm a real newbie in terms of coding.
Can you spoonfeed me for a little? I mean what is the exact code i need to place? And what will i place in this part
|{Set up variable for later use.........}


Offline bacter

  • Operator
  • Tireless poster
  • *****
    • Posts: 681
    • View Profile
I can only answer your question, that's what i have done.

1) there is a way to know if something is part of the request in the header and you can use this property in your template.

2) if you give a link to a file, the file will be downloaded (if access is not protected!) and you can't avoid it as a download request does not pass through the template.

I can not help you with 'exact code' as i don't know what you want to do or not to do...
your computer has no brain - use your own !


Offline yuuko008

  • Occasional poster
  • *
    • Posts: 3
    • View Profile
ahh ok so if i give the exact link to the file. Example. http://HFS-IP/File.ext then i cannot protect it anymore?


Offline maverick

  • Tireless poster
  • ****
    • Posts: 1052
  • Computer Solutions
    • View Profile
Is there a way that HFS will look if "mydomain.com" is in the url then allow the download?

This is maybe what you are looking for...

1. Switch HFS to Expert Mode
2. Select Menu -> Limits -> Allowed referer

Here you can specify a mask.  When a file is requested and the mask doesn't match the Referer Http field, the request is rejected.  If the mask matches then the download is allowed.
maverick


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
yes, that the option he is searching for.

you should enter *mydomain*
in that dialog