I am trying to pull all entries from a table into an array and restrict the access of the CSV download to this array.
here is what i have but its not working, anyone no why?
Code: Select all
function access_init(&$options, $memberInfo, &$args){
$sql_csvusers = array(sql("select `id` FROM `csv_allowed`"));
if(in_array($memberInfo['username'], $sql_csvusers)){
$options->AllowCSV=1;
}else{
$options->AllowCSV=0;
}
return TRUE;
}