Filter works almost but not consistent - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Filter works almost but not consistent (/showthread.php?tid=75751) |
Filter works almost but not consistent - Hielemedia - 03-12-2020 Hello all, first post here ! I do have a filter to check if a user has admin rights. The filter should work for all admin/* and admin url's. But, it works for admin/dashboard but doesn't work on other url's in admin, like 'admin/users' or 'admin/menus' for example. My question is: How come ? The filter file: PHP Code: <?php The filter config: PHP Code: <?php namespace Config; What is wrong ? It works for one url and not for others in admin/.... RE: Filter works almost but not consistent - Gary - 04-18-2020 Seems like both outcomes in the filter are redirecting to the same location: 'error/show/nonadmin'. As an aside, I believe the namespace is supposed to be the very first item after the opening tag: <?php namespace... |