You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I need to protect a directory with time-limit, but allow any file in this
directory (including subdirs), without specifically encoding a new URL for each
file.
Please find the attached patch that adds the above option.
To use it:
In the apache configuration path, put:
<Location /datafiles/>
AuthTokenSecret "foobar"
AuthTokenPrefix /datafiles/
AuthTokenTimeout 60
AuthTokenAnyPath on
</Location>
And so any (valid) encoded time under "/datafiles/" will work, regardless of
the actual file being accessed.
Example:
<?php
$secret = "foobar"; // Same as AuthTokenSecret
$protectedPath = "/datafiles/"; // Same as AuthTokenPrefix
$hexTime = dechex(time()); // Time in Hexadecimal
// NOTE: No file name is encoded, just the time
$token = md5($secret . $hexTime);
// build the url
$url = "http://myserver.com/datafiles/$token/any/file.would.work.txt";
?>
Hope this helps someone.
regards,
-gordon
Original issue reported on code.google.com by [email protected] on 2 Nov 2011 at 10:14
Original issue reported on code.google.com by
[email protected]
on 2 Nov 2011 at 10:14Attachments:
The text was updated successfully, but these errors were encountered: