Hi,
This is what I have so far:
<?php if ( (true === $wb->is_authenticated()) && (true === in_array(1, $wb->get_groups_id() ) ) ) {
// admins
header('Content-disposition: attachment; filename=Prijscourant.pdf');
header('Content-type: application/pdf');
readfile('prijscouranten/bestand.pdf');
} elseif ( (true === $wb->is_authenticated()) && (true === in_array(2, $wb->get_groups_id() ) ) ) {
// group 2
echo 'Not available to you';
} elseif ( (true === $wb->is_authenticated()) && (true === in_array(3, $wb->get_groups_id() ) ) ) {
// group 3
header('Content-disposition: attachment; filename=Prijscourant.pdf');
header('Content-type: application/pdf');
readfile('prijscouranten/bestand.pdf');
} else {
// no group
echo 'Please Log in!';
}
?>
I created a new webpage within WB (Code2), with a template which contains just the text (no layout whatsoever). I uploaded the pdf file to
http://mywebsite.nl/pages/prices/prijscouranten/bestand.pdf because I haven't found out a solution yet to use a file from the media folder... do you know how this works?
Thanks in advance!