diff options
| author | Lester Caine <lester@lsces.co.uk> | 2006-02-09 13:19:20 +0000 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2006-02-09 13:19:20 +0000 |
| commit | b0df73c83d6ca643c1d6cc6154675a71c0889031 (patch) | |
| tree | be319f8f4e56b847397b1d4e6f1dff5b0b916d4e /Pigeonholes.php | |
| parent | 826274202b1944b2642fc879e601248728e783a3 (diff) | |
| download | pigeonholes-b0df73c83d6ca643c1d6cc6154675a71c0889031.tar.gz pigeonholes-b0df73c83d6ca643c1d6cc6154675a71c0889031.tar.bz2 pigeonholes-b0df73c83d6ca643c1d6cc6154675a71c0889031.zip | |
Filter lists of content by group_id ( only enabled when gatekeeper is off )
Diffstat (limited to 'Pigeonholes.php')
| -rw-r--r-- | Pigeonholes.php | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/Pigeonholes.php b/Pigeonholes.php index 38260b9..4dde094 100644 --- a/Pigeonholes.php +++ b/Pigeonholes.php @@ -1,6 +1,6 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_pigeonholes/Pigeonholes.php,v 1.42 2006/02/08 23:24:28 spiderr Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_pigeonholes/Pigeonholes.php,v 1.43 2006/02/09 13:19:20 lsces Exp $ * * +----------------------------------------------------------------------+ * | Copyright ( c ) 2004, bitweaver.org @@ -17,7 +17,7 @@ * Pigeonholes class * * @author xing <xing@synapse.plus.com> - * @version $Revision: 1.42 $ + * @version $Revision: 1.43 $ * @package pigeonholes */ @@ -130,6 +130,12 @@ class Pigeonholes extends LibertyAttachable { $bindVars[] = strtoupper( $pListHash['title'] ); } + if( !$gBitSystem->isPackageActive( 'gatekeeper' ) ) { + $groups = array_keys($gBitUser->mGroups); + $where .= ( empty( $where ) ? " WHERE " : " AND " )." lc.`group_id` IN ( ".implode( ',',array_fill ( 0, count( $groups ),'?' ) )." )"; + $bindVars = array_merge( $bindVars, $groups ); + } + $order = "ORDER BY lc.`content_type_guid`, lc.`title` ASC"; $ret = array(); @@ -184,6 +190,12 @@ class Pigeonholes extends LibertyAttachable { $bindVars[] = $pListHash['content_type']; } + if( !$gBitSystem->isPackageActive( 'gatekeeper' ) ) { + $groups = array_keys($gBitUser->mGroups); + $where .= ( empty( $where ) ? " WHERE " : " AND " )." lc.`group_id` IN ( ".implode( ',',array_fill ( 0, count( $groups ),'?' ) )." )"; + $bindVars = array_merge( $bindVars, $groups ); + } + if( !empty( $pListHash['sort_mode'] ) ) { $where .= " ORDER BY ".$this->mDb->convert_sortmode( $pListHash['sort_mode'] )." "; } else { @@ -321,7 +333,7 @@ class Pigeonholes extends LibertyAttachable { * @access public **/ function getList( &$pListHash ) { - global $gBitSystem; + global $gBitSystem, $gBitUser; LibertyContent::prepGetList( $pListHash ); $ret = $bindVars = array(); @@ -343,6 +355,11 @@ class Pigeonholes extends LibertyAttachable { $where .= " UPPER( lc.`title` ) LIKE ? "; $bindVars[] = '%'.strtoupper( $pListHash['find'] ).'%'; } + if( !$gBitSystem->isPackageActive( 'gatekeeper' ) ) { + $groups = array_keys($gBitUser->mGroups); + $where .= ( empty( $where ) ? " WHERE " : " AND " )." lc.`group_id` IN ( ".implode( ',',array_fill ( 0, count( $groups ),'?' ) )." )"; + $bindVars = array_merge( $bindVars, $groups ); + } if( !empty( $pListHash['sort_mode'] ) ) { $order .= " ORDER BY ".$this->mDb->convert_sortmode( $pListHash['sort_mode'] )." "; |
