in reply to Random directory creation/deletion scheduling logic problem

The simplest method I can think of would be to password protect the URL using htaccess.

You can then create a login on purchase and delete it after the 24 hour window without having to worry about moving directories, etc.

For implementation, I'd start with HTTPD::UserAdmin as it let's you add meta info to htpasswd files really easily...

$auth->add($username, $password, { 'expired_after' => time + 86_400 }) # ... and then later using cron or something ... my $meta = $auth->fetch($username, 'expired_after'); $auth->delete($username) if $meta->{'expired_after'} < time;


Replies are listed 'Best First'.
Re^2: Random directory creation/deletion scheduling logic problem
by hmbscully (Scribe) on Nov 17, 2005 at 20:20 UTC
    This would be a great solution, but I'm not on Apache. I'm on a really old Netscape Server and as far as I know (from the one old manual I still have), there's no htaccess file in this web server. And I don't have that module and its just easier to assume I'll never have it.

    I don't want to come off as a total naysayer, these are good ideas and I appreciate them, I'm just trying to work within the restrictions that I know I have to work in.

      Netscape has support for .htacces-like functionality via it's .nsconfig files, and HTTPD::UserAdmin has support for DBM files, which .nsconfig's RequireAuth uses.

      As for not having the module:-

      It's a pure-Perl implementation, so there is zero reason you couldn't install it yourself if you're allowed to upload files, with the worst case scenario being you cut n' paste the module directly into your Perl script.


        Thanks, I'll look into the .nsconfig solution. As for the module thing... there's just something amiss with the whole perl install on this server. Even when the unix admins install modules, sometimes they just don't work. There are three separate perl installs on this server, 2 don't work and its just a mess to figure out where to even install a module becuase the paths are a nightmare anymore. I forgot I could put a module in the code direct.