concrete/src/User/Login/LoginService.php
private function getGroups($username)
    {
        if (!$this->entityManager) {
            return [];
        }

        $db = $this->entityManager->getConnection();
        $queryBuilder = $db->createQueryBuilder();

        $rows = $queryBuilder
            ->select('g.gName', 'u.uID')->from($db->getDatabasePlatform()->quoteSingleIdentifier('Groups'), 'g')
            ->leftJoin('g', 'UserGroups', 'ug', 'ug.gID=g.gID')
            ->innerJoin('ug', 'Users', 'u', 'ug.uID=u.uID AND (u.uName=? OR u.uEmail=?)')
            ->setParameters([$username, $username])
            ->execute();

        $groups = [];
        $uID = 0;
        foreach ($rows as $row) {
            $uID = (int) $row['uID'];
            $groups[] = $row['gName'];
        }

        if ($uID == USER_SUPER_ID) {
            $groups[] = 'SUPER';
        }

        return $groups;
    }
private function getGroups($username)
    {
        if (!$this->entityManager) {
            return [];
        }

        $db = $this->entityManager->getConnection();
        $queryBuilder = $db->createQueryBuilder();

        $rows = $queryBuilder
            ->select('g.gName', 'u.uID')->from($db->getDatabasePlatform()->quoteSingleIdentifier('Groups'), 'g')
            ->leftJoin('g', 'UserGroups', 'ug', 'ug.gID=g.gID')
            ->innerJoin('ug', 'Users', 'u', 'ug.uID=u.uID AND (u.uName=? OR u.uEmail=?)')
            ->setParameters([$username, $username])
            ->execute();

        $groups = [];
        $uID = 0;
        foreach ($rows as $row) {
            $uID = (int) $row['uID'];
            $groups[] = $row['gName'];
        }

        if ($uID == USER_SUPER_ID) {
            $groups[] = 'SUPER';
        }

        return $groups;
    }
private function getGroups ( $ username ) { if ( ! $ this -> entityManager ) { return [ ] ; } $ db = $ this -> entityManager -> getConnection ( ) ; $ queryBuilder = $ db -> createQueryBuilder ( ) ; $ rows = $ queryBuilder -> select ( 'g.gName' , 'u.uID' ) -> from ( $ db -> getDatabasePlatform ( ) -> quoteSingleIdentifier ( 'Groups' ) , 'g' ) -> leftJoin ( 'g' , 'UserGroups' , 'ug' , 'ug.gID=g.gID' ) -> innerJoin ( 'ug' , 'Users' , 'u' , 'ug.uID=u.uID AND (u.uName=? OR u.uEmail=?)' ) -> setParameters ( [ $ username , $ username ] ) -> execute ( ) ; $ groups = [ ] ; $ uID = 0 ; foreach ( $ rows as $ row ) { $ uID = ( int ) $ row [ 'uID' ] ; $ groups [ ] = $ row [ 'gName' ] ; } if ( $ uID == USER_SUPER_ID ) { $ groups [ ] = 'SUPER' ; } return $ groups ; }
Aggregate a list of groups to report

@param $username
@return array
Aggregate a list of groups to report