diff options
Diffstat (limited to 'BitUser.php')
| -rw-r--r-- | BitUser.php | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/BitUser.php b/BitUser.php index 1771e53..090b59f 100644 --- a/BitUser.php +++ b/BitUser.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/BitUser.php,v 1.115 2006/11/17 17:16:45 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/BitUser.php,v 1.116 2006/11/26 12:51:58 squareing Exp $ * * Lib for user administration, groups and permissions * This lib uses pear so the constructor requieres @@ -12,7 +12,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: BitUser.php,v 1.115 2006/11/17 17:16:45 spiderr Exp $ + * $Id: BitUser.php,v 1.116 2006/11/26 12:51:58 squareing Exp $ * @package users */ @@ -40,7 +40,7 @@ define("ACCOUNT_DISABLED", -6); * Class that holds all information for a given user * * @author spider <spider@steelsun.com> - * @version $Revision: 1.115 $ + * @version $Revision: 1.116 $ * @package users * @subpackage BitUser */ @@ -1265,37 +1265,9 @@ return false; } function getUserAttachments( &$pListHash ) { - global $gLibertySystem; - LibertyContent::prepGetList( $pListHash ); - - $ret = NULL; - $bindVars[] = $this->mUserId; - $mid = ''; - - if( $this->mUserId ) { - // TODO: this query should check for unique combinations of foreign_id *and* attachment_plugin_guid - // doing that causes mysql to choke - $query = "SELECT DISTINCT( a.`foreign_id` ) AS `hash_key`, a.* - FROM `".BIT_DB_PREFIX."liberty_attachments` a - WHERE a.`user_id` = ? $mid"; - $result = $this->mDb->query( $query, $bindVars, $pListHash['max_records'], $pListHash['offset'] ); - while( $res = $result->fetchRow() ) { - $attachments[] = $res; - } - $data = array(); - foreach( $attachments as $attachment ) { - $loadFunc = $gLibertySystem->getPluginFunction( $attachment['attachment_plugin_guid'], 'load_function' ); - $data[] = $loadFunc( $attachment ); - } - $ret['data'] = $data; - - // count all entries - $queryc = "SELECT COUNT( DISTINCT( a.`foreign_id` ) ) AS `attachment_count` - FROM `".BIT_DB_PREFIX."liberty_attachments` a - WHERE a.`user_id` = ? $mid"; - $ret['cant'] = $this->mDb->getOne( $queryc, $bindVars ); - } - return $ret; + $pListHash['user_id'] = $this->mUserId; + $libertyAttachable = new LibertyAttachable(); + return $libertyAttachable->getAttachmentList( $pListHash ); } function storeFavorite( $pContentId ) { |
