restrict csv download

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
bescott53
Posts: 27
Joined: 2013-02-24 00:13

restrict csv download

Post by bescott53 » 2017-09-20 12:59

hi board, i used the sample code to restrict the csv download to a group here -http://bigprof.com/appgini/help/advance ... lename_csv

I now need to amend this to certain users so i tried to modify but it does not allow anyone to download, the update i made is below, can you help me?

function AP_master_data_init(&$options, $memberInfo, &$args){

$csvusers = array("123456789", "uk", "europe");

if(in_array($memberInfo['username']==$csvusers)){
$options->AllowCSV=1;
}else{
$options->AllowCSV=0;
}

return TRUE;

User avatar
a.gneady
Site Admin
Posts: 778
Joined: 2012-09-27 14:46
Contact:

Re: restrict csv download

Post by a.gneady » 2017-10-05 23:11

Try changing the if statement to this:

Code: Select all

 if(in_array($memberInfo['username'], $csvusers)){
:idea: Learn all the tips and tricks of customizing AppGini applications through our new online course.

AppGini: Responsive, collaborative web database applications in minutes.

bescott53
Posts: 27
Joined: 2013-02-24 00:13

Re: restrict csv download

Post by bescott53 » 2017-10-06 13:30

perfect, it works ok, thank you!

Post Reply