restrict csv download

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
bescott53

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: 1281
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: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

bescott53

Re: restrict csv download

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

perfect, it works ok, thank you!

Post Reply