summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Pigeonholes.php23
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'] )." ";