/** * Returns an array of role_id => role_type of all the roles defined * * @return array */ static function getRoles() { $oConfig = PPI_Helper::getConfig(); if (isset($oConfig->user->roleMappingService) && $oConfig->user->roleMappingService == 'database') { $oUser = new APP_Model_User_Role(); $aRoles = $oUser->getList()->fetchAll(); $aRetRoles = array(); foreach ($aRoles as $aRole) { $aRetRoles[$aRole['name']] = $aRole['id']; } return $aRetRoles; } else { return $oConfig->system->roleMapping->toArray(); } }