Filter User Accounts

5 posts by 2 authors in: Forums > CMS Builder
Last Post: March 23, 2020   (RSS)

By daniel - February 7, 2020

Hi AlanAlonso,

It looks like you have the right idea but in the slightly wrong order. The line if ($tableName == 'accounts') { return $accessWhere; } will return the original "$accessWhere" variable if the table is "accounts" and skip the rest of the function. Try out this instead and let me know if it does the trick:

function filterUser($accessWhere, $tableName) {
  /* only check the accounts section */
  if ($tableName == 'accounts') { 
    $accessWhere .= " AND 'num' != '1' ";
  }
  
  return $accessWhere;
}

Thanks,

Daniel
Technical Lead
interactivetools.com

Hi Daniel,

First of all thank you for the reply, the code is still not working, I upload the file to plugins folder, then I activate the plugin and set Required Plugins at the Advanced tab on Section Editors.

By daniel - February 18, 2020

Hi AlanAlonso,

This is, unfortunately, a difficult issue to troubleshoot over the forums. If you can support a 2nd level support request with your CMS/FTP details (https://www.interactivetools.com/support/request/) we can take a look directly and have an easier time seeing what's going on.

Thanks!

Daniel
Technical Lead
interactivetools.com

By AlanAlonso - March 23, 2020 - edited: March 23, 2020

Fixed

$accessWhere .= " AND `num` != '1' ";