[ic] Problem with set/check_file_acl (?)

Gabriel Cooper interchange-users@icdevgroup.org
Wed Jul 2 17:12:00 EDT 2003


I am trying to set up a store with downloadable
documents and have run into a rather simple roadblock.
When someone buys a downloadable document and arrive
at receipt.html there's a link to "Download Now!".

When the click the link they /always/ receive a 404 error
generated by deliver.html (the page that delivers the
document).

I have narrowed the problem all the way down to the
set/get of an authorization variable. receipt.html
sets the variable, deliver.html checks it and if the
check returns true then you get your document.

Unfortunately the "check_file_acl" userdb function is
always returning *nothing*. Not 0 (false), nor 1 (true).

I'm stumped and don't know what's wrong. The code
that sets it as well as the code that checks it is
straight from the normal stock implementation of the
Interchange foundation store (AFAIK) so I really don't
see why this isn't working.

below is the set/check code from the two pages:

In receipt.html:

[set download_present][/set]
[item-list]
  [if-item-field download]
    [if !value fax_order]
      [set download_present]1[/set]
      [userdb
        function=set_file_acl
        mode="expire 7 days"
        location="[item-code]"
      ]
    [/if]
  [/if-item-field]
[/item-list]


In deliver.html:

[seti authorized][userdb
  function=check_file_acl
  location="[scratch deliverable]"
  mode=expire
][/seti][perl products]
    my $auth = $Scratch->{authorized};
    if($auth !~ /1/) {
        Log("Not authorized for $Scratch->{deliverable}, 403");
        $Document->header('Status: 403 Not authorized');
        $Document->hot(1);
        $Document->write(<<EOF);
Sorry, not authorized for $Scratch->{deliverable}. Buy it first, please.
EOF
        return;
    }

and it of course always fails the 'if' and sends the user a 404 error.

Oddly enough IE users don't see the "buy it first" error, they
only see the big non-descript "Not Authorized" error.





More information about the interchange-users mailing list