concrete/src/Permission/IPService.php
public function getRanges($type, $includeExpired = false)
    {
        $sql = 'SELECT * FROM LoginControlIpRanges WHERE lcirType = ?';
        $params = [(int) $type];
        if (!$includeExpired) {
            $sql .= ' AND (lcirExpires IS NULL OR lcirExpires > ' . $this->connection->getDatabasePlatform()->getNowExpression() . ')';
        }
        $sql .= ' ORDER BY lcirID';
        $result = [];
        $dateTimeFormat = $this->connection->getDatabasePlatform()->getDateTimeFormatString();
        $rs = $this->connection->executeQuery($sql, $params);
        while (($row = $rs->fetch()) !== false) {
            yield IPRange::createFromRow($row, $dateTimeFormat);
        }
    }
public function getRanges($type, $includeExpired = false)
    {
        $sql = 'SELECT * FROM LoginControlIpRanges WHERE lcirType = ?';
        $params = [(int) $type];
        if (!$includeExpired) {
            $sql .= ' AND (lcirExpires IS NULL OR lcirExpires > ' . $this->connection->getDatabasePlatform()->getNowExpression() . ')';
        }
        $sql .= ' ORDER BY lcirID';
        $result = [];
        $dateTimeFormat = $this->connection->getDatabasePlatform()->getDateTimeFormatString();
        $rs = $this->connection->executeQuery($sql, $params);
        while (($row = $rs->fetch()) !== false) {
            yield IPRange::createFromRow($row, $dateTimeFormat);
        }
    }
public function getRanges ( $ type , $ includeExpired = false ) { $ sql = 'SELECT * FROM LoginControlIpRanges WHERE lcirType = ?' ; $ params = [ ( int ) $ type ] ; if ( ! $ includeExpired ) { $ sql .= ' AND (lcirExpires IS NULL OR lcirExpires > ' . $ this -> connection -> getDatabasePlatform ( ) -> getNowExpression ( ) . ')' ; } $ sql .= ' ORDER BY lcirID' ; $ result = [ ] ; $ dateTimeFormat = $ this -> connection -> getDatabasePlatform ( ) -> getDateTimeFormatString ( ) ; $ rs = $ this -> connection -> executeQuery ( $ sql , $ params ) ; while ( ( $ row = $ rs -> fetch ( ) ) !== false ) { yield IPRange :: createFromRow ( $ row , $ dateTimeFormat ) ; } }
Get the list of currently available ranges.

@param int $type (one of the IPService::IPRANGETYPE_... constants)
@param bool $includeExpired Include expired records?

@return IPRange[]|\Generator
Get the list of currently available ranges .