Zend certified PHP/Magento developer

h iguys this is my code: https://pastebin.com/da2CyXTr i want to check if a user have admin or either owner group, it is not working an always leads me to index.php, could someone tell me why?